Whamcloud - gitweb
Branch HEAD
authordeshmukh <deshmukh>
Wed, 8 Apr 2009 05:28:39 +0000 (05:28 +0000)
committerdeshmukh <deshmukh>
Wed, 8 Apr 2009 05:28:39 +0000 (05:28 +0000)
b=18882
i=oleg.drokin

lustre/mdd/mdd_object.c
lustre/osd/osd_handler.c

index 970ef8b..1b1ae53 100644 (file)
@@ -2048,6 +2048,8 @@ static int mdd_dir_page_build(const struct lu_env *env, struct mdd_device *mdd,
                         memcpy(ent->lde_name, name, len);
 
                         result = mdd_append_attrs(env, mdd, attr, iops, it, ent);
+                        if (result == -ESTALE)
+                                goto next;
                         if (result != 0)
                                 goto out;
                 } else {
@@ -2070,6 +2072,8 @@ static int mdd_dir_page_build(const struct lu_env *env, struct mdd_device *mdd,
 
 next:
                 result = iops->next(env, it);
+                if (result == -ESTALE)
+                        goto next;
         } while (result == 0);
 
 out:
index b8e1a2b..268c7b9 100644 (file)
@@ -3286,7 +3286,6 @@ static struct dt_rec *osd_it_ea_rec(const struct lu_env *env,
                 dentry->d_inode = inode;
                 LASSERT(dentry->d_inode->i_sb == osd_sb(dev));
         } else {
-                CERROR("Error getting inode for ino =%d", id->oii_ino);
                 RETURN((struct dt_rec *) PTR_ERR(inode));
         }
 
@@ -3660,6 +3659,12 @@ static struct inode *osd_iget(struct osd_thread_info *info,
                 CERROR("stale inode\n");
                 iput(inode);
                 inode = ERR_PTR(-ESTALE);
+        } else if (inode->i_nlink == 0) {
+                /* due to parallel readdir and unlink,
+                * we can have dead inode here. */
+                make_bad_inode(inode);
+                iput(inode);
+                inode = ERR_PTR(-ESTALE);
         }
 
         return inode;