From: Omar Sandoval Date: Tue, 6 Jun 2017 23:45:27 +0000 (-0700) Subject: Btrfs: make BUG_ON() in add_pinned_bytes() an ASSERT() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=55e8196a57cfe603ce3480a66c15dde3a13fe218;p=openwrt%2Fstaging%2Fblogic.git Btrfs: make BUG_ON() in add_pinned_bytes() an ASSERT() 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 Tested-by: Holger Hoffstätte Reviewed-by: David Sterba [ added changelog ] Signed-off-by: David Sterba --- diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index d784ecef27c0..b344966585c8 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -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); }