All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: "Yan, Zheng" <ukernel@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, mszeredi@redhat.com
Subject: Re: commit 1643b43fbd breaks open(.., O_RDONLY|O_CREAT, ...) on fuse.
Date: Tue, 7 Jun 2016 12:43:33 +0100	[thread overview]
Message-ID: <20160607114333.GO14480@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CAAM7YAnYk=L1WrDASCwbPQ_S+Aha6YiHM1hk7EwG4rXykWHFuQ@mail.gmail.com>

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);

  reply	other threads:[~2016-06-07 11:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07  8:27 commit 1643b43fbd breaks open(.., O_RDONLY|O_CREAT, ...) on fuse Yan, Zheng
2016-06-07 11:43 ` Al Viro [this message]
2016-06-07 13:18   ` Yan, Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160607114333.GO14480@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=ukernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.