From 83af29b4ebe1e5b9529cda5ffa43f9ddbdd0b9ec Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Wed, 26 Jun 2019 11:39:12 +0200 Subject: [PATCH] test/ftl: wait till nbd is ready when loading JSON config When creating the nbd, we wait until it's ready, but we didn't do that when loading the configuration from JSON, which resulted in sporadic IO failures, as the device hasn't been initialized yet. This patch adds waitfornbd after each load_config call. Change-Id: Id350ae7b1afab11f5f3fbd131d938dbd65a8cb15 Signed-off-by: Konrad Sztyber Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459616 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Wojciech Malikowski Reviewed-by: Shuhei Matsumoto Reviewed-by: Mateusz Kozlowski Reviewed-by: Paul Luse Reviewed-by: Darek Stojaczyk --- test/ftl/dirty_shutdown.sh | 1 + test/ftl/restore.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/test/ftl/dirty_shutdown.sh b/test/ftl/dirty_shutdown.sh index 186e1a55f..b1e082074 100755 --- a/test/ftl/dirty_shutdown.sh +++ b/test/ftl/dirty_shutdown.sh @@ -77,6 +77,7 @@ waitforlisten $svcpid # Ftl should recover, though with a loss of data (-o config option) $rpc_py load_config < $testdir/config/ftl.json +waitfornbd nbd0 # Write extra data after restore dd if=/dev/urandom of=/dev/nbd0 bs=4K count=$chunk_size seek=$offset oflag=dsync diff --git a/test/ftl/restore.sh b/test/ftl/restore.sh index 509737039..0632bfc28 100755 --- a/test/ftl/restore.sh +++ b/test/ftl/restore.sh @@ -60,6 +60,7 @@ $rootdir/test/app/bdev_svc/bdev_svc & svcpid=$! waitforlisten $svcpid $rpc_py load_config < $testdir/config/ftl.json +waitfornbd nbd0 mount /dev/nbd0 $mount_dir