Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;					\