ok=0
fi
- # xfs_check runs out of memory on large files, so even providing the test
- # option (-t) to avoid indexing the free space trees doesn't make it pass on
- # large filesystems. Avoid it.
- if [ "$LARGE_SCRATCH_DEV" != yes ]; then
+ # xfs_check runs out of memory on large files, so even providing the
+ # test option (-t) to avoid indexing the free space trees doesn't make
+ # it pass on large filesystems. Avoid it.
+ #
+ # As of August 2021, xfs_repair completely supersedes xfs_check's
+ # ability to find corruptions, so we no longer run xfs_check unless
+ # forced to run it.
+ if [ "$LARGE_SCRATCH_DEV" != yes ] && [ "$FORCE_XFS_CHECK_PROG" = "yes" ]; then
_xfs_check $extra_log_options $device 2>&1 > $tmp.fs_check
fi
if [ -s $tmp.fs_check ]; then
done
}
+# Unmount an XFS with a dirty log
+_scratch_xfs_unmount_dirty()
+{
+ local f="$SCRATCH_MNT/.dirty_umount"
+
+ rm -f "$f"
+ echo "test" > "$f"
+ sync
+ _scratch_shutdown
+ _scratch_unmount
+}
+
# Skip if we are running an older binary without the stricter input checks.
# Make multiple checks to be sure that there is no regression on the one
# selected feature check, which would skew the result.
. $tmp.mkfs
_scratch_mount
# here just to check if kernel supports, no need do more extra work
- local errmsg=$($XFS_GROWFS_PROG -D$((dblocks-1)) "$SCRATCH_MNT" 2>&1)
+ local errmsg
+ errmsg=$($XFS_GROWFS_PROG -D$((dblocks-1)) "$SCRATCH_MNT" 2>&1)
if [ "$?" -ne 0 ]; then
echo "$errmsg" | grep 'XFS_IOC_FSGROWFSDATA xfsctl failed: Invalid argument' > /dev/null && \
_notrun "kernel does not support shrinking"