From 409ea6eb8a242c671432604c34928e114c9ba8aa Mon Sep 17 00:00:00 2001 From: wangdi Date: Thu, 15 Dec 2016 16:06:43 -0500 Subject: [PATCH] LU-9088 osd: use od_is_ost check OST FID 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 Signed-off-by: Bob Glossman Reviewed-on: https://review.whamcloud.com/25330 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Minh Diep Reviewed-by: Oleg Drokin --- lustre/osd-ldiskfs/osd_oi.c | 8 ++++++++ lustre/osd-zfs/osd_oi.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/lustre/osd-ldiskfs/osd_oi.c b/lustre/osd-ldiskfs/osd_oi.c index e94094c..6d09108 100644 --- a/lustre/osd-ldiskfs/osd_oi.c +++ b/lustre/osd-ldiskfs/osd_oi.c @@ -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); diff --git a/lustre/osd-zfs/osd_oi.c b/lustre/osd-zfs/osd_oi.c index 0f0526b..ac2ad46 100644 --- a/lustre/osd-zfs/osd_oi.c +++ b/lustre/osd-zfs/osd_oi.c @@ -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); -- 1.8.3.1