Whamcloud - gitweb
LU-15357 iokit: fix the obsolete usage of cfg_device 72/45872/9
authorHongchao Zhang <hongchao@whamcloud.com>
Wed, 14 Oct 2020 01:46:42 +0000 (09:46 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 1 Sep 2022 05:52:42 +0000 (05:52 +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.

Change-Id: If7f6eff080906e395023289652fcd2a78dfb6fb7
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/45872
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Colin Faber <cfaber@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre-iokit/obdfilter-survey/iokit-libecho
lustre/tests/lfsck-performance.sh
lustre/tests/run-llog.sh
lustre/tests/scrub-performance.sh

index 03c205c..b60eaeb 100644 (file)
@@ -179,22 +179,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
 }
@@ -298,18 +295,17 @@ get_ec_devno () {
 # create echo client using server nid.
 ec_using_srv_nid () {
        local server_nid=$1
-       local ocsname=$2
+       local oscname=$2
        local oscuuid=$3
 
        $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
+               attach osc $oscname $oscuuid
+               --device $oscname setup echo_srv_UUID echo_UUID
        EOF
        $lctl <<-EOF
-               attach echo_client ${ocsname}_ecc $oscuuid
-               setup $ocsname
+               attach echo_client ${oscname}_ecc $oscuuid
+               --device ${oscname}_ecc setup $oscname
        EOF
 }
 
@@ -321,8 +317,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"
 }
 
@@ -333,8 +328,7 @@ setup_OSS () {
        remote_shell "root@$server_nid" \
        "$lctl <<-EOF
                attach ost OSS OSS_UUID
-               cfg_device OSS
-               setup
+               --device OSS setup
        EOF"
 }
 
@@ -347,9 +341,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 96cb825..abe5075 100644 (file)
@@ -20,9 +20,8 @@ eval "$LCTL <<-EOF || RC=2
        attach llog_test llt_name llt_uuid
        ignore_errors
        setup $MGS
-       device llt_name
-       cleanup
-       detach
+       --device llt_name cleanup
+       --device llt_name detach
 EOF"
 rmmod -v llog_test || RC2=3
 [ $RC -eq 0 -a "$RC2" ] && RC=$RC2
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"
 }