Whamcloud - gitweb
use xxxxx-MDTXXXX-mdtlov as mdt lov name to modify lov param
authorhuanghua <huanghua>
Fri, 15 Sep 2006 04:02:58 +0000 (04:02 +0000)
committerhuanghua <huanghua>
Fri, 15 Sep 2006 04:02:58 +0000 (04:02 +0000)
lustre/mgs/mgs_llog.c
lustre/utils/rmmod_all.sh [new file with mode: 0755]

index 3a3477d..fe20569 100644 (file)
@@ -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 (executable)
index 0000000..5b23988
--- /dev/null
@@ -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