VFS: change kern_path_locked() and user_path_locked_at() to never return negative...
authorNeilBrown <neilb@suse.de>
Mon, 17 Feb 2025 00:27:20 +0000 (11:27 +1100)
committerChristian Brauner <brauner@kernel.org>
Wed, 19 Feb 2025 13:08:41 +0000 (14:08 +0100)
commit1c3cb50b58c30e37d88d0b46aa093ce331f4678d
treea5c6adcfb739c2d2fc23c182197c3a20a2964f61
parent2c3230fb8db9bf04d97a907f2fb86adb1e74e431
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>
Documentation/filesystems/porting.rst
drivers/base/devtmpfs.c
fs/bcachefs/fs-ioctl.c
fs/namei.c
kernel/audit_watch.c