Whamcloud - gitweb
Branch b_release_1_8_1
authorjohann <johann>
Fri, 17 Jul 2009 21:29:58 +0000 (21:29 +0000)
committerjohann <johann>
Fri, 17 Jul 2009 21:29:58 +0000 (21:29 +0000)
b=20139
i=johann (patch from fanyong)
i=bobijam

grab dentry reference in parent process.

lustre/ChangeLog
lustre/llite/statahead.c

index 3c39964..78639ed 100644 (file)
@@ -2,7 +2,7 @@
        * version 1.8.1
        * Support for kernels:
         2.6.16.60-0.37 (SLES 10),
-        2.6.27.23-0.1 (SLES11),
+        2.6.27.23-0.1 (SLES11, i686 & x84_64 only),
         2.6.18-128.1.14.el5 (RHEL 5),
        * Client support for unpatched kernels:
          (see http://wiki.lustre.org/index.php?title=Patchless_Client)
        * NFS export disabled when stack size < 8192. Since the NFSv4 export
          of Lustre filesystem with 4K stack may cause a stack overflow. For
          more information, please refer to bugzilla 17630.
+       * ext4 support for RHEL5 is experimental and thus should not be
+         used in production.
 
 Severity   : normal
 Frequency  : with 1.8 server and 1.6 clients
 Bugzilla   : 20020
-Descriptoin: correctly shrink reply for avoid send too big message to client.
+Description: correctly shrink reply for avoid send too big message to client.
 Details    : 1.8 mds is allocate to big buffer to LOV EA data and this produce
-             some problems with sending this reply to 1.6 client.
+            some problems with sending this reply to 1.6 client.
 
 Severity   : normal
 Bugzilla   : 19917
@@ -29,7 +31,7 @@ Details    : Use GFP_HIGHUSER | __GFP_NOMEMALLOC flags for memory allocations
             For local clients the use of GFP_NOFS will be introduced in 1.8.2
 
 Severity   : enhancement
-Bugzilla   : 19846
+Bugzilla   : 19846, 18289
 Description: Update kernel to RHEL5 2.6.18-128.1.14.el5.
 
 Severity   : enhancement
@@ -37,10 +39,6 @@ Bugzilla   : 19625, 16893, 18668, 19848
 Description: Add support for SLES11 2.6.27.23-0.1.
 
 Severity   : enhancement
-Bugzilla   : 18289
-Description: Update to RHEL5U3 kernel-2.6.18-128.1.1.el5.
-
-Severity   : enhancement
 Bugzilla   : 14250
 Description: Update client support to vanila kernels up to 2.6.27.
 
@@ -204,6 +202,11 @@ Description: Cannot acces an NFS-mounted Lustre filesystem
 Details    : An NFS client cannot access the Lustre filesystem NFS-mounted
             from a Lustre-client exporting the Lustre filesystem via NFS.
 
+Severity   : normal
+Bugzilla   : 20139
+Description: panic in ll_statahead_thread
+Details    : grab dentry reference in parent process.
+
 -------------------------------------------------------------------------------
 
 tbd Sun Microsystems, Inc.
index 9dd17af..4118a46 100644 (file)
@@ -699,15 +699,9 @@ out:
         return rc;
 }
 
-struct ll_sa_thread_args {
-        struct dentry   *sta_parent;
-        pid_t            sta_pid;
-};
-
 static int ll_statahead_thread(void *arg)
 {
-        struct ll_sa_thread_args *sta = arg;
-        struct dentry            *parent = dget(sta->sta_parent);
+        struct dentry            *parent = (struct dentry *)arg;
         struct inode             *dir = parent->d_inode;
         struct ll_inode_info     *lli = ll_i2info(dir);
         struct ll_sb_info        *sbi = ll_i2sbi(dir);
@@ -721,6 +715,15 @@ static int ll_statahead_thread(void *arg)
         spin_lock(&lli->lli_lock);
         if (unlikely(lli->lli_sai == NULL)) {
                 spin_unlock(&lli->lli_lock);
+                CERROR("ll_statahead_info is NULL, parent maybe exit abnormally, "
+                       "dentry@%p %.*s, inode = %lu, pid = %u\n",
+                       parent, parent->d_name.len, parent->d_name.name,
+                       dir->i_ino, lli->lli_opendir_pid);
+                /* At this point, ll_statahead_info is NULL, and parent maybe
+                 * exit abnormally, I can not notify parent even it is alive
+                 * yet. Just put the reference count on parent dentry. */
+                lli->lli_opendir_key = NULL;
+                lli->lli_opendir_pid = 0;
                 dput(parent);
                 RETURN(-EAGAIN);
         } else {
@@ -730,7 +733,7 @@ static int ll_statahead_thread(void *arg)
 
         {
                 char pname[16];
-                snprintf(pname, 15, "ll_sa_%u", sta->sta_pid);
+                snprintf(pname, 15, "ll_sa_%u", lli->lli_opendir_pid);
                 cfs_daemonize(pname);
         }
 
@@ -1018,7 +1021,6 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp, int lookup)
         struct ll_sb_info        *sbi = ll_i2sbi(dir);
         struct ll_inode_info     *lli = ll_i2info(dir);
         struct ll_statahead_info *sai = lli->lli_sai;
-        struct ll_sa_thread_args  sta;
         struct l_wait_info        lwi = LWI_INTR(LWI_ON_SIGNAL_NOOP, NULL);
         int                       rc = 0;
         ENTRY;
@@ -1121,17 +1123,16 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp, int lookup)
 
         LASSERT(sai->sai_inode == (*dentryp)->d_parent->d_inode);
 
-        sta.sta_parent = (*dentryp)->d_parent;
-        sta.sta_pid    = cfs_curproc_pid();
-
         lli->lli_sai = sai;
-        rc = cfs_kernel_thread(ll_statahead_thread, &sta, 0);
+        /* get parent reference count here, and put it in ll_statahead_thread */
+        rc = cfs_kernel_thread(ll_statahead_thread, dget((*dentryp)->d_parent), 0);
         if (rc < 0) {
                 CERROR("can't start ll_sa thread, rc: %d\n", rc);
                 lli->lli_opendir_key = NULL;
                 sai->sai_thread.t_flags = SVC_STOPPED;
                 ll_sai_put(sai);
                 LASSERT(lli->lli_sai == NULL);
+                dput((*dentryp)->d_parent);
                 RETURN(-EAGAIN);
         }