Btrfs: make BUG_ON() in add_pinned_bytes() an ASSERT()
authorOmar Sandoval <osandov@fb.com>
Tue, 6 Jun 2017 23:45:27 +0000 (16:45 -0700)
committerDavid Sterba <dsterba@suse.com>
Thu, 29 Jun 2017 18:17:01 +0000 (20:17 +0200)
The value of flags is one of DATA/METADATA/SYSTEM, they must exist at
when add_pinned_bytes is called.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ added changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c

index d784ecef27c034468d965eefd54d767dc831a1da..b344966585c8d8065d9e2a6f1f68fc8935a9b450 100644 (file)
@@ -783,7 +783,7 @@ static void add_pinned_bytes(struct btrfs_fs_info *fs_info, s64 num_bytes,
        }
 
        space_info = __find_space_info(fs_info, flags);
-       BUG_ON(!space_info); /* Logic bug */
+       ASSERT(space_info);
        percpu_counter_add(&space_info->total_bytes_pinned, num_bytes);
 }