summaryrefslogtreecommitdiffstats
path: root/fs/quota
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2023-10-20 13:34:08 +0200
committerJan Kara <jack@suse.cz>2024-01-22 12:56:20 +0100
commit249f374eb9b6b969c64212dd860cc1439674c4a8 (patch)
tree02514df42f9709b99575b0828f49b1fbb5b7186a /fs/quota
parentd44c576637238d2dafdd22dc856f0cb2a1553049 (diff)
downloadlinux-249f374eb9b6b969c64212dd860cc1439674c4a8.tar.gz
linux-249f374eb9b6b969c64212dd860cc1439674c4a8.tar.bz2
linux-249f374eb9b6b969c64212dd860cc1439674c4a8.zip
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 <jack@suse.cz>
Diffstat (limited to 'fs/quota')
-rw-r--r--fs/quota/dquot.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 85edbbafaaa4..5f5481c43d98 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -984,9 +984,8 @@ we_slept:
* smp_mb__before_atomic() in dquot_acquire().
*/
smp_rmb();
-#ifdef CONFIG_QUOTA_DEBUG
- BUG_ON(!dquot->dq_sb); /* Has somebody invalidated entry under us? */
-#endif
+ /* Has somebody invalidated entry under us? */
+ WARN_ON_ONCE(hlist_unhashed(&dquot->dq_hash));
out:
if (empty)
do_destroy_dquot(empty);