From 5ee807c4b75705aba97a792b79a321316b58813b Mon Sep 17 00:00:00 2001 From: huanghua Date: Fri, 15 Sep 2006 04:02:58 +0000 Subject: [PATCH] use xxxxx-MDTXXXX-mdtlov as mdt lov name to modify lov param --- lustre/mgs/mgs_llog.c | 24 ++++++++++++++++++++---- lustre/utils/rmmod_all.sh | 14 ++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100755 lustre/utils/rmmod_all.sh diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 3a3477d..fe20569 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -1798,6 +1798,8 @@ static int mgs_write_log_params(struct obd_device *obd, struct fs_db *fsdb, } if (class_match_param(ptr, PARAM_LOV, NULL) == 0) { + char mdt_index[16]; + char *mdtlovname; /* Change lov default stripe params */ CDEBUG(D_MGS, "lov param %s\n", ptr); if (!(mti->mti_flags & LDD_F_SV_TYPE_MDT)) { @@ -1811,13 +1813,27 @@ static int mgs_write_log_params(struct obd_device *obd, struct fs_db *fsdb, /* Modify mdtlov */ if (mgs_log_is_empty(obd, mti->mti_svname)) GOTO(end_while, rc = -ENODEV); - lustre_cfg_bufs_reset(&bufs, fsdb->fsdb_mdtlov); + + /* FIXME: The stripesize and stripecount is for + * specific mdt lov? + * Shall we update all the mdt lov? + * Shall we update the client lov? + * for (i = 0; i < INDEX_MAP_SIZE * 8; i++){ + * if (test_bit(i, fsdb->fsdb_mdt_index_map)) { + */ + sprintf(mdt_index,"-MDT%04x", mti->mti_stripe_index); + name_create(&logname, mti->mti_fsname, mdt_index); + name_create(&mdtlovname, logname, "-mdtlov"); + CDEBUG(D_MGS, "modify param for %s\n", mdtlovname); + lustre_cfg_bufs_reset(&bufs, mdtlovname); lustre_cfg_bufs_set_string(&bufs, 1, ptr); lcfg = lustre_cfg_new(LCFG_PARAM, &bufs); - rc = mgs_write_log_direct(obd, fsdb, mti->mti_svname, - fsdb->fsdb_mdtlov, lcfg); + rc = mgs_write_log_direct(obd, fsdb, logname, + mdtlovname, lcfg); lustre_cfg_free(lcfg); - if (rc) + name_destroy(logname); + name_destroy(mdtlovname); + if (rc) GOTO(end_while, rc); /* Modify clilov */ diff --git a/lustre/utils/rmmod_all.sh b/lustre/utils/rmmod_all.sh new file mode 100755 index 0000000..5b23988 --- /dev/null +++ b/lustre/utils/rmmod_all.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +SRCDIR=`dirname $0` +PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH + +rmmod pingsrv +rmmod pingcli +rmmod quotacheck_test +rmmod quotactl_test +rmmod quotafmt_test + +lctl modules | awk '{ print $2 }' | xargs rmmod >/dev/null 2>&1 +# do it again, in case we tried to unload ksocklnd too early +lsmod | grep lnet > /dev/null && lctl modules | awk '{ print $2 }' | xargs rmmod -- 1.8.3.1