diff mbox series

btrfs: use WARN_ON_ONCE in btrfs_destroy_inode

Message ID 20230720135047.60686-1-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series btrfs: use WARN_ON_ONCE in btrfs_destroy_inode | expand

Commit Message

Christoph Hellwig July 20, 2023, 1:50 p.m. UTC
When a condition in btrfs_destroy_inode is tends to triggers for many
inodes during unmount.  Switch to WARN_ON_ONCE to reduce the log spam.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/btrfs/inode.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 02cf05dd730ade..c5464507271dac 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8434,17 +8434,17 @@  void btrfs_destroy_inode(struct inode *vfs_inode)
 	struct btrfs_root *root = inode->root;
 	bool freespace_inode;
 
-	WARN_ON(!hlist_empty(&vfs_inode->i_dentry));
-	WARN_ON(vfs_inode->i_data.nrpages);
-	WARN_ON(inode->block_rsv.reserved);
-	WARN_ON(inode->block_rsv.size);
-	WARN_ON(inode->outstanding_extents);
+	WARN_ON_ONCE(!hlist_empty(&vfs_inode->i_dentry));
+	WARN_ON_ONCE(vfs_inode->i_data.nrpages);
+	WARN_ON_ONCE(inode->block_rsv.reserved);
+	WARN_ON_ONCE(inode->block_rsv.size);
+	WARN_ON_ONCE(inode->outstanding_extents);
 	if (!S_ISDIR(vfs_inode->i_mode)) {
-		WARN_ON(inode->delalloc_bytes);
-		WARN_ON(inode->new_delalloc_bytes);
+		WARN_ON_ONCE(inode->delalloc_bytes);
+		WARN_ON_ONCE(inode->new_delalloc_bytes);
 	}
-	WARN_ON(inode->csum_bytes);
-	WARN_ON(inode->defrag_bytes);
+	WARN_ON_ONCE(inode->csum_bytes);
+	WARN_ON_ONCE(inode->defrag_bytes);
 
 	/*
 	 * This can happen where we create an inode, but somebody else also