Whamcloud - gitweb
Branch HEAD
authorbobijam <bobijam>
Wed, 26 Dec 2007 02:27:41 +0000 (02:27 +0000)
committerbobijam <bobijam>
Wed, 26 Dec 2007 02:27:41 +0000 (02:27 +0000)
b=14136
i=nathan
i=shadow

Description: make mgs_setparam() handle fsname containing dash
Details    : fsname containing a dash does not work with lctl conf_param

lustre/ChangeLog
lustre/mgs/mgs_llog.c
lustre/tests/conf-sanity.sh

index e5ff69e..b552e97 100644 (file)
        * Recommended e2fsprogs version: 1.40.2-cfs5
        * Note that reiserfs quotas are disabled on SLES 10 in this kernel.
 
+Severity   : normal
+Bugzilla   : 14136
+Description: make mgs_setparam() handle fsname containing dash
+Details    : fsname containing a dash does not work with lctl conf_param
+
 Severity   : enhancement
 Bugzilla   : 14388
 Description: Update to SLES10 SP1 latest kernel-2.6.16.54-0.2.3.
index 5e4db6a..7f5eb86 100644 (file)
@@ -2420,6 +2420,7 @@ int mgs_setparam(struct obd_device *obd, struct lustre_cfg *lcfg, char *fsname)
         struct mgs_target_info *mti;
         char *devname, *param;
         char *ptr, *tmp;
+        __u32 index;
         int rc = 0;
         ENTRY;
 
@@ -2444,13 +2445,13 @@ int mgs_setparam(struct obd_device *obd, struct lustre_cfg *lcfg, char *fsname)
         }
 
         /* Extract fsname */
-        ptr = strchr(devname, '-');
+        ptr = strrchr(devname, '-');
         memset(fsname, 0, MTI_NAME_MAXLEN);
-        if (!ptr) {
+        if (ptr && (server_name2index(ptr, &index, NULL) >= 0)) {
+                strncpy(fsname, devname, ptr - devname);
+        } else {
                 /* assume devname is the fsname */
                 strncpy(fsname, devname, MTI_NAME_MAXLEN);
-        } else {  
-                strncpy(fsname, devname, ptr - devname);
         }
         fsname[MTI_NAME_MAXLEN - 1] = 0;
         CDEBUG(D_MGS, "setparam on fs %s device %s\n", fsname, devname);
index 757785f..fd4de0e 100644 (file)
@@ -1190,7 +1190,8 @@ test_32b() {
 run_test 32b "Upgrade from 1.4 with writeconf"
 
 test_33() { # bug 12333
-        local FSNAME2=test1234
+        local rc=0
+        local FSNAME2=test-123
         local fs2mds_HOST=$mds_HOST
         local fs2ost_HOST=$ost_HOST
         [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
@@ -1207,15 +1208,17 @@ test_33() { # bug 12333
 
         start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
         start fs2ost $fs2ostdev $OST_MOUNT_OPTS
+        do_facet mds "$LCTL conf_param $FSNAME2.sys.timeout=200" || rc=1
         mkdir -p $MOUNT2
-        mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
+        mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || rc=2
         echo "ok."
 
         umount -d $MOUNT2
         stop fs2ost -f
         stop fs2mds -f
         rm -rf $MOUNT2 $fs2mdsdev $fs2ostdev
-        cleanup_nocli || return 6
+        cleanup_nocli || rc=6
+        return $rc
 }
 run_test 33 "Mount ost with a large index number"