]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common: add _require_norecovery
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 12 Feb 2015 03:19:37 +0000 (14:19 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 12 Feb 2015 03:19:37 +0000 (14:19 +1100)
This patch adds checking code whether filesystem supports norecovery
mount option or not.  Use this in the following xfs test.

 xfs/200         (recovery vs ro-block device)

Currently, norecovery mount option is used by xfs only. But some of
log-based filesystems (e.g., f2fs) are able to support it later.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/rc
tests/xfs/200

index 9d91ce041166ac1bae7dd2a3c4b9fb1a0cd95204..7449a1de9e13f2c4020e895dfb71fbf570f3f1ac 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2332,6 +2332,14 @@ _require_scratch_shutdown()
        _scratch_unmount
 }
 
+# Does norecovery support by this fs?
+_require_norecovery()
+{
+       _scratch_mount -o ro,norecovery || \
+               _notrun "$FSTYP does not support norecovery"
+       _scratch_unmount
+}
+
 # Does fiemap support?
 _require_fiemap()
 {
index c62d2b8616d21dd4376ddfc93bfbcdd09dbcea1d..bd6d0fdc9bc0dc5362a733faad8a9cfc1f20ff1c 100755 (executable)
@@ -46,6 +46,7 @@ _supported_os Linux
 
 _require_scratch_nocheck
 _require_scratch_shutdown
+_require_norecovery
 
 _scratch_mkfs_xfs >/dev/null 2>&1