[PATCH v4 34/59] mount_setattr(2): don't mess with LOOKUP_EMPTY

Al Viro
2026-01-08T07:36:55Z

just use CLASS(filename_uflags) + filename_lookup()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/namespace.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 9d0d8ed16264..d632180f9b1a 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -4978,8 +4978,6 @@ SYSCALL_DEFINE5(mount_setattr, int, dfd, const char __user *, path,
lookup_flags &= ~LOOKUP_AUTOMOUNT;
if (flags & AT_SYMLINK_NOFOLLOW)
lookup_flags &= ~LOOKUP_FOLLOW;
- if (flags & AT_EMPTY_PATH)
- lookup_flags |= LOOKUP_EMPTY;

kattr = (struct mount_kattr) {
.lookup_flags = lookup_flags,
@@ -4992,7 +4990,8 @@ SYSCALL_DEFINE5(mount_setattr, int, dfd, const char __user *, path,
if (err <= 0)
return err;

- err = user_path_at(dfd, path, kattr.lookup_flags, &target);
+ CLASS(filename_uflags, name)(path, flags);
+ err = filename_lookup(dfd, name, kattr.lookup_flags, &target, NULL);
if (!err) {
err = do_mount_setattr(&target, &kattr);
path_put(&target);
--
2.47.3