@@ -1108,6 +1108,15 @@ _require_no_xfs_bug_on_assert()
fi
}
+# Require that XFS is not configured in always_cow mode.
+_require_no_xfs_always_cow()
+{
+ if [ -f /sys/fs/xfs/debug/always_cow ]; then
+ grep -q "1" /sys/fs/xfs/debug/always_cow && \
+ _notrun "test requires XFS always_cow to be off, turn it off to run the test"
+ fi
+}
+
# Get a metadata field
# The first arg is the field name
# The rest of the arguments are xfs_db commands to find the metadata.
@@ -24,6 +24,7 @@ _require_cp_reflink
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_odirect
+_require_no_xfs_always_cow # writes have to converge to overwrites
echo "Format and mount"
_scratch_mkfs > $seqres.full 2>&1
@@ -26,6 +26,7 @@ _require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "funshare"
_require_odirect
+_require_no_xfs_always_cow # writes have to converge to overwrites
echo "Format and mount"
_scratch_mkfs > $seqres.full 2>&1
@@ -23,6 +23,7 @@ _require_cp_reflink
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_odirect
+_require_no_xfs_always_cow # writes have to converge to overwrites
echo "Format and mount"
_scratch_mkfs > $seqres.full 2>&1
@@ -28,6 +28,7 @@ _require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "funshare"
_require_odirect
+_require_no_xfs_always_cow # writes have to converge to overwrites
echo "Format and mount"
_scratch_mkfs > $seqres.full 2>&1
@@ -24,6 +24,7 @@ _require_cp_reflink
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_odirect
+_require_no_xfs_always_cow # writes have to converge to overwrites
echo "Format and mount"
_scratch_mkfs > $seqres.full 2>&1