aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2015-04-18 08:22:48 -0400
committerChris Mason <clm@fb.com>2015-04-26 09:26:58 -0400
commite4c88f007be78d38eaef316c599a1ee2f0272c15 (patch)
tree738af0712562d398e507f565f827d6210de41605 /fs
parent24b89d08ef63f9c62e55593e27a55e57b0062046 (diff)
Btrfs: don't check for delalloc_bytes in cache_save_setup
Now that we're doing free space cache writeback outside the critical section in the commit, there is a bigger window for delalloc_bytes to be added after a cache has been written. find_free_extent may do this without putting the block group back into the dirty list, and also without a transaction running. Checking for delalloc_bytes in cache_save_setup means we might leave the cache marked as written without invalidating it. Consistency checks during mount will toss the cache, but it's better to get rid of the check in cache_save_setup and let it get invalidated by the checks already done during cache write out. Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent-tree.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index eeb429cafcb5..6f420c8efdaf 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3305,8 +3305,7 @@ again:
3305 3305
3306 spin_lock(&block_group->lock); 3306 spin_lock(&block_group->lock);
3307 if (block_group->cached != BTRFS_CACHE_FINISHED || 3307 if (block_group->cached != BTRFS_CACHE_FINISHED ||
3308 !btrfs_test_opt(root, SPACE_CACHE) || 3308 !btrfs_test_opt(root, SPACE_CACHE)) {
3309 block_group->delalloc_bytes) {
3310 /* 3309 /*
3311 * don't bother trying to write stuff out _if_ 3310 * don't bother trying to write stuff out _if_
3312 * a) we're not cached, 3311 * a) we're not cached,