Merge tag 'vfs-6.15-rc1.async.dir' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Mar 2025 17:47:14 +0000 (10:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Mar 2025 17:47:14 +0000 (10:47 -0700)
Pull vfs async dir updates from Christian Brauner:
 "This contains cleanups that fell out of the work from async directory
  handling:

   - Change kern_path_locked() and user_path_locked_at() to never return
     a negative dentry. This simplifies the usability of these helpers
     in various places

   - Drop d_exact_alias() from the remaining place in NFS where it is
     still used. This also allows us to drop the d_exact_alias() helper
     completely

   - Drop an unnecessary call to fh_update() from nfsd_create_locked()

   - Change i_op->mkdir() to return a struct dentry

     Change vfs_mkdir() to return a dentry provided by the filesystems
     which is hashed and positive. This allows us to reduce the number
     of cases where the resulting dentry is not positive to very few
     cases. The code in these places becomes simpler and easier to
     understand.

   - Repack DENTRY_* and LOOKUP_* flags"

* tag 'vfs-6.15-rc1.async.dir' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  doc: fix inline emphasis warning
  VFS: Change vfs_mkdir() to return the dentry.
  nfs: change mkdir inode_operation to return alternate dentry if needed.
  fuse: return correct dentry for ->mkdir
  ceph: return the correct dentry on mkdir
  hostfs: store inode in dentry after mkdir if possible.
  Change inode_operations.mkdir to return struct dentry *
  nfsd: drop fh_update() from S_IFDIR branch of nfsd_create_locked()
  nfs/vfs: discard d_exact_alias()
  VFS: add common error checks to lookup_one_qstr_excl()
  VFS: change kern_path_locked() and user_path_locked_at() to never return negative dentry
  VFS: repack LOOKUP_ bit flags.
  VFS: repack DENTRY_ flags.

1  2 
Documentation/filesystems/porting.rst
drivers/base/devtmpfs.c
fs/btrfs/inode.c
fs/dcache.c
fs/exfat/namei.c
fs/fuse/dir.c
fs/namei.c
fs/nfs/nfs4proc.c
fs/overlayfs/super.c
include/linux/fs.h
mm/shmem.c

index 12a71ba221b83af20e04a5f3153a9b680ce6ede4,6817614e08208acafbaaa3de771dab4e65398708..767b2927c762d7bec6cc374ced59920abfb8ca16
@@@ -1144,7 -1144,7 +1144,7 @@@ and it *must* be opened exclusive
  
  ---
  
--** mandatory**
++**mandatory**
  
  ->d_revalidate() gets two extra arguments - inode of parent directory and
  name our dentry is expected to have.  Both are stable (dir is pinned in
@@@ -1160,5 -1160,39 +1160,46 @@@ magic
  
  ---
  
- ** mandatory **
 -** recommended**
++**recommended**
+ kern_path_locked() and user_path_locked() no longer return a negative
+ dentry so this doesn't need to be checked.  If the name cannot be found,
+ ERR_PTR(-ENOENT) is returned.
 -** recommend**
++---
++
++**recommended**
+ lookup_one_qstr_excl() is changed to return errors in more cases, so
+ these conditions don't require explicit checks:
+  - if LOOKUP_CREATE is NOT given, then the dentry won't be negative,
+    ERR_PTR(-ENOENT) is returned instead
+  - if LOOKUP_EXCL IS given, then the dentry won't be positive,
+    ERR_PTR(-EEXIST) is rreturned instread
+ LOOKUP_EXCL now means "target must not exist".  It can be combined with
+ LOOK_CREATE or LOOKUP_RENAME_TARGET.
+ ---
 -** mandatory**
++**mandatory**
 +invalidate_inodes() is gone use evict_inodes() instead.
++
++---
++
++**mandatory**
+ ->mkdir() now returns a dentry.  If the created inode is found to
+ already be in cache and have a dentry (often IS_ROOT()), it will need to
+ be spliced into the given name in place of the given dentry. That dentry
+ now needs to be returned.  If the original dentry is used, NULL should
+ be returned.  Any error should be returned with ERR_PTR().
+ In general, filesystems which use d_instantiate_new() to install the new
+ inode can safely return NULL.  Filesystems which may not have an I_NEW inode
+ should use d_drop();d_splice_alias() and return the result of the latter.
+ If a positive dentry cannot be returned for some reason, in-kernel
+ clients such as cachefiles, nfsd, smb/server may not perform ideally but
+ will fail-safe.
Simple merge
Simple merge
diff --cc fs/dcache.c
Simple merge
Simple merge
diff --cc fs/fuse/dir.c
Simple merge
diff --cc fs/namei.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc mm/shmem.c
Simple merge