diff mbox series

[1/3] quota: Replace BUG_ON in dqput()

Message ID 20231027162343.28366-1-jack@suse.cz (mailing list archive)
State New, archived
Headers show
Series quota: Remove BUG_ONs from quota code | expand

Commit Message

Jan Kara Oct. 27, 2023, 4:23 p.m. UTC
The BUG_ON in dqput() will likely take the whole machine down when it
hits. Replace it with WARN_ON_ONCE() instead and stop hiding that behind
CONFIG_QUOTA_DEBUG.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/quota/dquot.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 31e897ad5e6a..c0d778363435 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -881,10 +881,7 @@  void dqput(struct dquot *dquot)
 	}
 
 	/* Need to release dquot? */
-#ifdef CONFIG_QUOTA_DEBUG
-	/* sanity check */
-	BUG_ON(!list_empty(&dquot->dq_free));
-#endif
+	WARN_ON_ONCE(!list_empty(&dquot->dq_free));
 	put_releasing_dquots(dquot);
 	atomic_dec(&dquot->dq_count);
 	spin_unlock(&dq_list_lock);