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>
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);
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);