Patch "quota: Remove BUG_ON from dqget()" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    quota: Remove BUG_ON from dqget()

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     quota-remove-bug_on-from-dqget.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 448b8073ccc7f612b73723048ec226be5f70fe06
Author: Jan Kara <jack@xxxxxxx>
Date:   Fri Oct 20 13:34:08 2023 +0200

    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: Jan Kara <jack@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index a7ddb874912d4..14c0dd5b65a43 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -986,9 +986,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);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux