summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/super.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index b0d4ad7fbe48..833602511f62 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -722,14 +722,12 @@ bool btrfs_check_options(const struct btrfs_fs_info *info,
*/
void btrfs_set_free_space_cache_settings(struct btrfs_fs_info *fs_info)
{
- if (fs_info->sectorsize < PAGE_SIZE) {
+ if (fs_info->sectorsize < PAGE_SIZE && btrfs_test_opt(fs_info, SPACE_CACHE)) {
+ btrfs_info(fs_info,
+ "forcing free space tree for sector size %u with page size %lu",
+ fs_info->sectorsize, PAGE_SIZE);
btrfs_clear_opt(fs_info->mount_opt, SPACE_CACHE);
- if (!btrfs_test_opt(fs_info, FREE_SPACE_TREE)) {
- btrfs_info(fs_info,
- "forcing free space tree for sector size %u with page size %lu",
- fs_info->sectorsize, PAGE_SIZE);
- btrfs_set_opt(fs_info->mount_opt, FREE_SPACE_TREE);
- }
+ btrfs_set_opt(fs_info->mount_opt, FREE_SPACE_TREE);
}
/*