All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7 RFC] fixes for vfs_lookup_open, and integration with nfsd
@ 2026-09-10  0:20 NeilBrown
  2026-09-10  0:20 ` [PATCH 1/7] vfs: add some allowed open flags to vfs_lookup_open() NeilBrown
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: NeilBrown @ 2026-09-10  0:20 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Chuck Lever, Jeff Layton
  Cc: linux-fsdevel, linux-nfs

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-09-10 15:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-10  0:20 [PATCH 0/7 RFC] fixes for vfs_lookup_open, and integration with nfsd NeilBrown
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

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.