From e8dfee8ca8e7894450c47debac84672b8e013f07 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 31 May 2006 17:11:41 +0000 Subject: [PATCH] Branch b1_5 b=9861 Add failout option (mkfs.lustre --param="failmode=failout") --- lustre/include/lustre_param.h | 1 + lustre/mgs/mgs_llog.c | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lustre/include/lustre_param.h b/lustre/include/lustre_param.h index f388b76..e32ac4e 100644 --- a/lustre/include/lustre_param.h +++ b/lustre/include/lustre_param.h @@ -39,6 +39,7 @@ int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd, #define PARAM_MGSNODE "mgsnode=" #define PARAM_FAILNODE "failnode=" +#define PARAM_FAILMODE "failmode=" #define PARAM_OBD_TIMEOUT "obd_timeout=" #define PARAM_DEFAULT_STRIPE "default_stripe_" #define PARAM_D_STRIPE_SIZE PARAM_DEFAULT_STRIPE"size" diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 8f41ad0..cd2d7a9 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -1062,7 +1062,8 @@ static int mgs_write_log_ost(struct obd_device *obd, struct fs_db *fsdb, { struct llog_handle *llh = NULL; char *logname; - int rc, flags = 0; + char *ptr = mti->mti_params; + int rc, flags = 0, failout = 0; ENTRY; CDEBUG(D_MGS, "writing new ost %s\n", mti->mti_svname); @@ -1083,6 +1084,8 @@ static int mgs_write_log_ost(struct obd_device *obd, struct fs_db *fsdb, attach obdfilter ost1 ost1_UUID setup /dev/loop2 ldiskfs f|n errors=remount-ro,user_xattr */ + if (class_find_param(ptr, PARAM_FAILMODE, &ptr) == 0) + failout = (strncmp(ptr, "failout", 7) == 0); rc = record_start_log(obd, &llh, mti->mti_svname); rc = record_marker(obd, llh, fsdb, CM_START, mti->mti_svname,"add ost"); if (*mti->mti_uuid == '\0') @@ -1090,9 +1093,9 @@ static int mgs_write_log_ost(struct obd_device *obd, struct fs_db *fsdb, "%s_UUID", mti->mti_svname); rc = record_attach(obd, llh, mti->mti_svname, "obdfilter"/*LUSTRE_OST_NAME*/, mti->mti_uuid); - rc = record_setup(obd,llh,mti->mti_svname, - "dev"/*ignored*/,"type"/*ignored*/, - "f", 0/*options*/); + rc = record_setup(obd, llh, mti->mti_svname, + "dev"/*ignored*/, "type"/*ignored*/, + failout ? "n" : "f", 0/*options*/); rc = record_marker(obd, llh, fsdb, CM_END, mti->mti_svname, "add ost"); rc = record_end_log(obd, &llh); @@ -1201,10 +1204,17 @@ static int mgs_write_log_params(struct obd_device *obd, struct fs_db *fsdb, len = strlen(ptr); CDEBUG(D_MGS, "next param '%.*s'\n", len, ptr); - /* Stored in MOUNT_DATA_FILE, modified via tunefs.lustre */ + /* The params are stored in MOUNT_DATA_FILE and modified + via tunefs.lustre */ + + /* Processed in lustre_start_mgc */ if (class_match_param(ptr, PARAM_MGSNODE, &endptr) == 0) GOTO(end_while, rc); + /* Processed in mgs_write_log_ost */ + if (class_match_param(ptr, PARAM_FAILMODE, &endptr) == 0) + GOTO(end_while, rc); + if (class_match_param(ptr, PARAM_FAILNODE, &endptr) == 0) { /* Add a failover nidlist */ rc = 0; -- 1.8.3.1