Whamcloud - gitweb
Branch b1_6
authorhuanghua <huanghua>
Tue, 25 Sep 2007 02:37:34 +0000 (02:37 +0000)
committerhuanghua <huanghua>
Tue, 25 Sep 2007 02:37:34 +0000 (02:37 +0000)
b=13653
b=11401
i=adilger
i=green

dir entry may have been removed before statahead starts.

lustre/llite/statahead.c

index 1b41f97..e1e1892 100644 (file)
@@ -197,7 +197,7 @@ static int ll_statahead_interpret(struct obd_export *exp,
 
         CDEBUG(D_READA, "interpret statahead %.*s rc %d\n",
                dentry->d_name.len, dentry->d_name.name, rc);
-        if (rc)
+        if (rc || dir == NULL)
                 GOTO(out, rc);
 
         if (dentry->d_inode == NULL) {
@@ -210,7 +210,11 @@ static int ll_statahead_interpret(struct obd_export *exp,
 
                 rc = lookup_it_finish(req, DLM_REPLY_REC_OFF, it, &icbd);
                 if (!rc) {
-                        LASSERT(dentry->d_inode);
+                        /* 
+                         * Here dentry->d_inode might be NULL,
+                         * because the entry may have been removed before
+                         * we start doing stat ahead.
+                         */
                         if (dentry != save)
                                 dput(save);
                         ll_lookup_finish_locks(it, dentry);