From f8313e3aee9cddcde97379cb5ee03992d6ec1191 Mon Sep 17 00:00:00 2001 From: deshmukh Date: Wed, 8 Apr 2009 05:28:39 +0000 Subject: [PATCH] Branch HEAD b=18882 i=oleg.drokin --- lustre/mdd/mdd_object.c | 4 ++++ lustre/osd/osd_handler.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index 970ef8b..1b1ae53 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -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: diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index b8e1a2b..268c7b9 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -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; -- 1.8.3.1