Whamcloud - gitweb
LU-2828 osp: correct osp device finialize order
authorBobi Jam <bobijam.xu@intel.com>
Tue, 26 Feb 2013 01:55:58 +0000 (09:55 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 27 Feb 2013 04:14:53 +0000 (23:14 -0500)
* Should stop osp precreate thread before releasing its last used
  oid/seq files.

* git commit 71bdcf99 changes the return value of
  writeconf_or_reformat, it's a cleanup function and when writeconf
  does not work it reformat device and should return 0 (success)
  in the end.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I82307dea94bd9ec62088bc931c6b4dd7b90776a0
Reviewed-on: http://review.whamcloud.com/5528
Tested-by: Hudson
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
lustre/osp/osp_dev.c
lustre/tests/conf-sanity.sh

index fce9c94..f8c6fef 100644 (file)
@@ -351,9 +351,6 @@ static int osp_shutdown(const struct lu_env *env, struct osp_device *d)
        ENTRY;
 
        LASSERT(env);
-       /* release last_used file */
-       if (!d->opd_connect_mdt)
-               osp_last_used_fini(env, d);
 
        rc = osp_disconnect(d);
 
@@ -363,6 +360,9 @@ static int osp_shutdown(const struct lu_env *env, struct osp_device *d)
 
                /* stop sync thread */
                osp_sync_fini(d);
+
+               /* release last_used file */
+               osp_last_used_fini(env, d);
        }
 
        obd_fid_fini(d->opd_obd);
index 4e60922..2e7ae14 100644 (file)
@@ -114,7 +114,7 @@ writeconf_or_reformat() {
        # Better reformat if it fails...
        writeconf_all $MDSCOUNT 2 ||
                { echo "tunefs failed, reformatting instead" &&
-                 reformat_and_config && return 1; }
+                 reformat_and_config && return 0; }
        return 0
 }