[PATCH blktests] srp/011: Avoid $dev becoming invalid during test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$dev will become invalid when log_out has been done
and fio doesn't run yet. In this case subsequent fio
throws the following error:
-------------------------------------
    From diff -u 011.out 011.out.bad
    Configured SRP target driver
    -Passed

    From 011.full:
    fio: looks like your file system does not support direct=1/buffered=0
    fio: destination does not support O_DIRECT
    run_fio exit code: 1
-------------------------------------
This issue happens randomly.

Try to fix the issue by holding $dev before test.

Signed-off-by: Xiao Yang <yangx.jy@xxxxxxxxxxx>
---
 tests/srp/011 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/srp/011 b/tests/srp/011
index 29b2c03..63ff332 100755
--- a/tests/srp/011
+++ b/tests/srp/011
@@ -12,6 +12,8 @@ test_disconnect_repeatedly() {
 
 	use_blk_mq y y || return $?
 	dev=$(get_bdev 0) || return $?
+	# Hold $dev
+	exec 3< "$dev"
 	simulate_network_failure_loop "$dev" "$TIMEOUT" &
 	run_fio --verify=md5 --rw=randwrite --bs=4K --loops=10000 \
 		--ioengine=libaio --iodepth=64 --iodepth_batch=32 \
@@ -22,6 +24,8 @@ test_disconnect_repeatedly() {
 		>>"$FULL"
 	fio_status=$?
 	wait
+	# Release $dev
+	exec 3<&-
 	log_in
 	return $fio_status
 }
-- 
2.34.1






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux