linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs: extent-tree: Add lockdep assert when updating space info
@ 2019-04-29  6:03 Qu Wenruo
  2019-04-29  6:03 ` [PATCH 2/2] btrfs: extent-tree: Add trace events for space info numbers update Qu Wenruo
  0 siblings, 1 reply; 3+ messages in thread
From: Qu Wenruo @ 2019-04-29  6:03 UTC (permalink / raw)
  To: linux-btrfs

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(+)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-09 10:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29  6:03 [PATCH 1/2] btrfs: extent-tree: Add lockdep assert when updating space info Qu Wenruo
2019-04-29  6:03 ` [PATCH 2/2] btrfs: extent-tree: Add trace events for space info numbers update Qu Wenruo
2019-05-09 10:42   ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).