Whamcloud - gitweb
LU-7120 scrub: handle osd_scrub_post return value 68/16368/2
authorFan Yong <fan.yong@intel.com>
Fri, 31 Jul 2015 16:00:20 +0000 (00:00 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 13 Nov 2015 18:25:24 +0000 (18:25 +0000)
To avoid missing some failure cases during write scrub status
to disk.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I7f77bdba184f634b4f9dd748c3f1b97609b81960
Reviewed-on: http://review.whamcloud.com/16368
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Ashish Purkar <ashish.purkar@seagate.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_scrub.c

index 72c6759..61ed4cc 100644 (file)
@@ -740,9 +740,10 @@ static int osd_scrub_checkpoint(struct osd_scrub *scrub)
        return rc;
 }
 
-static void osd_scrub_post(struct osd_scrub *scrub, int result)
+static int osd_scrub_post(struct osd_scrub *scrub, int result)
 {
        struct scrub_file *sf = &scrub->os_file;
+       int rc;
        ENTRY;
 
        CDEBUG(D_LFSCK, "%.16s: OI scrub post, result = %d\n",
@@ -782,10 +783,10 @@ static void osd_scrub_post(struct osd_scrub *scrub, int result)
        }
        sf->sf_run_time += cfs_duration_sec(cfs_time_current() + HALF_SEC -
                                            scrub->os_time_last_checkpoint);
-       result = osd_scrub_file_store(scrub);
+       rc = osd_scrub_file_store(scrub);
        up_write(&scrub->os_rwsem);
 
-       EXIT;
+       RETURN(rc < 0 ? rc : result);
 }
 
 /* iteration engine */
@@ -1502,7 +1503,7 @@ static int osd_scrub_main(void *args)
        GOTO(post, rc);
 
 post:
-       osd_scrub_post(scrub, rc);
+       rc = osd_scrub_post(scrub, rc);
        CDEBUG(D_LFSCK, "%.16s: OI scrub: stop, pos = %u: rc = %d\n",
               osd_scrub2name(scrub), scrub->os_pos_current, rc);