aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2023-11-22 12:17:41 -0500
committerDavid Sterba <dsterba@suse.com>2023-12-15 20:27:03 +0100
commit272efa308fb6bfc7b04a4b6f6dde7b0431b51fee (patch)
treea2ffe01e5938965dccb8f46a12907d30b2d536ec /fs/btrfs
parentbtrfs: move space cache settings into open_ctree (diff)
downloadlinux-272efa308fb6bfc7b04a4b6f6dde7b0431b51fee.tar.gz
linux-272efa308fb6bfc7b04a4b6f6dde7b0431b51fee.zip
btrfs: do not allow free space tree rebuild on extent tree v2
We currently don't allow these options to be set if we're extent tree v2 via the mount option parsing. However when we switch to the new mount API we'll no longer have the super block loaded, so won't be able to make this distinction at mount option parsing time. Address this by checking for extent tree v2 at the point where we make the decision to rebuild the free space tree. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Acked-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/disk-io.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 33e48e3865c5..6fcb9390913e 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2969,7 +2969,11 @@ int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info)
if (btrfs_test_opt(fs_info, CLEAR_CACHE) &&
btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) {
- rebuild_free_space_tree = true;
+ if (btrfs_fs_incompat(fs_info, EXTENT_TREE_V2))
+ btrfs_warn(fs_info,
+ "'clear_cache' option is ignored with extent tree v2");
+ else
+ rebuild_free_space_tree = true;
} else if (btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE) &&
!btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE_VALID)) {
btrfs_warn(fs_info, "free space tree is invalid");
ns'>-4/+8 2002-09-10[PATCH] sys_exit_group(), threading, 2.5.34Ingo Molnar6-29/+123 2002-09-10[PATCH] exit.c compilation warning fixIngo Molnar1-1/+0 2002-09-10[PATCH] drivers/char/Makefile: Remove pty.o from export-objsSam Ravnborg1-1/+1 2002-09-10[PATCH] zftape: Cleanup zftape_syms.cSam Ravnborg1-20/+6 2002-09-10[PATCH] alpha updateIvan Kokshaysky6-101/+10 2002-09-10bio.h:Jens Axboe1-9/+3 2002-09-11ide_map_buffer() and ide_unmap_buffer() could cause imbalanced callsJens Axboe3-7/+8 2002-09-11missed pdc4030.h update:Jens Axboe1-0/+26 2002-09-11arch ide updates. mainly ide_ioreg_t type changes, and removal ofJens Axboe9-25/+11 2002-09-11ide-scsi updates:Jens Axboe1-76/+106