From b5b882f05e2436f1419b5692cc567e92d1cb5b33 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Wed, 10 Sep 2014 02:53:42 +0800 Subject: [PATCH] LU-5867 lfsck: Enable --create_mdtobj flag Using the --create_mdtobj flag in 'lctl lfsck_start' creates an error. "create_mdtobj" is added to the option struct so it will be recognized as a valid option. When displaying the results of LFSCK, "create_mdtobj" is not listed as a parameter. "create_mdtobj" is added to the lfsck_param_names array so it will be printed when used. Also, added LSV_CREATE_MDTOBJ to the lfsck_request valid options/flags. Signed-off-by: James Nunez Change-Id: I1923bb9a71958b390b9abea248b328ac59c3caad Reviewed-on: http://review.whamcloud.com/12578 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/lfsck/lfsck_engine.c | 5 ++--- lustre/lfsck/lfsck_lib.c | 4 +++- lustre/utils/lustre_lfsck.c | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/lfsck/lfsck_engine.c b/lustre/lfsck/lfsck_engine.c index 3c98c2b..74aa59b 100644 --- a/lustre/lfsck/lfsck_engine.c +++ b/lustre/lfsck/lfsck_engine.c @@ -1289,7 +1289,7 @@ out: } /** - * Notify the LFSCK event to the instatnces on remote servers. + * Notify the LFSCK event to the instances on remote servers. * * The LFSCK assistant thread notifies the LFSCK instances on other * servers (MDT/OST) about some events, such as start new scanning, @@ -1335,8 +1335,7 @@ static int lfsck_assistant_notify_others(const struct lu_env *env, if (com->lc_type != LFSCK_TYPE_LAYOUT) goto next; - lr->lr_valid = LSV_SPEED_LIMIT | LSV_ERROR_HANDLE | LSV_DRYRUN | - LSV_ASYNC_WINDOWS | LSV_CREATE_OSTOBJ; + lr->lr_valid = LSV_SPEED_LIMIT | LSV_ERROR_HANDLE | LSV_DRYRUN; lr->lr_speed = bk->lb_speed_limit; lr->lr_version = bk->lb_version; lr->lr_param |= bk->lb_param; diff --git a/lustre/lfsck/lfsck_lib.c b/lustre/lfsck/lfsck_lib.c index ce8452f..2a64ea7 100644 --- a/lustre/lfsck/lfsck_lib.c +++ b/lustre/lfsck/lfsck_lib.c @@ -98,6 +98,7 @@ const char *lfsck_param_names[] = { "broadcast", "orphan", "create_ostobj", + "create_mdtobj", NULL }; @@ -2540,7 +2541,8 @@ static int lfsck_start_all(const struct lu_env *env, lr->lr_param = start->ls_flags; lr->lr_async_windows = bk->lb_async_windows; lr->lr_valid = LSV_SPEED_LIMIT | LSV_ERROR_HANDLE | LSV_DRYRUN | - LSV_ASYNC_WINDOWS; + LSV_ASYNC_WINDOWS | LSV_CREATE_OSTOBJ | + LSV_CREATE_MDTOBJ; laia->laia_com = NULL; laia->laia_ltds = ltds; diff --git a/lustre/utils/lustre_lfsck.c b/lustre/utils/lustre_lfsck.c index ce8263b..0932f78 100644 --- a/lustre/utils/lustre_lfsck.c +++ b/lustre/utils/lustre_lfsck.c @@ -49,6 +49,7 @@ static struct option long_opt_start[] = { {"device", required_argument, 0, 'M'}, {"all", no_argument, 0, 'A'}, {"create_ostobj", optional_argument, 0, 'c'}, + {"create_mdtobj", optional_argument, 0, 'C'}, {"error", required_argument, 0, 'e'}, {"help", no_argument, 0, 'h'}, {"dryrun", optional_argument, 0, 'n'}, -- 1.8.3.1