Commit 55e8196a authored by Omar Sandoval's avatar Omar Sandoval Committed by David Sterba

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: default avatarOmar Sandoval <osandov@fb.com>
Tested-by: default avatarHolger Hoffstätte <holger@applied-asynchrony.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
[ added changelog ]
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 0d9f824d
...@@ -783,7 +783,7 @@ static void add_pinned_bytes(struct btrfs_fs_info *fs_info, s64 num_bytes, ...@@ -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); 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); percpu_counter_add(&space_info->total_bytes_pinned, num_bytes);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment