From: Daniel Wagner Date: Tue, 26 Mar 2024 13:13:45 +0000 (+0100) Subject: nvme/rc: log error if stale configuration is found X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ea1381e9b00bb8f5a1e24e8f6b7415891ecbffb0;p=users%2Fsagi%2Fblktests.git nvme/rc: log error if stale configuration is found It's possible that a previous run of blktest left some stale configuration left. E.g. when the module unload doesn't work (the bug might in the kernel we are testing). In this case error out and avoid confusion. Signed-off-by: Daniel Wagner Signed-off-by: Shin'ichiro Kawasaki --- diff --git a/tests/nvme/rc b/tests/nvme/rc index 865c8c3..e67bb84 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -658,6 +658,11 @@ _create_nvmet_host() { local nvmet_ctrlkey="$4" local host_path="${NVMET_CFS}/hosts/${nvmet_hostnqn}" + if [[ -d "${host_path}" ]]; then + echo "FAIL target setup failed. stale host configuration found" + return 1; + fi + mkdir "${host_path}" _add_nvmet_allow_hosts "${nvmet_subsystem}" "${nvmet_hostnqn}" if [[ "${nvmet_hostkey}" ]] ; then