-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btrfs-progs: btrfstune: add ability to remove squotas
When simple quotas is enabled, every new data extent gets a special inline OWNER_REF item that identifies the owning subvolume. This makes simple quotas backwards incompatible with kernels older than v6.7. Even if you disable quotas on the filesystem, the OWNER_REF items are sprinkled throughout the extent tree and older kernels are unable to parse them. However, it is relatively easy to simply walk the extent tree and remove these inline ref items. This gives squota adopters the option to *fully* disable squotas on their system and un-set the incompat bit. Add this capability to btrfstune, which requires only a little tricky btrfs item data shifting. This functionality was tested with a new unit test, as well as a similar but more thorough integration test in fstests Reviewed-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Boris Burkov <boris@bur.io>
- Loading branch information
1 parent
c997cc1
commit f445f4f
Showing
4 changed files
with
209 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# Verify btrfstune for enabling and removing simple quotas | ||
|
||
source "$TEST_TOP/common" || exit | ||
source "$TEST_TOP/common.convert" || exit | ||
|
||
check_experimental_build | ||
setup_root_helper | ||
prepare_test_dev | ||
|
||
# Create the fs without simple quota | ||
run_check_mkfs_test_dev | ||
run_check_mount_test_dev | ||
populate_fs | ||
run_check_umount_test_dev | ||
# Enable simple quotas | ||
run_check $SUDO_HELPER "$TOP/btrfstune" --enable-simple-quota "$TEST_DEV" | ||
run_check_mount_test_dev | ||
run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT"/file2 bs=1M count=1 | ||
run_check_umount_test_dev | ||
run_check $SUDO_HELPER "$TOP/btrfs" check "$TEST_DEV" | ||
|
||
# Populate new fs with simple quotas enabled | ||
run_check_mkfs_test_dev -O squota | ||
run_check_mount_test_dev | ||
populate_fs | ||
run_check_umount_test_dev | ||
# Remove simple quotas | ||
run_check $SUDO_HELPER "$TOP/btrfstune" --remove-simple-quota "$TEST_DEV" | ||
run_check_mount_test_dev | ||
run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT"/file3 bs=1M count=1 | ||
run_check_umount_test_dev | ||
run_check $SUDO_HELPER "$TOP/btrfs" check "$TEST_DEV" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters