Whamcloud - gitweb
Branch b1_6
authorbobijam <bobijam>
Wed, 26 Dec 2007 02:14:55 +0000 (02:14 +0000)
committerbobijam <bobijam>
Wed, 26 Dec 2007 02:14:55 +0000 (02:14 +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 d0880c8..613f2d2 100644 (file)
@@ -13,6 +13,13 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
         using patchless RHEL 4 clients with this or any earlier release.
        * Recommended e2fsprogs version: 1.40.2-cfs5
        * Note that reiserfs quotas are disabled on SLES 10 in this kernel.
+       * RHEL 4 and RHEL 5/SLES 10 clients behaves differently on 'cd' to a
+        removed cwd "./".
+
+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   : 14288
index 8fa7d47..8917d28 100644 (file)
@@ -1914,6 +1914,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;
 
@@ -1938,13 +1939,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 8aad7de..3bc4531 100644 (file)
@@ -1215,7 +1215,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
@@ -1232,15 +1233,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"