Whamcloud - gitweb
EX-1873 iokit: fix the obsolete usage of cfg_device
authorHongchao Zhang <hongchao@whamcloud.com>
Wed, 14 Oct 2020 01:46:00 +0000 (09:46 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 14 Jan 2022 07:23:18 +0000 (07:23 +0000)
The LCTL command "cfg_device" is obsolete and some operations
(such as "cleanup", "detach") don't support it anymore.
In mds_survey and lfsck-performance it causes the echo client
device not to be destroyed and causes LBUG when umounting the
related Lustre device.

Lustre-change: https://review.whamcloud.com/40227
Lustre-commit: 2e6342a7365825091d9c7b25418033c02ecfbb12

Change-Id: If7f6eff080906e395023289652fcd2a78dfb6fb7
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40227
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/45879
Tested-by: Maloo <maloo@whamcloud.com>
lustre-iokit/obdfilter-survey/iokit-libecho
lustre/tests/lfsck-performance.sh
lustre/tests/sanityn.sh
lustre/tests/scrub-performance.sh

index a155d4b..76d4bf1 100644 (file)
@@ -179,9 +179,8 @@ get_devnos () {
 cleanup_netdisk () {
        for osc in $@; do
                $lctl <<-EOF
-                       cfg_device $osc
-                       cleanup
-                       detach
+                       --device $osc cleanup
+                       --device $osc detach
                EOF
        done
 }
@@ -191,22 +190,19 @@ cleanup_network () {
        local clean_srv_OSS=$1
 
        $lctl <<-EOF
-               cfg_device echotmp
-               cleanup
-               detach
+               --device echotmp cleanup
+               --device echotmp detach
        EOF
        remote_shell "root@$server_nid" \
        "$lctl <<-EOF
-               cfg_device echo_srv
-               cleanup
-               detach
+               --device echo_srv cleanup
+               --device echo_srv detach
        EOF"
        if [ $clean_srv_OSS ]; then
                remote_shell "root@$server_nid" \
                "$lctl <<-EOF
-                       cfg_device OSS
-                       cleanup
-                       detach
+                       --device OSS cleanup
+                       --device OSS detach
                EOF"
        fi
 }
@@ -318,8 +314,7 @@ ec_using_osc () {
 
        $lctl <<-EOF
                attach echo_client ${osc_name}_ecc ${osc_name}_ecc_UUID
-               cfg_device ${osc_name}_ecc
-               setup $osc_name
+               --device ${osc_name}_ecc setup $osc_name
        EOF
 
 }
@@ -333,8 +328,7 @@ ec_using_srv_nid () {
        $lctl add_uuid echo_UUID $server_nid@$NETTYPE >/dev/null 2>&1
        $lctl <<-EOF
                attach osc $ocsname $oscuuid
-               cfg_device $ocsname
-               setup echo_srv_UUID echo_UUID
+               --device $oscname setup echo_srv_UUID echo_UUID
        EOF
        $lctl <<-EOF
                attach echo_client ${ocsname}_ecc $oscuuid
@@ -350,8 +344,7 @@ setup_osc_for_remote_ost () {
        $lctl add_uuid ${host_name}_UUID $ost_nid@$NETTYPE >/dev/null 2>&1
        $lctl <<-EOF
                attach osc ${obdfilter_name}_osc ${obdfilter_name}_osc_UUID
-               cfg_device ${obdfilter_name}_osc
-               setup ${obdfilter_name}_UUID ${host_name}_UUID
+               --device ${obdfilter_name}_osc setup ${obdfilter_name}_UUID ${host_name}_UUID
        EOF
 }
 
@@ -363,8 +356,7 @@ setup_srv_obd () {
        remote_shell "root@$server_nid" \
        "$lctl <<-EOF
                attach obdecho $test_ostfsnm ${test_ostfsnm}_UUID
-               cfg_device $test_ostfsnm
-               setup
+               --device $test_ostfsnm setup
        EOF"
 }
 
@@ -375,8 +367,7 @@ setup_OSS () {
        remote_shell "root@$server_nid" \
        "$lctl <<-EOF
                attach ost OSS OSS_UUID
-               cfg_device OSS
-               setup
+               --device OSS setup
        EOF"
 }
 
@@ -389,9 +380,8 @@ teardown_ec_devno () {
 
        remote_shell $host \
        "$lctl <<-EOF
-               cfg $client_name
-               cleanup
-               detach
+               --device $client_name cleanup
+               --device $client_name detach
        EOF"
 }
 
index 6f98f96..dbbf3fe 100644 (file)
@@ -58,9 +58,8 @@ lfsck_attach() {
 
 lfsck_detach() {
        ${ECHOCMD} "${LCTL} <<-EOF
-               device lfsck-MDT0000
-               cleanup
-               detach
+               --device lfsck-MDT0000 cleanup
+               --device lfsck-MDT0000 detach
        EOF"
 }
 
@@ -68,23 +67,15 @@ lfsck_create() {
        local echodev=$(${RLCTL} dl | grep echo_client|awk '{print $1}')
        local j
 
-       ${ECHOCMD} "${LCTL} <<-EOF
-               cfg_device ${echodev}
-               test_mkdir ${tdir}
-       EOF"
+       ${ECHOCMD} "${LCTL} --device ${echodev} test_mkdir ${tdir}"
 
        for ((j = 1; j < ${threads}; j++)); do
-               ${ECHOCMD} "${LCTL} <<-EOF
-                       cfg_device ${echodev}
-                       test_mkdir ${tdir}${j}
-               EOF"
+               ${ECHOCMD} "${LCTL} --device ${echodev} test_mkdir ${tdir}${j}"
        done
 
-       ${ECHOCMD} "${LCTL} <<-EOF
-               cfg_device ${echodev}
-               --threads ${threads} 0 ${echodev} test_create \
-               -d ${tdir} -D ${threads} -b ${lbase} -c 0 -n ${usize}
-       EOF"
+       ${ECHOCMD} "${LCTL} --device ${echodev} \
+               --threads ${threads} 0 ${echodev} \
+               test_create -d${tdir} -D${threads} -b${lbase} -c0 -n${usize}"
 }
 
 lfsck_cleanup() {
index 3a85cca..2327a7e 100755 (executable)
@@ -791,9 +791,8 @@ test_28() { # bug 9977
        $LCTL --device $tECHOID destroy "${tOBJID}:0"
 
        $LCTL <<-EOF
-               cfg_device ECHO_osc1
-               cleanup
-               detach
+               --device ECHO_osc1 cleanup
+               --device ECHO_osc1 detach
        EOF
 
        # reading of 1st stripe should pass
index 0c90e45..aee5aa0 100644 (file)
@@ -66,9 +66,8 @@ scrub_attach() {
 
 scrub_detach() {
        ${ECHOCMD} "${LCTL} <<-EOF
-               device scrub-MDT0000
-               cleanup
-               detach
+               --device scrub-MDT0000 cleanup
+               --device scrub-MDT0000 detach
        EOF"
 }
 
@@ -76,22 +75,15 @@ scrub_create() {
        local echodev=$(${RLCTL} dl | grep echo_client|awk '{print $1}')
        local j
 
-       ${ECHOCMD} "${LCTL} <<-EOF
-               cfg_device ${echodev}
-               test_mkdir ${tdir}
-       EOF"
+       ${ECHOCMD} "${LCTL} --device ${echodev} test_mkdir ${tdir}"
 
-       for ((j=1; j<${threads}; j++)); do
-               ${ECHOCMD} "${LCTL} <<-EOF
-                       cfg_device ${echodev}
-                       test_mkdir ${tdir}${j}
-               EOF"
+       for ((j = 1; j < ${threads}; j++)); do
+               ${ECHOCMD} "${LCTL} --device ${echodev} test_mkdir ${tdir}${j}"
        done
 
-       ${ECHOCMD} "${LCTL} <<-EOF
-               cfg_device ${echodev}
-               --threads ${threads} 0 ${echodev} test_create \
-               -d ${tdir} -D ${threads} -b ${lbase} -c 0 -n ${usize}
+       ${ECHOCMD} "${LCTL} --device ${echodev} \
+               --threads ${threads} 0 ${echodev} \
+               test_create -d${tdir} -D${threads} -b${lbase} -c0 -n${usize}"
        EOF"
 }