@@ -1932,6 +1932,25 @@ _scratch_xfs_find_metafile()
local metafile="$1"
local sb_field
+ # With metadir=1, the realtime volume is sharded into allocation
+ # groups. Each rtgroup has its own bitmap and summary file. Tests
+ # should pick a particular file, but this compatibility shim still
+ # exists to keep old tests working.
+ case "$metafile" in
+ "rbmino")
+ if _xfs_has_feature "$SCRATCH_DEV" rtgroups; then
+ echo "path -m /rtgroups/0.bitmap"
+ return 0
+ fi
+ ;;
+ "rsumino")
+ if _xfs_has_feature "$SCRATCH_DEV" rtgroups; then
+ echo "path -m /rtgroups/0.summary"
+ return 0
+ fi
+ ;;
+ esac
+
sb_field="$(_scratch_xfs_get_sb_field "$metafile")"
if echo "$sb_field" | grep -q -w 'not found'; then
return 1
@@ -30,7 +30,14 @@ _require_xfs_stress_scrub
_scratch_mkfs > "$seqres.full" 2>&1
_scratch_mount
_require_xfs_has_feature "$SCRATCH_MNT" realtime
-_scratch_xfs_stress_scrub -s "scrub rtbitmap" -s "scrub rgbitmap %rgno%"
+
+if _xfs_has_feature "$SCRATCH_MNT" rtgroups; then
+ _scratch_xfs_stress_scrub -s "scrub rtbitmap %rgno%"
+elif xfs_io -c 'help scrub' | grep -q rgsuper; then
+ _scratch_xfs_stress_scrub -s "scrub rtbitmap 0"
+else
+ _scratch_xfs_stress_scrub -s "scrub rtbitmap"
+fi
# success, all done
echo Silence is golden
@@ -31,13 +31,13 @@ _scratch_mkfs > "$seqres.full" 2>&1
_scratch_mount
_require_xfs_has_feature "$SCRATCH_MNT" realtime
-# XXX the realtime summary scrubber isn't currently implemented upstream.
-# Don't bother trying to test it on those kernels
-$XFS_IO_PROG -c 'scrub rtsummary' -c 'scrub rtsummary' "$SCRATCH_MNT" 2>&1 | \
- grep -q 'Scan was not complete' && \
- _notrun "rtsummary scrub is incomplete"
-
-_scratch_xfs_stress_scrub -s "scrub rtsummary"
+if _xfs_has_feature "$SCRATCH_MNT" rtgroups; then
+ _scratch_xfs_stress_scrub -s "scrub rtsummary %rgno%"
+elif xfs_io -c 'help scrub' | grep -q rgsuper; then
+ _scratch_xfs_stress_scrub -s "scrub rtsummary 0"
+else
+ _scratch_xfs_stress_scrub -s "scrub rtsummary"
+fi
# success, all done
echo Silence is golden
@@ -25,7 +25,11 @@ echo "Format and populate"
_scratch_populate_cached nofill > $seqres.full 2>&1
echo "Fuzz rtbitmap"
-path="$(_scratch_xfs_find_metafile rbmino)"
+if _xfs_has_feature "$SCRATCH_DEV" rtgroups; then
+ path="path -m /rtgroups/0.bitmap"
+else
+ path="$(_scratch_xfs_find_metafile rbmino)"
+fi
_scratch_xfs_fuzz_metadata '' 'online' "$path" 'dblock 0' >> $seqres.full
echo "Done fuzzing rtbitmap"
@@ -25,7 +25,11 @@ echo "Format and populate"
_scratch_populate_cached nofill > $seqres.full 2>&1
echo "Fuzz rtsummary"
-path="$(_scratch_xfs_find_metafile rsumino)"
+if _xfs_has_feature "$SCRATCH_DEV" rtgroups; then
+ path="path -m /rtgroups/0.summary"
+else
+ path="$(_scratch_xfs_find_metafile rsumino)"
+fi
_scratch_xfs_fuzz_metadata '' 'online' "$path" 'dblock 0' >> $seqres.full
echo "Done fuzzing rtsummary"
@@ -25,7 +25,11 @@ echo "Format and populate"
_scratch_populate_cached nofill > $seqres.full 2>&1
echo "Fuzz rtbitmap"
-path="$(_scratch_xfs_find_metafile rbmino)"
+if _xfs_has_feature "$SCRATCH_DEV" rtgroups; then
+ path="path -m /rtgroups/0.bitmap"
+else
+ path="$(_scratch_xfs_find_metafile rbmino)"
+fi
_scratch_xfs_fuzz_metadata '' 'offline' "$path" 'dblock 0' >> $seqres.full
echo "Done fuzzing rtbitmap"
@@ -25,7 +25,11 @@ echo "Format and populate"
_scratch_populate_cached nofill > $seqres.full 2>&1
echo "Fuzz rtsummary"
-path="$(_scratch_xfs_find_metafile rsumino)"
+if _xfs_has_feature "$SCRATCH_DEV" rtgroups; then
+ path="path -m /rtgroups/0.summary"
+else
+ path="$(_scratch_xfs_find_metafile rsumino)"
+fi
_scratch_xfs_fuzz_metadata '' 'offline' "$path" 'dblock 0' >> $seqres.full
echo "Done fuzzing rtsummary"
@@ -26,7 +26,11 @@ echo "Format and populate"
_scratch_populate_cached nofill > $seqres.full 2>&1
echo "Fuzz rtbitmap"
-path="$(_scratch_xfs_find_metafile rbmino)"
+if _xfs_has_feature "$SCRATCH_DEV" rtgroups; then
+ path="path -m /rtgroups/0.bitmap"
+else
+ path="$(_scratch_xfs_find_metafile rbmino)"
+fi
_scratch_xfs_fuzz_metadata '' 'both' "$path" 'dblock 0' >> $seqres.full
echo "Done fuzzing rtbitmap"
@@ -26,7 +26,11 @@ echo "Format and populate"
_scratch_populate_cached nofill > $seqres.full 2>&1
echo "Fuzz rtsummary"
-path="$(_scratch_xfs_find_metafile rsumino)"
+if _xfs_has_feature "$SCRATCH_DEV" rtgroups; then
+ path="path -m /rtgroups/0.summary"
+else
+ path="$(_scratch_xfs_find_metafile rsumino)"
+fi
_scratch_xfs_fuzz_metadata '' 'both' "$path" 'dblock 0' >> $seqres.full
echo "Done fuzzing rtsummary"
@@ -25,7 +25,11 @@ echo "Format and populate"
_scratch_populate_cached nofill > $seqres.full 2>&1
echo "Fuzz rtbitmap"
-path="$(_scratch_xfs_find_metafile rbmino)"
+if _xfs_has_feature "$SCRATCH_DEV" rtgroups; then
+ path="path -m /rtgroups/0.bitmap"
+else
+ path="$(_scratch_xfs_find_metafile rbmino)"
+fi
_scratch_xfs_fuzz_metadata '' 'none' "$path" 'dblock 0' >> $seqres.full
echo "Done fuzzing rtbitmap"
@@ -25,7 +25,11 @@ echo "Format and populate"
_scratch_populate_cached nofill > $seqres.full 2>&1
echo "Fuzz rtsummary"
-path="$(_scratch_xfs_find_metafile rsumino)"
+if _xfs_has_feature "$SCRATCH_DEV" rtgroups; then
+ path="path -m /rtgroups/0.summary"
+else
+ path="$(_scratch_xfs_find_metafile rsumino)"
+fi
_scratch_xfs_fuzz_metadata '' 'none' "$path" 'dblock 0' >> $seqres.full
echo "Done fuzzing rtsummary"
@@ -32,13 +32,13 @@ _scratch_mount
_require_xfs_has_feature "$SCRATCH_MNT" realtime
_xfs_force_bdev realtime $SCRATCH_MNT
-# XXX the realtime summary scrubber isn't currently implemented upstream.
-# Don't bother trying to fix it on those kernels
-$XFS_IO_PROG -c 'scrub rtsummary' -c 'scrub rtsummary' "$SCRATCH_MNT" 2>&1 | \
- grep -q 'Scan was not complete' && \
- _notrun "rtsummary scrub is incomplete"
-
-_scratch_xfs_stress_online_repair -s "repair rtsummary"
+if _xfs_has_feature "$SCRATCH_MNT" rtgroups; then
+ _scratch_xfs_stress_online_repair -s "repair rtsummary %rgno%"
+elif xfs_io -c 'help scrub' | grep -q rgsuper; then
+ _scratch_xfs_stress_online_repair -s "repair rtsummary 0"
+else
+ _scratch_xfs_stress_online_repair -s "repair rtsummary"
+fi
# success, all done
echo Silence is golden