From: Linus Torvalds Date: Mon, 24 Mar 2025 17:47:14 +0000 (-0700) Subject: Merge tag 'vfs-6.15-rc1.async.dir' of git://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Tag: v6.15-rc1~247 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26d8e430796e7e110c656e87be8d9d3d3a90a305;p=thirdparty%2Fkernel%2Flinux.git Merge tag 'vfs-6.15-rc1.async.dir' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs 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. --- 26d8e430796e7e110c656e87be8d9d3d3a90a305 diff --cc Documentation/filesystems/porting.rst index 12a71ba221b83,6817614e08208..767b2927c762d --- a/Documentation/filesystems/porting.rst +++ b/Documentation/filesystems/porting.rst @@@ -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.