summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-04-17 12:35:53 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-04-17 12:37:25 -0400
commit64c4b96d827684cc8e5a22dd2e92b824cfa19648 (patch)
tree11234719954c71cb606f86fda77150cf9030ccfa
parentcf50d60372fec3784e60a4f0f87736c3ce1c221b (diff)
bcachefs: test_subvol_mv_snapshot2()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rwxr-xr-xtests/fs/bcachefs/subvol.ktest24
1 files changed, 19 insertions, 5 deletions
diff --git a/tests/fs/bcachefs/subvol.ktest b/tests/fs/bcachefs/subvol.ktest
index b7e3dda..c76f36a 100755
--- a/tests/fs/bcachefs/subvol.ktest
+++ b/tests/fs/bcachefs/subvol.ktest
@@ -383,15 +383,14 @@ test_mkdir_mv_snapshot()
bcachefs_test_end_checks ${ktest_scratch_dev[0]}
}
+# Create a subvolume, snapshot its parent, rename it:
test_subvol_mv_snapshot()
{
run_quiet "" bcachefs format -f --errors=panic ${ktest_scratch_dev[0]}
mount -t bcachefs ${ktest_scratch_dev[0]} /mnt
- bcachefs subvolume create /mnt/sub1
- bcachefs subvolume create /mnt/sub1/sub2
- bcachefs subvolume snapshot /mnt/ /mnt/snap1
- bcachefs subvolume snapshot /mnt/sub1 /mnt/snap2
- mv /mnt/sub1 /mnt/sub2
+ bcachefs subvolume create /mnt/sub
+ bcachefs subvolume snapshot /mnt/ /mnt/snap
+ mv /mnt/sub /mnt/sub-renamed
umount /mnt
bcachefs fsck -n ${ktest_scratch_dev[0]}
@@ -399,6 +398,21 @@ test_subvol_mv_snapshot()
bcachefs_test_end_checks ${ktest_scratch_dev[0]}
}
+# Create a subvolume, snapshot it, rename it:
+test_subvol_mv_snapshot2()
+{
+ run_quiet "" bcachefs format -f --errors=panic ${ktest_scratch_dev[0]}
+ mount -t bcachefs ${ktest_scratch_dev[0]} /mnt
+ bcachefs subvolume create /mnt/sub
+ bcachefs subvolume snapshot /mnt/sub /mnt/snap
+ mv /mnt/sub /mnt/sub-renamed
+ umount /mnt
+
+ bcachefs fsck -ny ${ktest_scratch_dev[0]}
+
+ bcachefs_test_end_checks ${ktest_scratch_dev[0]}
+}
+
# Test moving a subvol to another subvol
test_subvol_mv_subvol()
{