All of lore.kernel.org
 help / color / mirror / Atom feed
* VFS: change ->atomic_open() calling to always have exclusive access
@ 2025-09-15  3:01 NeilBrown
  2025-09-15  3:01 ` [PATCH 1/2] NFS: remove d_drop()/d_alloc_paralle() from nfs_atomic_open() NeilBrown
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: NeilBrown @ 2025-09-15  3:01 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Trond Myklebust,
	Anna Schumaker
  Cc: linux-nfs, linux-fsdevel, Jeff Layton, Amir Goldstein, Jan Kara

->atomic_open() is called with only a shared lock on the directory when
O_CREAT wasn't requested.  If the dentry is negative it is still called
because the filesystem might want to revalidate-and-open in an atomic
operations.  NFS does this to fullfil close-to-open consistency
requirements.

NFS has complex code to drop the dentry and reallocate with
d_alloc_parallel() in this case to ensure that only one lookup/open
happens at a time.  It would be simpler to have NFS return zero from
->d_revalidate in this case so that d_alloc_parallel() will be calling
in lookup_open() and NFS wan't need to worry about concurrency.

So this series makes that change to NFS to simplify atomic_open and remove
the d_drop() and d_alloc_parallel(), and then changes lookup_open() so that
atomic_open() can never be called without exclusive access to the dentry.

NeilBrown

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

end of thread, other threads:[~2025-09-17  7:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-15  3:01 VFS: change ->atomic_open() calling to always have exclusive access NeilBrown
2025-09-15  3:01 ` [PATCH 1/2] NFS: remove d_drop()/d_alloc_paralle() from nfs_atomic_open() NeilBrown
2025-09-15  3:01 ` [PATCH 2/2] VFS: don't call ->atomic_open on cached negative without O_CREAT NeilBrown
2025-09-17  4:23   ` Al Viro
2025-09-17  7:36     ` NeilBrown
2025-09-17  4:34 ` VFS: change ->atomic_open() calling to always have exclusive access Al Viro
2025-09-17  7:25   ` NeilBrown

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.