]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
9p: don't bother with always_delete_dentry
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 24 Feb 2025 03:19:07 +0000 (22:19 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 11 Jun 2025 17:41:05 +0000 (13:41 -0400)
just set DCACHE_DONTCACHE for "don't cache" mounts...

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/9p/vfs_dentry.c
fs/9p/vfs_super.c

index 5061f192eafdaf6c73b59bbe7039fc7597c54b24..04795508a7957125f89b5587bd9f8c71f6da276c 100644 (file)
@@ -127,7 +127,6 @@ const struct dentry_operations v9fs_cached_dentry_operations = {
 };
 
 const struct dentry_operations v9fs_dentry_operations = {
-       .d_delete = always_delete_dentry,
        .d_release = v9fs_dentry_release,
        .d_unalias_trylock = v9fs_dentry_unalias_trylock,
        .d_unalias_unlock = v9fs_dentry_unalias_unlock,
index 5c3dc3efb90930e0fc05ee2b95d4fe8942025057..795c6388744cdb73d6fce6ceb6e5cbb2d87743c8 100644 (file)
@@ -134,10 +134,12 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
        if (retval)
                goto release_sb;
 
-       if (v9ses->cache & (CACHE_META|CACHE_LOOSE))
+       if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) {
                set_default_d_op(sb, &v9fs_cached_dentry_operations);
-       else
+       } else {
                set_default_d_op(sb, &v9fs_dentry_operations);
+               sb->s_d_flags |= DCACHE_DONTCACHE;
+       }
 
        inode = v9fs_get_new_inode_from_fid(v9ses, fid, sb);
        if (IS_ERR(inode)) {