aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmds-check.c11
-rw-r--r--free-space-cache.c2
2 files changed, 9 insertions, 4 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 9fd53f4..71f5959 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -2799,8 +2799,15 @@ static int check_space_cache(struct btrfs_root *root)
start = cache->key.objectid + cache->key.offset;
if (!cache->free_space_ctl) {
- if (btrfs_init_free_space_ctl(cache,
- root->leafsize)) {
+ int sectorsize;
+
+ if (cache->flags & (BTRFS_BLOCK_GROUP_METADATA |
+ BTRFS_BLOCK_GROUP_SYSTEM))
+ sectorsize = root->leafsize;
+ else
+ sectorsize = root->sectorsize;
+
+ if (btrfs_init_free_space_ctl(cache, sectorsize)) {
ret = -ENOMEM;
break;
}
diff --git a/free-space-cache.c b/free-space-cache.c
index 8a77a32..5fb8ece 100644
--- a/free-space-cache.c
+++ b/free-space-cache.c
@@ -808,8 +808,6 @@ int btrfs_add_free_space(struct btrfs_free_space_ctl *ctl, u64 offset,
try_merge_free_space(ctl, info);
ret = link_free_space(ctl, info);
- if (ret)
-
if (ret) {
printk(KERN_CRIT "btrfs: unable to add free space :%d\n", ret);
BUG_ON(ret == -EEXIST);