From: NeilBrown <neilb@ownmail.net>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
Chuck Lever <cel@kernel.org>, Jeff Layton <jlayton@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: [PATCH 0/7 RFC] fixes for vfs_lookup_open, and integration with nfsd
Date: Thu, 10 Sep 2026 10:20:46 +1000 [thread overview]
Message-ID: <20260910002934.192979-1-neilb@ownmail.net> (raw)
I've been looking at the problems Chuck and Jeff found with my
vfs_lookup_open() work for opening files in nfsd and think the following
patches address the issues.
I have labeled this an RFC because:
1/ Patch 2/7 changes user-visible behaviour - in a good way I think.
Currently O_NONBLOCK avoids waiting for a leases but doesn't
avoid waiting for a directory delegation. I think it should do both.
2/ vfs_lookup_open() is changed to update the 'dentry' in the path arg
to report what was found. On success this is identical to the
returned file->f_path.dentry. On -EFTYPE failure it is useful
to report the actual type to the NFS client as required.
As an aside - what would people think of changing ->atomic_open
functions to *not* return -EFTYPE. If they find a non-regular file they
should use finish_no_open() and let the caller decide if a non-regular
is an error. ->atomic_open can still honour O_DIRECTORY if a network
filesystem does that some special way, but if it find a non-regular when
O_DIRECTORY wasn't requested, it is best to report what it found and let
others deal with it. As it is we need an extra d_lookup() in
vfs_lookup_open() to find the dentry that ->atomic_open refused to
return.
Or maybe we shouldn't pass __O_REGULAR because that only affects "open",
and lookup_open() doesn't even try to open non-regular files.
I'm keen to read your thoughts on the above.
Thanks,
NeilBrown
[PATCH 1/7] vfs: add some allowed open flags to vfs_lookup_open()
[PATCH 2/7] vfs: O_NONBLOCK|O_CREAT open shouldn't wait for directory
[PATCH 3/7] vfs: vfs_lookup_open() should only return -EFTYPE for
[PATCH 4/7] vfs: change vfs_lookup_open() to return found dentry in
[PATCH 5/7] nfsd: switch NFS4 OPEN to use vfs_lookup_open()
[PATCH 6/7] nfsd: nfsd_check_obj_isreg() to use nfs error codes.
[PATCH 7/7] nfsd: use vfs_lookup_open() for non-creating open
next reply other threads:[~2026-09-10 0:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 0:20 NeilBrown [this message]
2026-09-10 0:20 ` [PATCH 1/7] vfs: add some allowed open flags to vfs_lookup_open() NeilBrown
2026-09-10 0:20 ` [PATCH 2/7] vfs: O_NONBLOCK|O_CREAT open shouldn't wait for directory delegation NeilBrown
2026-09-10 0:20 ` [PATCH 3/7] vfs: vfs_lookup_open() should only return -EFTYPE for non-regular files NeilBrown
2026-09-10 0:20 ` [PATCH 4/7] vfs: change vfs_lookup_open() to return found dentry in path.dentry NeilBrown
2026-09-10 0:39 ` NeilBrown
2026-09-10 15:13 ` Chuck Lever
2026-09-10 0:20 ` [PATCH 5/7] nfsd: switch NFS4 OPEN to use vfs_lookup_open() NeilBrown
2026-09-10 15:41 ` Chuck Lever
2026-09-10 0:20 ` [PATCH 6/7] nfsd: nfsd_check_obj_isreg() to use nfs error codes NeilBrown
2026-09-10 0:20 ` [PATCH 7/7] nfsd: use vfs_lookup_open() for non-creating open requests too NeilBrown
2026-09-10 15:47 ` Chuck Lever
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=20260910002934.192979-1-neilb@ownmail.net \
--to=neilb@ownmail.net \
--cc=brauner@kernel.org \
--cc=cel@kernel.org \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=viro@zeniv.linux.org.uk \
/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.