On Tue, Jun 7, 2016 at 7:43 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote: > On Tue, Jun 07, 2016 at 04:27:28PM +0800, Yan, Zheng wrote: >> If the file does not exist and the caller has no permission to create >> file, syscall open() should return -EACCESS. But on fuse mount of >> 4.7-rc2 kernel, open() return -ENOENT. > > Does the following fix your reproducer? > > diff --git a/fs/namei.c b/fs/namei.c > index d7c0cac..28cb1cd 100644 > --- a/fs/namei.c > +++ b/fs/namei.c > @@ -2995,9 +2995,13 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry, > } > if (*opened & FILE_CREATED) > fsnotify_create(dir, dentry); > - path->dentry = dentry; > - path->mnt = nd->path.mnt; > - return 1; > + if (unlikely(d_is_negative(dentry))) { > + error = -ENOENT; > + } else { > + path->dentry = dentry; > + path->mnt = nd->path.mnt; > + return 1; > + } > } > } > dput(dentry); Yes, it fixes the issue. Regards Yan, Zheng -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html