Whamcloud - gitweb
LU-4383 osd: fid_is_on_ost should only return 1 or 0 66/8566/3
authorwang di <di.wang@intel.com>
Thu, 12 Dec 2013 22:36:20 +0000 (14:36 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 16 Dec 2013 03:13:57 +0000 (03:13 +0000)
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 <di.wang@intel.com>
Change-Id: Ia9949bc12387d32c94cf993f674bbcca88c260bf
Reviewed-on: http://review.whamcloud.com/8566
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/osd-ldiskfs/osd_oi.c
lustre/osd-zfs/osd_oi.c

index 54a016f..d4684b9 100644 (file)
@@ -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))
index 7c1731a..00ce2ea 100644 (file)
@@ -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);
 }