Commit 0185f364 authored by Qu Wenruo's avatar Qu Wenruo Committed by David Sterba

btrfs: extent-tree: Add lockdep assert when updating space info

Just add a safe net for btrfs_space_info member updating.
Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent cff82672
......@@ -58,6 +58,7 @@ enum {
static inline void update_##name(struct btrfs_space_info *sinfo, \
s64 bytes) \
{ \
lockdep_assert_held(&sinfo->lock); \
if (bytes < 0 && sinfo->name < -bytes) { \
WARN_ON(1); \
sinfo->name = 0; \
......
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