Most of these are fairly straightforward:

pvfs2-kernel-revalidate.patch:
------------------------------
This removes a call to make_bad_inode() that occurs in the vfs d_revalidate path if a getattr fails. make_bad_inode() isn't necessary for error propigation here, and was causing the inode count to go off by one if triggered. The eventual result would be a bad inode being cached indefinitely without recovery, and a kernel BUG() sanity check being triggered at module unload time. It is difficult to replicate by natural means, but you can hardcode a pvfs2_inode_getattr() just before this point to see the behavior.

pvfs2-kernel-open-append.patch:
-------------------------------
If a pvfs2 file is opened in append mode, then the kernel performs a getattr to find the size of the file at that time and set the file offset appropriately. This patch adds error checking to the getattr so that it doesn't fail silently and give a faulty file offset if the getattr doesn't work for some reason.

pvfs2-client-waitpid.patch:
-------------------------------
This patch causes pvfs2-client to wait for pvfs2-client-core to exit before it shuts itself down (if killed naturally). This makes it safer to restart a pvfs2-client daemon from an rc script that may quickly try to kill and then restart a pvfs2-client. On some machines the pvfs2-client-core would lag behind after the rc script confirmed the exit of pvfs2-client, leading to a collision on the device file when the next one was started.

-Phil
---------------------
PatchSet 311 
Date: 2005/11/29 19:46:08
Author: pcarns
Branch: HEAD
Tag: (none) 
Log:
updated pvfs2-client's signal handlers so that it waits on the
pvfs2-client-core to exit before allowing the parent to exit
[artf25225]

Members: 
	src/apps/kernel/linux/pvfs2-client.c:1.11->1.12 

Index: src/apps/kernel/linux/pvfs2-client.c
diff -u src/apps/kernel/linux/pvfs2-client.c:1.11 src/apps/kernel/linux/pvfs2-client.c:1.12
--- src/apps/kernel/linux/pvfs2-client.c:1.11	Mon Nov 21 12:38:52 2005
+++ src/apps/kernel/linux/pvfs2-client.c	Tue Nov 29 12:46:08 2005
@@ -15,6 +15,8 @@
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <signal.h>
+
 #include "pvfs2-types.h"
 #include "acache.h"
 
@@ -49,6 +51,7 @@
 static void parse_args(int argc, char **argv, options_t *opts);
 static int verify_pvfs2_client_path(options_t *opts);
 static int monitor_pvfs2_client(options_t *opts);
+static pid_t core_pid = -1;
 
 
 int main(int argc, char **argv)
@@ -106,6 +109,8 @@
 
 static void client_sig_handler(int signum)
 {
+    int ret;
+
     kill(0, signum);
     switch (signum)
     {
@@ -116,6 +121,13 @@
         case SIGHUP:
         case SIGINT:
         case SIGTERM:
+            if(core_pid > 0)
+            {
+                /* wait for client core to exit before quitting (it is killed
+                 * at the begining of the signal handler)
+                 */
+                waitpid(core_pid, &ret, 0);
+            }
             exit(0);
     }
 }
@@ -142,7 +154,7 @@
 static int monitor_pvfs2_client(options_t *opts)
 {
     int ret = 1;
-    pid_t new_pid = 0, wpid = 0;
+    pid_t wpid = 0;
     int dev_init_failures = 0;
     char* arg_list[128] = {NULL};
     int arg_index;
@@ -155,14 +167,14 @@
         {
             printf("Spawning new child process\n");
         }
-        new_pid = fork();
-        assert(new_pid != -1);
+        core_pid = fork();
+        assert(core_pid != -1);
 
-        if (new_pid != 0)
+        if (core_pid != 0)
         {
             if (opts->verbose)
             {
-                printf("Waiting on child with pid %d\n", (int)new_pid);
+                printf("Waiting on child with pid %d\n", (int)core_pid);
             }
 
             /* get rid of stdout/stderr/stdin */
@@ -170,7 +182,7 @@
             freopen("/dev/null", "w", stdout);
             freopen("/dev/null", "w", stderr);
 
-            wpid = waitpid(new_pid, &ret, 0);
+            wpid = waitpid(core_pid, &ret, 0);
             assert(wpid != -1);
 
             if (WIFEXITED(ret))
@@ -178,7 +190,7 @@
                 if (opts->verbose)
                 {
                     printf("Child process with pid %d exited with "
-                           "value %d\n", new_pid, (int)WEXITSTATUS(ret));
+                           "value %d\n", core_pid, (int)WEXITSTATUS(ret));
                 }
 
                 if (WEXITSTATUS(ret) == (unsigned char)-PVFS_EDEVINIT)
@@ -202,6 +214,7 @@
                     {
                         break;
                     }
+                    core_pid = -1;
                     continue;
                 }
 
@@ -232,9 +245,10 @@
                 if (opts->verbose)
                 {
                     printf("Child process with pid %d was killed by an "
-                           "uncaught signal %d\n", new_pid,
+                           "uncaught signal %d\n", core_pid,
                            WTERMSIG(ret));
                 }
+                core_pid = -1;
                 continue;
             }
         }
@@ -296,6 +310,7 @@
                     opts->path, errno);
             exit(1);
         }
+        core_pid = -1;
     }
     return ret;
 }
---------------------
PatchSet 336 
Date: 2005/12/07 20:00:05
Author: pcarns
Branch: HEAD
Tag: (none) 
Log:
fixed bug in pvfs2_file_open path: if append mode is used, then we must
return an error if we fail to retrieve the size of the file.
[artf27196]

Members: 
	src/kernel/linux-2.6/file.c:1.16->1.17 

Index: src/kernel/linux-2.6/file.c
diff -u src/kernel/linux-2.6/file.c:1.16 src/kernel/linux-2.6/file.c:1.17
--- src/kernel/linux-2.6/file.c:1.16	Wed Dec  7 12:31:41 2005
+++ src/kernel/linux-2.6/file.c	Wed Dec  7 13:00:05 2005
@@ -76,6 +76,8 @@
             else
             {
                 pvfs2_make_bad_inode(inode);
+                pvfs2_print("pvfs2_file_open returning error: %d\n", ret);
+                return(ret);
             }
         }
 
diff -Naur pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h pvfs2-new/src/kernel/linux-2.6/pvfs2-kernel.h
--- pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h	2005-12-02 22:56:14.000000000 +0100
+++ pvfs2-new/src/kernel/linux-2.6/pvfs2-kernel.h	2005-12-07 19:17:05.000000000 +0100
@@ -1038,10 +1038,18 @@
          * would be refreshed, so we dont have much of a choice here too.
          */
         ret = ((pvfs2_inode_getattr(inode, PVFS_ATTR_SYS_ALL) == 0) ? 1 : 0);
+#if 0
+/* Calling make_bad_inode() here results in a bad reference count on the
+ * inode.  It therefore gets cached until the module is unloaded, when we get 
+ * a "VFS: Busy inodes after unmount. Self-destruct in 5 seconds." error
+ * message.  It is better to just let it be cleaned up naturally after 
+ * validation failure. -Phil
+ */
         if (ret == 0)
         {
             pvfs2_make_bad_inode(inode);
         }
+#endif
     }
     return ret;
 }
_______________________________________________
PVFS2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to