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;