fuse: always revalidate if exclusive create
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 11 Nov 2020 16:22:32 +0000 (17:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Dec 2022 11:27:31 +0000 (12:27 +0100)
commit17f386e6b7695afdb10474431dfd754c92feaedd
tree4c1ef601faf4e18593ae6f165b17707b4d0b01b0
parenteb6313c12955c58c3d3d40f086c22e44ca1c9a1b
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>
fs/fuse/dir.c