Linux block layer
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Omar Sandoval <osandov@fb.com>
Cc: linux-block@vger.kernel.org,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Logan Gunthorpe <logang@deltatee.com>,
	Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH blktests 2/4] tests/nvmeof-mp/rc: Make simulate_network_failure_loop() more robust
Date: Thu,  8 Aug 2019 13:05:04 -0700	[thread overview]
Message-ID: <20190808200506.186137-3-bvanassche@acm.org> (raw)
In-Reply-To: <20190808200506.186137-1-bvanassche@acm.org>

Avoid that the following is logged in the nvmeof-mp .full log files:

ls: cannot access '/sys/class/nvme/*/device/*/nvme0n1/reset_controller': No such
file or directory
tests/nvmeof-mp/rc: line 124: : No such file or directory

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 tests/nvmeof-mp/rc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/nvmeof-mp/rc b/tests/nvmeof-mp/rc
index 9324dd1e8e4f..7352b1628cd3 100755
--- a/tests/nvmeof-mp/rc
+++ b/tests/nvmeof-mp/rc
@@ -117,8 +117,9 @@ simulate_network_failure_loop() {
 	while [ $rc = 0 ]; do
 		sleep_until 5 ${deadline} || break
 		for d in $(held_by "$dev"); do
-			sf=$(ls -d /sys/class/nvme/*/device/*/"${d#/dev/}/reset_controller")
-			echo 1 > "$sf"
+			for sf in /sys/class/nvme/*/device/*/"${d#/dev/}/reset_controller"; do
+				[ -e "$sf" ] && echo 1 > "$sf"
+			done
 		done
 	done 2>>"$FULL"
 
-- 
2.22.0.770.g0f2c4a37fd-goog


  parent reply	other threads:[~2019-08-08 20:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 20:05 [PATCH blktests 0/4] Four blktests patches Bart Van Assche
2019-08-08 20:05 ` [PATCH blktests 1/4] tests/nvme/rc: Modify the approach for disabling and re-enabling Ctrl-C Bart Van Assche
2019-08-08 20:08   ` Logan Gunthorpe
2019-08-08 21:00     ` Bart Van Assche
2019-08-08 21:11       ` Logan Gunthorpe
2019-08-08 21:18         ` Bart Van Assche
2019-08-08 20:05 ` Bart Van Assche [this message]
2019-08-08 20:05 ` [PATCH blktests 3/4] tests/nvmeof-mp/rc: Make the NVMeOF multipath tests more reliable Bart Van Assche
2019-08-08 20:05 ` [PATCH blktests 4/4] tests/srp/014: Add a test that triggers a SCSI reset while I/O is ongoing Bart Van Assche
2019-09-04 17:49 ` [PATCH blktests 0/4] Four blktests patches Bart Van Assche
2019-09-04 17:55   ` Omar Sandoval

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=20190808200506.186137-3-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=jthumshirn@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=osandov@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox