Whamcloud - gitweb
LU-9088 osd: use od_is_ost check OST FID 30/25330/2
authorwangdi <di.wang@intel.com>
Thu, 15 Dec 2016 21:06:43 +0000 (16:06 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 30 Mar 2017 03:53:57 +0000 (03:53 +0000)
Because OST FLDB is not created until 2.6, so
if the DNE system is upgraded from 2.5 to >=
2.6, then the local FLDB will not be loaded
in fld_index_init(), which might cause OSD
can not tell OST FID created by 2.5. So let's
use od_is_ost in this case.

Change-Id: I5da3e95bc24e43aca1b3c840df427cc5a7306194
Signed-off-by: wangdi <di.wang@intel.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-on: https://review.whamcloud.com/25330
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_oi.c
lustre/osd-zfs/osd_oi.c

index e94094c..6d09108 100644 (file)
@@ -567,6 +567,14 @@ int fid_is_on_ost(struct osd_thread_info *info, struct osd_device *osd,
 
        rc = osd_fld_lookup(info->oti_env, osd, fid_seq(fid), range);
        if (rc != 0) {
+               /* During upgrade, OST FLDB might not be loaded because
+                * OST FLDB is not created until 2.6, so if some DNE
+                * filesystem upgrade from 2.5 to 2.7/2.8, they will
+                * not be able to find the sequence from local FLDB
+                * cache see fld_index_init(). */
+               if (rc == -ENOENT && osd->od_is_ost)
+                       RETURN(1);
+
                if (rc != -ENOENT)
                        CERROR("%s: lookup FLD "DFID": rc = %d\n",
                               osd_name(osd), PFID(fid), rc);
index 0f0526b..ac2ad46 100644 (file)
@@ -263,6 +263,14 @@ int fid_is_on_ost(const struct lu_env *env, struct osd_device *osd,
 
        rc = osd_fld_lookup(env, osd, fid_seq(fid), range);
        if (rc != 0) {
+               /* During upgrade, OST FLDB might not be loaded because
+                * OST FLDB is not created until 2.6, so if some DNE
+                * filesystem upgrade from 2.5 to 2.7/2.8, they will
+                * not be able to find the sequence from local FLDB
+                * cache see fld_index_init(). */
+               if (rc == -ENOENT && osd->od_is_ost)
+                       RETURN(1);
+
                if (rc != -ENOENT)
                        CERROR("%s: "DFID" lookup failed: rc = %d\n",
                               osd_name(osd), PFID(fid), rc);