Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Qu Wenruo and committed by
David Sterba
0185f364 cff82672

+1
+1
fs/btrfs/extent-tree.c
··· 58 58 static inline void update_##name(struct btrfs_space_info *sinfo, \ 59 59 s64 bytes) \ 60 60 { \ 61 + lockdep_assert_held(&sinfo->lock); \ 61 62 if (bytes < 0 && sinfo->name < -bytes) { \ 62 63 WARN_ON(1); \ 63 64 sinfo->name = 0; \