diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2020-11-11 17:22:32 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-12-19 12:27:31 +0100 |
commit | 17f386e6b7695afdb10474431dfd754c92feaedd (patch) | |
tree | 4c1ef601faf4e18593ae6f165b17707b4d0b01b0 | |
parent | eb6313c12955c58c3d3d40f086c22e44ca1c9a1b (diff) | |
download | linux-stable-17f386e6b7695afdb10474431dfd754c92feaedd.tar.gz linux-stable-17f386e6b7695afdb10474431dfd754c92feaedd.tar.bz2 linux-stable-17f386e6b7695afdb10474431dfd754c92feaedd.zip |
fuse: always revalidate if exclusive create
commit df8629af293493757beccac2d3168fe5a315636e upstream.
Failure to do so may result in EEXIST even if the file only exists in the
cache and not in the filesystem.
The atomic nature of O_EXCL mandates that the cached state should be
ignored and existence verified anew.
Reported-by: Ken Schalk <kschalk@nvidia.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Wu Bo <bo.wu@vivo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/fuse/dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 8e95a75a4559..80a9e50392a0 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -205,7 +205,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) if (inode && fuse_is_bad(inode)) goto invalid; else if (time_before64(fuse_dentry_time(entry), get_jiffies_64()) || - (flags & LOOKUP_REVAL)) { + (flags & (LOOKUP_EXCL | LOOKUP_REVAL))) { struct fuse_entry_out outarg; FUSE_ARGS(args); struct fuse_forget_link *forget; |