Skip to content

Commit 249f374

Browse files
committed
quota: Remove BUG_ON from dqget()
dqget() checks whether dquot->dq_sb is set when returning it using BUG_ON. Firstly this doesn't work as an invalidation check for quite some time (we release dquot with dq_sb set these days), secondly using BUG_ON is quite harsh. Use WARN_ON_ONCE and check whether dquot is still hashed instead. Signed-off-by: Jan Kara <[email protected]>
1 parent d44c576 commit 249f374

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/quota/dquot.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -984,9 +984,8 @@ struct dquot *dqget(struct super_block *sb, struct kqid qid)
984984
* smp_mb__before_atomic() in dquot_acquire().
985985
*/
986986
smp_rmb();
987-
#ifdef CONFIG_QUOTA_DEBUG
988-
BUG_ON(!dquot->dq_sb); /* Has somebody invalidated entry under us? */
989-
#endif
987+
/* Has somebody invalidated entry under us? */
988+
WARN_ON_ONCE(hlist_unhashed(&dquot->dq_hash));
990989
out:
991990
if (empty)
992991
do_destroy_dquot(empty);

0 commit comments

Comments
 (0)