btrfs: Remove never-reached WARN_ON
authorNikolay Borisov <nborisov@suse.com>
Thu, 17 Aug 2017 07:52:28 +0000 (10:52 +0300)
committerDavid Sterba <dsterba@suse.com>
Fri, 18 Aug 2017 14:36:29 +0000 (16:36 +0200)
We have a WARN_ON(!var) inside an if branch which is executed (among
others) only when var is true.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c

index c74d24c1bbc982677f565b0dbadd68d4f952aa05..eff674bfd162c965a0cbf38e915259d78e0023f3 100644 (file)
@@ -6745,7 +6745,7 @@ static int unpin_extent_range(struct btrfs_fs_info *fs_info,
                if (!readonly && return_free_space &&
                    global_rsv->space_info == space_info) {
                        u64 to_add = len;
-                       WARN_ON(!return_free_space);
+
                        spin_lock(&global_rsv->lock);
                        if (!global_rsv->full) {
                                to_add = min(len, global_rsv->size -