Whamcloud - gitweb
LU-2213 scrub: stop LFSCK before osd_shutdown
authorFan Yong <yong.fan@whamcloud.com>
Mon, 22 Oct 2012 17:12:05 +0000 (01:12 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 29 Oct 2012 05:40:52 +0000 (01:40 -0400)
The osd_shutdown will clean all the otable-based iteration,
but up layer LFSCK depends on the otable-based iteration.

So we need to stop the LFSCK before osd_shutdown called.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: I97625d54766122314630aff0069d9e14d23b9840
Reviewed-on: http://review.whamcloud.com/4217
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
lustre/mdd/mdd_device.c
lustre/tests/test-framework.sh

index 647ee7a..e6f0213 100644 (file)
@@ -167,7 +167,6 @@ static void mdd_device_shutdown(const struct lu_env *env,
                                 struct mdd_device *m, struct lustre_cfg *cfg)
 {
         ENTRY;
-       mdd_lfsck_cleanup(env, m);
         mdd_changelog_fini(env, m);
         if (m->mdd_dot_lustre_objs.mdd_obf)
                 mdd_object_put(env, m->mdd_dot_lustre_objs.mdd_obf);
@@ -1136,6 +1135,7 @@ static int mdd_process_config(const struct lu_env *env,
                 dt->dd_ops->dt_conf_get(env, dt, &m->mdd_dt_conf);
                 break;
         case LCFG_CLEANUP:
+               mdd_lfsck_cleanup(env, m);
                rc = next->ld_ops->ldo_process_config(env, next, cfg);
                lu_dev_del_linkage(d->ld_site, d);
                 mdd_device_shutdown(env, m, cfg);
index 4771bfb..3e714e3 100644 (file)
@@ -5740,6 +5740,7 @@ mds_backup_restore() {
        local metaea=${TMP}/backup_restore.ea
        local metadata=${TMP}/backup_restore.tgz
        local opts=${MDS_MOUNT_OPTS}
+       local svc=${SINGLEMDS}_svc
 
        if ! ${rcmd} test -b ${devname}; then
                opts=$(csa_add "$opts" -o loop)
@@ -5783,6 +5784,8 @@ mds_backup_restore() {
        ${rcmd} umount -d $mntpt || return 10
        # step 14: cleanup tmp backup
        ${rcmd} rm -f $metaea $metadata
+       # step 15: reset device label - it's not virgin on
+       ${rcmd} e2label $devname ${!svc}
 }
 
 # remove OI files