Skip to content

Commit fea5f25

Browse files
adam900710kdave
authored andcommitted
btrfs-progs: tests: update misc/046 to not try to mount block device into different filesystems
Since kernel commit 40426dd147ff ("btrfs: use the super_block as holder when mounting file systems"), the kernel will not allow a block device belonging to two different filesystems. This means a seed device can only be mounted through either the sprouted fs, or the seed device, not both at the same time. Although a seed device can still be shared between different sprouted fs, only one of those fs can be mounted. Considering the extra benefit (extra protection, better device events handling), it's worthy to do the kernel behavior change. Update the test case to follow the new limits. Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Qu Wenruo <wqu@suse.com>
1 parent 5f69f2d commit fea5f25

File tree

1 file changed

+8
-9
lines changed
  • tests/misc-tests/046-seed-multi-mount

1 file changed

+8
-9
lines changed

tests/misc-tests/046-seed-multi-mount/test.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Verify that a seeding device can be mounted several times
2+
# Verify that a seeding device can be shared by different sprout filesystems.
33

44
source "$TEST_TOP/common" || exit
55

@@ -74,21 +74,20 @@ nextdevice() {
7474
if [ "$md5sum" != "$md5sum2" ]; then
7575
_fail "file contents not same after remount"
7676
fi
77+
# Unmount the new device so that the seed device won't be mounted
78+
# when the sprout fs is already mounted.
79+
# This is to compensate for the new v6.17 kernel, as each different
80+
# fs will have different holder for a block device, and a single block
81+
# device can not belong to different mounted filesystems.
82+
run_check_umount_test_dev
7783
}
7884

79-
# Keep previous device(s) mounted, create a new filesystem from the seeding device
85+
# Create a new filesystem from the seeding device, with previous devices unmounted.
8086
nextdevice 2
8187
nextdevice 3
8288
nextdevice 4
8389
nextdevice 5
8490

85-
# Final umount
86-
# Skip seeding device, loop device 1,
87-
run_check $SUDO_HELPER umount ${loopdevs[2]}
88-
run_check $SUDO_HELPER umount ${loopdevs[3]}
89-
run_check $SUDO_HELPER umount ${loopdevs[4]}
90-
run_check $SUDO_HELPER umount ${loopdevs[5]}
91-
9291
cleanup_loopdevs
9392

9493
rm -rf -- mnt[0-9]

0 commit comments

Comments
 (0)