Patch "fs/dcache: Re-use value stored to dentry->d_flags instead of re-reading" has been added to the 6.1-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

    fs/dcache: Re-use value stored to dentry->d_flags instead of re-reading

to the 6.1-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:
     fs-dcache-re-use-value-stored-to-dentry-d_flags-inst.patch
and it can be found in the queue-6.1 subdirectory.

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



commit f523a86638773d00989770c97854689f6d7909f3
Author: linke li <lilinke99@xxxxxx>
Date:   Wed Apr 3 10:10:08 2024 +0800

    fs/dcache: Re-use value stored to dentry->d_flags instead of re-reading
    
    [ Upstream commit 8bfb40be31ddea0cb4664b352e1797cfe6c91976 ]
    
    Currently, the __d_clear_type_and_inode() writes the value flags to
    dentry->d_flags, then immediately re-reads it in order to use it in a if
    statement. This re-read is useless because no other update to
    dentry->d_flags can occur at this point.
    
    This commit therefore re-use flags in the if statement instead of
    re-reading dentry->d_flags.
    
    Signed-off-by: linke li <lilinke99@xxxxxx>
    Link: https://lore.kernel.org/r/tencent_5E187BD0A61BA28605E85405F15228254D0A@xxxxxx
    Reviewed-by: Jan Kara <jack@xxxxxxx>
    Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
    Stable-dep-of: aabfe57ebaa7 ("vfs: don't mod negative dentry count when on shrinker list")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/dcache.c b/fs/dcache.c
index b09bc88dbbec7..9b10f1872f6c9 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -356,7 +356,7 @@ static inline void __d_clear_type_and_inode(struct dentry *dentry)
 	flags &= ~(DCACHE_ENTRY_TYPE | DCACHE_FALLTHRU);
 	WRITE_ONCE(dentry->d_flags, flags);
 	dentry->d_inode = NULL;
-	if (dentry->d_flags & DCACHE_LRU_LIST)
+	if (flags & DCACHE_LRU_LIST)
 		this_cpu_inc(nr_dentry_negative);
 }
 




[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