]> www.infradead.org Git - users/hch/misc.git/commit
fs/9p: Refresh metadata in d_revalidate for uncached mode too
authorTingmao Wang <m@maowtm.org>
Sun, 6 Apr 2025 16:18:42 +0000 (17:18 +0100)
committerDominique Martinet <asmadeus@codewreck.org>
Sat, 23 Aug 2025 06:34:46 +0000 (15:34 +0900)
commit290434474c332a2ba9c8499fe699c7f2e1153280
tree831cec0eafb237ac24cbb6a38b9e48d410f84875
parent8f5ae30d69d7543eee0d70083daf4de8fe15d585
fs/9p: Refresh metadata in d_revalidate for uncached mode too

Currently if another process keeps a file open, due to existing dentry in
the dcache, other processes will not see updated metadata of that file if
it is changed on the server, even in uncached mode.

This can also manifest as -ENODATA when reading a file that has shrunk on
the server (even if it's re-opened in another process), or -ENOTSUPP if
the file has changed type (e.g. regular file to directory) on the server.
We can end up in a situation where both `readdir` or `read` fails until
the file is closed by all processes using it.

This commit fixes that, and invalidates the dentry altogether if the inode
type is changed (for uncached mode).

Signed-off-by: Tingmao Wang <m@maowtm.org>
Message-ID: <bfac417f65cc1d6812be822f8913f0d4ba0c1052.1743956147.git.m@maowtm.org>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
fs/9p/vfs_dentry.c
fs/9p/vfs_inode.c
fs/9p/vfs_inode_dotl.c