[PVFS2-CVS] commit by pcarns in pvfs2/src/io/trove/trove-dbpf: dbpf.h

CVS commit program cvs at parl.clemson.edu
Tue Sep 28 10:05:31 EDT 2004


Update of /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf
In directory parlweb:/tmp/cvs-serv29646

Modified Files:
	dbpf.h 
Log Message:
fix bugs in dbpf SYNC macros that show up on non-aio systems and prevent io
list operations from completing sometimes:
- don't reset "ret" unless an error occurs (may need to preserve ret=1 to
  complete operations in general case)
- a little bit better errno handling in file descriptor sync cases


Index: dbpf.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/trove/trove-dbpf/dbpf.h,v
diff -p -u -r1.48 -r1.49
--- dbpf.h	17 Sep 2004 21:15:43 -0000	1.48
+++ dbpf.h	28 Sep 2004 13:05:30 -0000	1.49
@@ -398,13 +398,15 @@ void dbpf_error_report(const char *errpf
 
 #define DBPF_AIO_SYNC_IF_NECESSARY(dbpf_op_ptr, fd, ret)  \
 do {                                                      \
+    int tmp_ret, tmp_errno;                               \
     if (dbpf_op_ptr->flags & TROVE_SYNC)                  \
     {                                                     \
-        if ((ret = DBPF_SYNC(fd)) != 0)                   \
+        if ((tmp_ret = DBPF_SYNC(fd)) != 0)               \
         {                                                 \
+            tmp_errno = errno;                            \
+            ret = -trove_errno_to_trove_error(tmp_errno); \
             gossip_err("aio fd [%d] sync failed: %s\n",fd,\
-                       db_strerror(ret));                 \
-            ret = -trove_errno_to_trove_error(errno);     \
+                       strerror(tmp_errno));              \
         }                                                 \
         gossip_debug(                                     \
           GOSSIP_TROVE_DEBUG,"aio fd [%d] sync called "   \
@@ -415,13 +417,15 @@ do {                                    
 
 #define DBPF_ERROR_SYNC_IF_NECESSARY(dbpf_op_ptr, fd)\
 do {                                                 \
+    int tmp_ret, tmp_errno;                          \
     if (dbpf_op_ptr->flags & TROVE_SYNC)             \
     {                                                \
-        if ((ret = DBPF_SYNC(fd)) != 0)              \
+        if ((tmp_ret = DBPF_SYNC(fd)) != 0)          \
         {                                            \
+            tmp_errno = errno;                       \
             gossip_err("fd [%d] sync failed: %s\n",  \
-                       fd, db_strerror(ret));        \
-            ret = -trove_errno_to_trove_error(errno);\
+                       fd, strerror(tmp_errno));     \
+            ret = -trove_errno_to_trove_error(tmp_errno);\
             goto return_error;                       \
         }                                            \
         gossip_debug(                                \
@@ -433,13 +437,14 @@ do {                                    
 
 #define DBPF_DB_SYNC_IF_NECESSARY(dbpf_op_ptr, db_ptr) \
 do {                                                   \
+    int tmp_ret;                                       \
     if (dbpf_op_ptr->flags & TROVE_SYNC)               \
     {                                                  \
-        if ((ret = db_ptr->sync(db_ptr, 0)) != 0)      \
+        if ((tmp_ret = db_ptr->sync(db_ptr, 0)) != 0)  \
         {                                              \
             gossip_err("db_p->sync failed: %s\n",      \
-                       db_strerror(ret));              \
-            ret = -dbpf_db_error_to_trove_error(ret);  \
+                       db_strerror(tmp_ret));          \
+            ret = -dbpf_db_error_to_trove_error(tmp_ret);  \
             goto return_error;                         \
         }                                              \
         gossip_debug(                                  \



More information about the PVFS2-CVS mailing list