From a20b78a81d091cebd6b9e6c87537b2c955084cd5 Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Wed, 14 Oct 2020 09:46:42 +0800 Subject: [PATCH] LU-15357 iokit: fix the obsolete usage of cfg_device 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 Signed-off-by: Mikhail Pershin Reviewed-on: https://review.whamcloud.com/45872 Tested-by: jenkins Reviewed-by: Colin Faber Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre-iokit/obdfilter-survey/iokit-libecho | 37 ++++++++++++----------------- lustre/tests/lfsck-performance.sh | 23 ++++++------------ lustre/tests/run-llog.sh | 5 ++-- lustre/tests/scrub-performance.sh | 24 +++++++------------ 4 files changed, 32 insertions(+), 57 deletions(-) diff --git a/lustre-iokit/obdfilter-survey/iokit-libecho b/lustre-iokit/obdfilter-survey/iokit-libecho index 03c205c..b60eaeb 100644 --- a/lustre-iokit/obdfilter-survey/iokit-libecho +++ b/lustre-iokit/obdfilter-survey/iokit-libecho @@ -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" } diff --git a/lustre/tests/lfsck-performance.sh b/lustre/tests/lfsck-performance.sh index 6f98f96..dbbf3fe 100644 --- a/lustre/tests/lfsck-performance.sh +++ b/lustre/tests/lfsck-performance.sh @@ -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() { diff --git a/lustre/tests/run-llog.sh b/lustre/tests/run-llog.sh index 96cb825..abe5075 100644 --- a/lustre/tests/run-llog.sh +++ b/lustre/tests/run-llog.sh @@ -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 diff --git a/lustre/tests/scrub-performance.sh b/lustre/tests/scrub-performance.sh index 0c90e45..aee5aa0 100644 --- a/lustre/tests/scrub-performance.sh +++ b/lustre/tests/scrub-performance.sh @@ -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" } -- 1.8.3.1