From 63b0d1227889721ae784b1e5e7c778a15eb57339 Mon Sep 17 00:00:00 2001
From: wangchao <wangchao>
Date: Tue, 16 Mar 2004 04:42:55 +0000
Subject: [PATCH] b=2939 r=shaver let lustre could be mounted with the same
 name for node and mds

---
 lustre/tests/conf-sanity.sh | 32 ++++++++++++++++++++++++--------
 lustre/utils/lmc            |  2 +-
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh
index 69979fe9f8..beaa4b61c1 100644
--- a/lustre/tests/conf-sanity.sh
+++ b/lustre/tests/conf-sanity.sh
@@ -341,20 +341,36 @@ test_9() {
 run_test 9 "test --ptldebug and --subsystem for lmc and lconf"
 
 test_10() {
+        echo "generate configuration with the same name for node and mds"
         OLDXMLCONFIG=$XMLCONFIG
         XMLCONFIG="broken.xml"
         [ -f "$XMLCONFIG" ] && rm -f $XMLCONFIG
-        SAMENAME="mds1"
-        do_lmc --add node --node $SAMENAME
-        do_lmc --add net --node $SAMENAME --nid $SAMENAME --nettype tcp
-        do_lmc --add mds --node $SAMENAME --mds $SAMENAME --nid $SAMENAME \
-               --fstype ext3 --dev /dev/mds1 || return $?
-        do_lmc --add lov --lov lov1 --mds $SAMENAME --stripe_sz 65536 \
-               --stripe_cnt 1 --stripe_pattern 0 || return $?
+        facet="mds"
+        rm -f ${facet}active
+        add_facet $facet
+        echo "the name for node and mds is the same"
+        do_lmc --add mds --node ${facet}_facet --mds ${facet}_facet \
+            --dev $MDSDEV --size $MDSSIZE || return $?
+        do_lmc --add lov --mds ${facet}_facet --lov lov1 --stripe_sz \
+            $STRIPE_BYTES --stripe_cnt $STRIPES_PER_OBJ \
+            --stripe_pattern 0 || return $?
+        add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE
+        facet="client"
+        add_facet $facet --lustre_upcall $UPCALL
+        do_lmc --add mtpt --node ${facet}_facet --mds mds_facet \
+            --lov lov1 --path $MOUNT
+
+        echo "mount lustre"
+        start_ost
+        start_mds
+        mount_client $MOUNT
+        check_mount || return 41
+        cleanup || return $?
+
         echo "Success!"
         XMLCONFIG=$OLDXMLCONFIG
 }
-run_test 10 "use lmc with the same name for node and mds"
+run_test 10 "mount lustre with the same name for node and mds"
 
 test_11() {
         OLDXMLCONFIG=$XMLCONFIG
diff --git a/lustre/utils/lmc b/lustre/utils/lmc
index f4deff528d..98a56dbfbd 100755
--- a/lustre/utils/lmc
+++ b/lustre/utils/lmc
@@ -876,7 +876,7 @@ def add_lov(gen, lustre, options):
     # add an lovconfig entry to the active mdsdev profile
     lovconfig_name = new_name('LVCFG_' + name)
     lovconfig_uuid = new_uuid(lovconfig_name)
-    mds = findByName(lustre, mds_name)
+    mds = findByName(lustre, mds_name, "mds")
     mds.appendChild(gen.ref("lovconfig", lovconfig_uuid))
     lovconfig = gen.lovconfig(lovconfig_name, lovconfig_uuid, uuid)
     lustre.appendChild(lovconfig)
-- 
GitLab