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

Just add a safe net for btrfs_space_info member updating.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2019-04-29 14:03:32 +08:00 committed by David Sterba
parent cff8267228
commit 0185f364cb

View File

@ -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; \