diff mbox

[ndctl] test/btt-errors.sh: unmount the namespace before disabling

Message ID 20171204211529.5944-1-vishal.l.verma@intel.com (mailing list archive)
State Accepted
Commit 088b80ca6f3c
Headers show

Commit Message

Verma, Vishal L Dec. 4, 2017, 9:15 p.m. UTC
When cleaning up after the first part of the test, the disable-region
and subsequent zero-labels would fail if the namespace was mounted. Fix
this by unmounting the namespace before trying to disable it.

Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 test/btt-errors.sh | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/test/btt-errors.sh b/test/btt-errors.sh
index d3a4694..68e3652 100755
--- a/test/btt-errors.sh
+++ b/test/btt-errors.sh
@@ -146,6 +146,7 @@  dd if=$MNT/$FILE of=/dev/null iflag=direct bs=4096 count=1
 ## ensure we get an EIO for errors in namespace metadata
 
 # reset everything to get a clean log
+if grep -q "$MNT" /proc/mounts; then umount $MNT; fi
 $NDCTL disable-region -b "$BUS" all
 $NDCTL zero-labels -b "$BUS" all
 $NDCTL enable-region -b "$BUS" all