diff options
author | NeilBrown <neilb@suse.de> | 2025-02-17 03:27:20 +0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2025-02-19 16:08:41 +0300 |
commit | 1c3cb50b58c30e37d88d0b46aa093ce331f4678d (patch) | |
tree | a5c6adcfb739c2d2fc23c182197c3a20a2964f61 /Documentation/filesystems | |
parent | 2c3230fb8db9bf04d97a907f2fb86adb1e74e431 (diff) | |
download | linux-1c3cb50b58c30e37d88d0b46aa093ce331f4678d.tar.xz |
VFS: change kern_path_locked() and user_path_locked_at() to never return negative dentry
No callers of kern_path_locked() or user_path_locked_at() want a
negative dentry. So change them to return -ENOENT instead. This
simplifies callers.
This results in a subtle change to bcachefs in that an ioctl will now
return -ENOENT in preference to -EXDEV. I believe this restores the
behaviour to what it was prior to
Commit bbe6a7c899e7 ("bch2_ioctl_subvolume_destroy(): fix locking")
Signed-off-by: NeilBrown <neilb@suse.de>
Link: https://lore.kernel.org/r/20250217003020.3170652-2-neilb@suse.de
Acked-by: Paul Moore <paul@paul-moore.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r-- | Documentation/filesystems/porting.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/filesystems/porting.rst b/Documentation/filesystems/porting.rst index 1639e78e3146..2ead47e20677 100644 --- a/Documentation/filesystems/porting.rst +++ b/Documentation/filesystems/porting.rst @@ -1157,3 +1157,11 @@ in normal case it points into the pathname being looked up. NOTE: if you need something like full path from the root of filesystem, you are still on your own - this assists with simple cases, but it's not magic. + +--- + +** 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. |