summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-08-24 15:16:01 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-04-14 20:17:32 -0400
commitf8a7975f900e63b6fd988eab429a16657e4eb7dc (patch)
tree367aa25d32a3620ea91b603d1f7d1553ec3bb1d1
parent73c378bf526a98a42529da9714de2e945ab749a0 (diff)
tests/fs/bcachefs/snapshot_file_delete_2
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rwxr-xr-xtests/fs/bcachefs/subvol.ktest30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/fs/bcachefs/subvol.ktest b/tests/fs/bcachefs/subvol.ktest
index e92b513..eddf6e9 100755
--- a/tests/fs/bcachefs/subvol.ktest
+++ b/tests/fs/bcachefs/subvol.ktest
@@ -775,4 +775,34 @@ test_snapshot_nested()
umount /mnt
}
+test_snapshot_file_delete_2()
+{
+ set_watchdog 60
+ run_quiet "" bcachefs format -f \
+ --errors=panic \
+ ${ktest_scratch_dev[0]}
+
+ mount -t bcachefs ${ktest_scratch_dev[0]} /mnt
+ local a=/mnt
+ local b=/mnt/derivative
+
+ touch $a/hi_there
+
+ bcachefs subvolume snapshot $a $b
+
+ rm $a/hi_there
+ rm $b/hi_there
+
+ bcachefs subvolume delete $b
+ umount /mnt
+
+ mount -t bcachefs ${ktest_scratch_dev[0]} /mnt
+ umount /mnt
+
+ mount -t bcachefs -o fsck ${ktest_scratch_dev[0]} /mnt
+ umount /mnt
+
+ check_counters ${ktest_scratch_dev[0]}
+}
+
main "$@"