Whamcloud - gitweb
LU-6109 osd-ldiskfs: handle no fid-in-dirent correctly 87/13987/5
authorYang Sheng <yang.sheng@intel.com>
Thu, 5 Mar 2015 18:59:51 +0000 (02:59 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 8 Jul 2015 17:09:22 +0000 (17:09 +0000)
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 <yang.sheng@intel.com>
Change-Id: Ib2b0be1c43986472cb674dd86d32f023a4b26a34
Reviewed-on: http://review.whamcloud.com/13987
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_handler.c

index 1e5f472..c44c8c9 100644 (file)
@@ -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)) {
        } 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] == '.' &&
                        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 {
                        } 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);
                                        RETURN(-ENOENT);
 
                                rc = osd_ea_fid_get(env, obj, ino, fid, id);