All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@fujitsu.com>
To: <osandov@fb.com>, <yi.zhang@redhat.com>, <bvanassche@acm.org>
Cc: <linux-block@vger.kernel.org>, Xiao Yang <yangx.jy@fujitsu.com>
Subject: [PATCH blktests] srp/011: Avoid $dev becoming invalid during test
Date: Wed, 18 May 2022 14:44:17 +0800	[thread overview]
Message-ID: <20220518064417.47473-1-yangx.jy@fujitsu.com> (raw)

$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@fujitsu.com>
---
 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




             reply	other threads:[~2022-05-18  6:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18  6:44 Xiao Yang [this message]
2022-05-18 11:57 ` [PATCH blktests] srp/011: Avoid $dev becoming invalid during test Bart Van Assche
2022-05-20  9:24 ` Shinichiro Kawasaki
2022-05-26  7:34 ` Shinichiro Kawasaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220518064417.47473-1-yangx.jy@fujitsu.com \
    --to=yangx.jy@fujitsu.com \
    --cc=bvanassche@acm.org \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.com \
    --cc=yi.zhang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.