[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251216035518.4037331-44-viro@zeniv.linux.org.uk>
Date: Tue, 16 Dec 2025 03:55:02 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: linux-fsdevel@...r.kernel.org
Cc: torvalds@...ux-foundation.org,
brauner@...nel.org,
jack@...e.cz,
mjguzik@...il.com,
paul@...l-moore.com,
axboe@...nel.dk,
audit@...r.kernel.org,
io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH v3 43/59] do_f{chmod,chown,access}at(): use CLASS(filename_uflags)
Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
fs/open.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/open.c b/fs/open.c
index 34d9b1ecc141..3c7081694326 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -469,7 +469,6 @@ static int do_faccessat(int dfd, const char __user *filename, int mode, int flag
int res;
unsigned int lookup_flags = LOOKUP_FOLLOW;
const struct cred *old_cred = NULL;
- struct filename *name;
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
return -EINVAL;
@@ -486,7 +485,7 @@ static int do_faccessat(int dfd, const char __user *filename, int mode, int flag
return -ENOMEM;
}
- name = getname_uflags(filename, flags);
+ CLASS(filename_uflags, name)(filename, flags);
retry:
res = filename_lookup(dfd, name, lookup_flags, &path, NULL);
if (res)
@@ -528,7 +527,6 @@ static int do_faccessat(int dfd, const char __user *filename, int mode, int flag
goto retry;
}
out:
- putname(name);
if (old_cred)
put_cred(revert_creds(old_cred));
@@ -677,7 +675,6 @@ static int do_fchmodat(int dfd, const char __user *filename, umode_t mode,
unsigned int flags)
{
struct path path;
- struct filename *name;
int error;
unsigned int lookup_flags;
@@ -685,7 +682,7 @@ static int do_fchmodat(int dfd, const char __user *filename, umode_t mode,
return -EINVAL;
lookup_flags = (flags & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW;
- name = getname_uflags(filename, flags);
+ CLASS(filename_uflags, name)(filename, flags);
retry:
error = filename_lookup(dfd, name, lookup_flags, &path, NULL);
if (!error) {
@@ -696,7 +693,6 @@ static int do_fchmodat(int dfd, const char __user *filename, umode_t mode,
goto retry;
}
}
- putname(name);
return error;
}
--
2.47.3
Powered by blists - more mailing lists