[1/2] btrfs: extent-tree: Add lockdep assert when updating space info
diff mbox series

Message ID 20190429060333.24172-1-wqu@suse.com
State New
Headers show
Series
  • [1/2] btrfs: extent-tree: Add lockdep assert when updating space info
Related show

Commit Message

Qu Wenruo April 29, 2019, 6:03 a.m. UTC
Just add a safe net for btrfs_space_info member updating.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/extent-tree.c | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox series

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 7a924eac3bd3..54c853ea0585 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -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;					\