From a27201d13828d4b9bae9261dcc552c1f767aff21 Mon Sep 17 00:00:00 2001 From: Yang Sheng Date: Fri, 6 Mar 2015 02:59:51 +0800 Subject: [PATCH] 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 --- lustre/osd-ldiskfs/osd_handler.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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); -- 1.8.3.1