From 757c8740038b257c6cb8c0f57dab91a3280e6ef9 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Tue, 26 Feb 2013 09:55:58 +0800 Subject: [PATCH] LU-2828 osp: correct osp device finialize order * 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 Change-Id: I82307dea94bd9ec62088bc931c6b4dd7b90776a0 Reviewed-on: http://review.whamcloud.com/5528 Tested-by: Hudson Reviewed-by: Niu Yawei Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Alex Zhuravlev --- lustre/osp/osp_dev.c | 6 +++--- lustre/tests/conf-sanity.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lustre/osp/osp_dev.c b/lustre/osp/osp_dev.c index fce9c94..f8c6fef 100644 --- a/lustre/osp/osp_dev.c +++ b/lustre/osp/osp_dev.c @@ -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); diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 4e60922..2e7ae14 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -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 } -- 1.8.3.1