Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c08d0205 authored by Jan Kara's avatar Jan Kara Committed by Greg Kroah-Hartman
Browse files

quota: Remove BUG_ON from dqget()



[ Upstream commit 249f374eb9b6b969c64212dd860cc1439674c4a8 ]

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: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent cac7c9fc
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -985,9 +985,8 @@ struct dquot *dqget(struct super_block *sb, struct kqid qid)
	 * 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);