From: wang di Date: Thu, 12 Dec 2013 22:36:20 +0000 (-0800) Subject: LU-4383 osd: fid_is_on_ost should only return 1 or 0 X-Git-Tag: 2.5.53~33 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F8566%2F3;p=fs%2Flustre-release.git LU-4383 osd: fid_is_on_ost should only return 1 or 0 fid_is_on_ost should only return 1 or 0 to check whether the FID is on OST or not. Signed-off-by: wang di Change-Id: Ia9949bc12387d32c94cf993f674bbcca88c260bf Reviewed-on: http://review.whamcloud.com/8566 Tested-by: Jenkins Reviewed-by: Fan Yong Reviewed-by: Andreas Dilger Tested-by: Maloo --- diff --git a/lustre/osd-ldiskfs/osd_oi.c b/lustre/osd-ldiskfs/osd_oi.c index 54a016f..d4684b9 100644 --- a/lustre/osd-ldiskfs/osd_oi.c +++ b/lustre/osd-ldiskfs/osd_oi.c @@ -513,9 +513,10 @@ 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) { - CERROR("%s: "DFID" lookup failed: rc = %d\n", osd_name(osd), - PFID(fid), rc); - RETURN(rc); + if (rc != -ENOENT) + CERROR("%s: lookup FLD "DFID": rc = %d\n", + osd_name(osd), PFID(fid), rc); + RETURN(0); } if (fld_range_is_ost(range)) diff --git a/lustre/osd-zfs/osd_oi.c b/lustre/osd-zfs/osd_oi.c index 7c1731a..00ce2ea 100644 --- a/lustre/osd-zfs/osd_oi.c +++ b/lustre/osd-zfs/osd_oi.c @@ -249,15 +249,15 @@ 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) { - CERROR("%s: "DFID" lookup failed: rc = %d\n", osd_name(osd), - PFID(fid), rc); - RETURN(rc); + if (rc != -ENOENT) + CERROR("%s: "DFID" lookup failed: rc = %d\n", + osd_name(osd), PFID(fid), rc); + RETURN(0); } if (fld_range_is_ost(range)) RETURN(1); - RETURN(0); }