@@ -776,6 +776,18 @@ _reset_xfs_sysfs_error_handling()
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.
@@ -44,12 +44,16 @@ _pwrite_byte 0x62 0 $((blksz * 64)) "${SCRATCH_MNT}/file0" >> "$seqres.full"
_pwrite_byte 0x61 0 $((blksz * 64)) "${SCRATCH_MNT}/file1" >> "$seqres.full"
_cp_reflink "${SCRATCH_MNT}/file0" "${SCRATCH_MNT}/file2"
_cp_reflink "${SCRATCH_MNT}/file1" "${SCRATCH_MNT}/file3"
-umount "${SCRATCH_MNT}"
+_scratch_unmount
echo "+ check fs"
_scratch_xfs_repair -n >> "$seqres.full" 2>&1 || \
_fail "xfs_repair should not fail"
+echo "+ force log recovery"
+_scratch_mount
+_scratch_xfs_unmount_dirty
+
echo "+ corrupt image"
seq 0 $((agcount - 1)) | while read ag; do
_scratch_xfs_db -x -c "agf ${ag}" -c "agf ${ag}" -c "addr refcntroot" \
@@ -3,6 +3,7 @@ QA output created by 130
+ mount fs image
+ make some files
+ check fs
++ force log recovery
+ corrupt image
+ mount image
+ repair fs
@@ -23,7 +23,7 @@ echo "Format"
_scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full
is_rmap=$($XFS_INFO_PROG $SCRATCH_MNT | grep -c "rmapbt=1")
-_scratch_unmount
+_scratch_xfs_unmount_dirty
_get_agf_data() {
field="$1"
@@ -121,9 +121,6 @@ fi
_dump_status "broken fs config" >> $seqres.full
-echo "Look for leftover warning in xfs_check"
-_scratch_xfs_check | _filter_leftover
-
echo "Look for leftover warning in xfs_repair"
_scratch_xfs_repair -n 2>&1 | _filter_leftover
@@ -4,8 +4,6 @@ We need AG1 to have a single free extent
Find our extent and old counter values
Remove the extent from the freesp btrees
Add the extent to the refcount btree
-Look for leftover warning in xfs_check
-leftover CoW extent (NR/NR) len NR
Look for leftover warning in xfs_repair
leftover CoW extent (NR/NR) len NR
Mount filesystem