Re: [fuse-devel] Cross-host entry caching and file open/create

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 20, 2020 at 12:24 AM Ken Schalk <kschalk@xxxxxxxxxx> wrote:
>

> If the open flags include O_EXCL, then we're seeing a failure with
> EEXIST without any call to our FUSE filesystem's create operation (or
> any other FUSE operations).  The kernel makes this failure decision
> based on its cached information about the previously accessed (now
> deleted) file.  If the open flags do not include O_EXCL, then we're
> seeing a failure with ENOENT from our open operation (because the file
> does not actually exist anymore), with no call to our create operation
> (because the kernel believed that the file existed, causing it to make
> a FUSE open request rather than a FUSE create request).

Does the attached patch fix it?

Thanks,
Miklos
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 26f028bc760b..ec5552ff9826 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -204,7 +204,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
 	if (inode && is_bad_inode(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;

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux