summaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorHao Li <lihao2018.fnst@cn.fujitsu.com>2020-12-08 05:10:50 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2020-12-11 01:33:17 +0300
commit77573fa310d95e4293efdec98dace74cd9e52f43 (patch)
treea7a12a6a10ef23409c6d213179d5ac3afad8d6ae /fs/namei.c
parent88149082bb8ef31b289673669e080ec6a00c2e59 (diff)
downloadlinux-77573fa310d95e4293efdec98dace74cd9e52f43.tar.xz
fs: Kill DCACHE_DONTCACHE dentry even if DCACHE_REFERENCED is set
If DCACHE_REFERENCED is set, fast_dput() will return true, and then retain_dentry() have no chance to check DCACHE_DONTCACHE. As a result, the dentry won't be killed and the corresponding inode can't be evicted. In the following example, the DAX policy can't take effects unless we do a drop_caches manually. # DCACHE_LRU_LIST will be set echo abcdefg > test.txt # DCACHE_REFERENCED will be set and DCACHE_DONTCACHE can't do anything xfs_io -c 'chattr +x' test.txt # Drop caches to make DAX changing take effects echo 2 > /proc/sys/vm/drop_caches What this patch does is preventing fast_dput() from returning true if DCACHE_DONTCACHE is set. Then retain_dentry() will detect the DCACHE_DONTCACHE and will return false. As a result, the dentry will be killed and the inode will be evicted. In this way, if we change per-file DAX policy, it will take effects automatically after this file is closed by all processes. I also add some comments to make the code more clear. Signed-off-by: Hao Li <lihao2018.fnst@cn.fujitsu.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
0 files changed, 0 insertions, 0 deletions