quota: Replace BUG_ON in dqput()
authorJan Kara <jack@suse.cz>
Fri, 20 Oct 2023 11:21:24 +0000 (13:21 +0200)
committerJan Kara <jack@suse.cz>
Mon, 22 Jan 2024 11:56:20 +0000 (12:56 +0100)
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

index 1f0c754..d863d6b 100644 (file)
@@ -875,10 +875,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);