summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2019-01-30 16:50:49 +0200
committerDavid Sterba <dsterba@suse.com>2019-02-25 14:13:36 +0100
commit9a0ec83d57953f67f3dcb261d126f33f53072b04 (patch)
tree2aee2546d5caefb955c531da89cf493ccb2c2ad0
parent260e77025ffa8779a7dc4bc21f3890273c93f9d4 (diff)
downloadlinux-stable-9a0ec83d57953f67f3dcb261d126f33f53072b04.tar.gz
linux-stable-9a0ec83d57953f67f3dcb261d126f33f53072b04.tar.bz2
linux-stable-9a0ec83d57953f67f3dcb261d126f33f53072b04.zip
btrfs: use WARN_ON in a canonical form btrfs_remove_block_group
There is no point in using a construct like 'if (!condition) WARN_ON(1)'. Use WARN_ON(!condition) directly. No functional changes. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/extent-tree.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 3c9ae2a0c0be..9f012c2facbe 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -10869,13 +10869,10 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
}
spin_lock(&trans->transaction->dirty_bgs_lock);
- if (!list_empty(&block_group->dirty_list)) {
- WARN_ON(1);
- }
- if (!list_empty(&block_group->io_list)) {
- WARN_ON(1);
- }
+ WARN_ON(!list_empty(&block_group->dirty_list));
+ WARN_ON(!list_empty(&block_group->io_list));
spin_unlock(&trans->transaction->dirty_bgs_lock);
+
btrfs_remove_free_space_cache(block_group);
spin_lock(&block_group->space_info->lock);