done
# Try to append to files; this should fail
-echo "+ mount image"
+echo "+ mount image && modify files"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify files"
for x in `seq 1 64`; do
$XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
done
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ modify files
++ mount image && modify files
+ repair fs
+ mount image
+ chattr -R -i
_scratch_xfs_db -x -c "agi ${ag}" -c "agi ${ag}" -c "stack" -c "blocktrash -x 32 -o +64 -y 4096 -z ${FUZZ_ARGS}" >> $seqres.full 2>&1
done
-echo "+ mount image"
+echo "+ mount image && modify files"
+broken=1
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify files"
- broken=0
for x in `seq 65 70`; do
- touch "${TESTFILE}.${x}" 2> /dev/null || broken=1
+ touch "${TESTFILE}.${x}" 2> /dev/null && broken=0
done
- echo "broken: ${broken}"
umount "${SCRATCH_MNT}"
fi
+echo "broken: ${broken}"
echo "+ repair fs"
_scratch_xfs_repair >> $seqres.full 2>&1
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ modify files
++ mount image && modify files
broken: 1
+ repair fs
+ mount image (2)
done
# Try to append to files; this should fail
-echo "+ mount image"
+echo "+ mount image && modify files"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify files"
for x in `seq 1 64`; do
$XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
done
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ modify files
++ mount image && modify files
+ repair fs
+ mount image
+ chattr -R -i
done
# Try to append to files; this should fail
-echo "+ mount image"
+echo "+ mount image && modify files"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify files"
for x in `seq 1 64`; do
$XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
done
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ modify files
++ mount image && modify files
+ repair fs
+ mount image
+ chattr -R -i
done
# Try to append to files; this should fail
-echo "+ mount image"
+echo "+ mount image && modify files"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify files"
for x in `seq 1 64`; do
$XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
done
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ modify files
++ mount image && modify files
+ repair fs
+ mount image
+ chattr -R -i
_scratch_xfs_db -x -c "agi ${ag}" -c "agi ${ag}" -c "addr root" -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full 2>&1
done
-echo "+ mount image"
+echo "+ mount image && modify files"
+broken=1
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify files"
- broken=0
for x in `seq 65 70`; do
- touch "${TESTFILE}.${x}" 2> /dev/null || broken=1
+ touch "${TESTFILE}.${x}" 2> /dev/null && broken=0
done
- echo "broken: ${broken}"
umount "${SCRATCH_MNT}"
fi
+echo "broken: ${broken}"
echo "+ repair fs"
_scratch_xfs_repair >> $seqres.full 2>&1
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ modify files
++ mount image && modify files
broken: 1
+ repair fs
+ mount image (2)
_scratch_xfs_db -x -c "agi ${ag}" -c "agi ${ag}" -c "addr free_root" -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full 2>&1
done
-echo "+ mount image"
+echo "+ mount image && modify files"
+broken=1
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify files"
broken=0
for x in `seq 65 70`; do
- touch "${TESTFILE}.${x}" 2> /dev/null || broken=1
+ touch "${TESTFILE}.${x}" 2> /dev/null && broken=0
done
- echo "broken: ${broken}"
umount "${SCRATCH_MNT}"
fi
+echo "broken: ${broken}"
echo "+ repair fs"
_scratch_xfs_repair >> $seqres.full 2>&1
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ modify files
++ mount image && modify files
broken: 1
+ repair fs
+ mount image (2)
echo "+ corrupt dir"
_scratch_xfs_db -x -c "inode ${inode}" -c 'dblock 0' -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
-echo "+ mount image"
+echo "+ mount image && modify dir"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify dir"
rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
umount "${SCRATCH_MNT}"
+ check fs
+ check dir
+ corrupt dir
-+ mount image
-+ modify dir
++ mount image && modify dir
+ repair fs
+ mount image (2)
+ chattr -R -i
loff="$((loff + 1))"
done
-echo "+ mount image"
+echo "+ mount image && modify dir"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify dir"
rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
umount "${SCRATCH_MNT}"
+ check fs
+ check dir
+ corrupt dir
-+ mount image
-+ modify dir
++ mount image && modify dir
+ repair fs
+ mount image (2)
+ chattr -R -i
echo "+ corrupt dir"
_scratch_xfs_db -x -c "inode ${inode}" -c "dblock ${leaf_lblk}" -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
-echo "+ mount image"
+echo "+ mount image && modify dir"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify dir"
rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
umount "${SCRATCH_MNT}"
+ check fs
+ check dir
+ corrupt dir
-+ mount image
-+ modify dir
++ mount image && modify dir
+ repair fs
+ mount image (2)
+ chattr -R -i
loff="$((loff + 1))"
done
-echo "+ mount image"
+echo "+ mount image && modify dir"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify dir"
rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
umount "${SCRATCH_MNT}"
+ check fs
+ check dir
+ corrupt dir
-+ mount image
-+ modify dir
++ mount image && modify dir
+ repair fs
+ mount image (2)
+ chattr -R -i
loff="$((loff + 1))"
done
-echo "+ mount image"
+echo "+ mount image && modify dir"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify dir"
rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
umount "${SCRATCH_MNT}"
+ check fs
+ check dir
+ corrupt dir
-+ mount image
-+ modify dir
++ mount image && modify dir
+ repair fs
+ mount image (2)
+ chattr -R -i
loff="$((loff + 1))"
done
-echo "+ mount image"
+echo "+ mount image && modify dir"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify dir"
rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
umount "${SCRATCH_MNT}"
+ check fs
+ check dir
+ corrupt dir
-+ mount image
-+ modify dir
++ mount image && modify dir
+ repair fs
+ mount image (2)
+ chattr -R -i
loff="$((loff + 1))"
done
-echo "+ mount image"
+echo "+ mount image && modify dir"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify dir"
rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
umount "${SCRATCH_MNT}"
+ check fs
+ check dir
+ corrupt dir
-+ mount image
-+ modify dir
++ mount image && modify dir
+ repair fs
+ mount image (2)
+ chattr -R -i
_scratch_xfs_db -x -c "inode ${ino}" -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full 2>&1
done
-echo "+ mount image"
+echo "+ mount image && modify files"
+broken=1
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify files"
- broken=0
for x in `seq 1 64`; do
stat "${TESTFILE}.${x}" >> $seqres.full 2>&1
- test $? -ne 0 && broken=1
+ test $? -eq 0 && broken=0
touch "${TESTFILE}.${x}" >> $seqres.full 2>&1
- test $? -ne 0 && broken=1
+ test $? -eq 0 && broken=0
done
- echo "broken: ${broken}"
umount "${SCRATCH_MNT}"
fi
+echo "broken: ${broken}"
echo "+ repair fs"
_scratch_xfs_repair >> $seqres.full 2>&1
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ modify files
++ mount image && modify files
broken: 1
+ repair fs
+ mount image (2)
echo "+ corrupt image"
_scratch_xfs_db -x -c "inode ${inode}" -c "addr u.bmbt.ptrs[1]" -c "addr u3.bmbt.ptrs[1]" -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
-echo "+ mount image"
+echo "+ mount image && modify files"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify files"
before="$(stat -c '%b' "${SCRATCH_MNT}/bigfile")"
$XFS_IO_PROG -f -c "pwrite -S 0x62 ${blksz} ${blksz}" -c 'fsync' "${SCRATCH_MNT}/bigfile" >> $seqres.full 2> /dev/null
after="$(stat -c '%b' "${SCRATCH_MNT}/bigfile")"
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ modify files
++ mount image && modify files
+ repair fs
+ mount image (2)
+ chattr -R -i
echo "+ corrupt xattr"
_scratch_xfs_db -x -c "inode ${inode}" -c 'ablock 0' -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
-echo "+ mount image"
+echo "+ mount image && modify xattr"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify xattr"
setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null && _fail "modified corrupt xattr"
umount "${SCRATCH_MNT}"
fi
+ check fs
+ check xattr
+ corrupt xattr
-+ mount image
-+ modify xattr
++ mount image && modify xattr
+ repair fs
+ mount image (2)
+ chattr -R -i
echo "+ corrupt xattr"
_scratch_xfs_db -x -c "inode ${inode}" -c 'ablock 0' -c "stack" -c "blocktrash -x 32 -o +32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
-echo "+ mount image"
+echo "+ mount image && modify xattr"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify xattr"
setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null && _fail "modified corrupt xattr"
umount "${SCRATCH_MNT}"
fi
+ check fs
+ check xattr
+ corrupt xattr
-+ mount image
-+ modify xattr
++ mount image && modify xattr
+ repair fs
+ mount image (2)
+ chattr -R -i
loff="$((loff + 1))"
done
-echo "+ mount image"
+echo "+ mount image && modify xattr"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ modify xattr"
setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null && _fail "modified corrupt xattr"
umount "${SCRATCH_MNT}"
fi
+ check fs
+ check xattr
+ corrupt xattr
-+ mount image
-+ modify xattr
++ mount image && modify xattr
+ repair fs
+ mount image (2)
+ chattr -R -i
>> $seqres.full 2>&1
done
-echo "+ mount image"
+echo "+ mount image && copy more"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ copy more"
$XFS_IO_PROG -f -c "pwrite -S 0x63 0 $((blksz * 64))" -c "fsync" ${SCRATCH_MNT}/file4 >> $seqres.full 2>&1
test -s ${SCRATCH_MNT}/file4 && _fail "should not be able to copy with busted rmap btree"
umount ${SCRATCH_MNT}
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ copy more
++ mount image && copy more
+ repair fs
+ mount image (2)
+ chattr -R -i
-c "stack" -c "blocktrash -x 4096 -y 4096 -n 8 -3 -z" \
>> $seqres.full 2>&1
-echo "+ mount image"
+echo "+ mount image && copy more"
if _try_scratch_mount >> $seqres.full 2>&1; then
- echo "+ copy more"
$XFS_IO_PROG -f -R -c "pwrite -S 0x68 0 1" $SCRATCH_MNT/e3 >> $seqres.full 2>&1
test -s ${SCRATCH_MNT}/f3 && echo "should not be able to copy with busted rtrmap btree"
_scratch_unmount
+ make some files
+ check fs
+ corrupt image
-+ mount image
-+ copy more
++ mount image && copy more
+ repair fs
+ mount image (2)
+ copy more (2)