From: Yang Sheng Date: Thu, 5 Mar 2015 18:59:51 +0000 (+0800) Subject: LU-6109 osd-ldiskfs: handle no fid-in-dirent correctly X-Git-Tag: 2.7.57~76 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=a27201d13828d4b9bae9261dcc552c1f767aff21 LU-6109 osd-ldiskfs: handle no fid-in-dirent correctly The commit: 4d408c9aed9adaf1f4e2ea87851728a1cf662594 introduced a issue in '..' no fid-in-dirent case. Since it just deal with remote case. So the '..' would disappeared if it is a local object and no fid-in-dirent. Signed-off-by: Yang Sheng Change-Id: Ib2b0be1c43986472cb674dd86d32f023a4b26a34 Reviewed-on: http://review.whamcloud.com/13987 Tested-by: Jenkins Reviewed-by: Fan Yong Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 1e5f472..c44c8c9 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -5329,17 +5329,19 @@ static inline int osd_it_ea_rec(const struct lu_env *env, } else { attr &= ~LU_DIRENT_ATTRS_MASK; if (!fid_is_sane(fid)) { + bool is_dotdot = false; if (it->oie_dirent->oied_namelen == 2 && it->oie_dirent->oied_name[0] == '.' && - it->oie_dirent->oied_name[1] == '.') { - /* If the parent is on remote MDT, and there - * is no FID-in-dirent, then we have to get - * the parent FID from the linkEA. */ - if (ino == osd_remote_parent_ino(dev)) - rc = osd_get_pfid_from_linkea(env, obj, - fid); + it->oie_dirent->oied_name[1] == '.') + is_dotdot = true; + /* If the parent is on remote MDT, and there + * is no FID-in-dirent, then we have to get + * the parent FID from the linkEA. */ + if (ino == osd_remote_parent_ino(dev) && is_dotdot) { + rc = osd_get_pfid_from_linkea(env, obj, fid); } else { - if (OBD_FAIL_CHECK(OBD_FAIL_FID_LOOKUP)) + if (is_dotdot == false && + OBD_FAIL_CHECK(OBD_FAIL_FID_LOOKUP)) RETURN(-ENOENT); rc = osd_ea_fid_get(env, obj, ino, fid, id);