[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241125-work-cred-v2-14-68b9d38bb5b2@kernel.org>
Date: Mon, 25 Nov 2024 15:10:10 +0100
From: Christian Brauner <brauner@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Amir Goldstein <amir73il@...il.com>, Miklos Szeredi <miklos@...redi.hu>,
Al Viro <viro@...iv.linux.org.uk>, Jens Axboe <axboe@...nel.dk>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Christian Brauner <brauner@...nel.org>
Subject: [PATCH v2 14/29] nfs/nfs4idmap: avoid pointless reference count
bump
The override creds are allocated with a long-term refernce when the
id_resolver is initialized via prepare_kernel_creds() that is put when
the id_resolver is destroyed.
Signed-off-by: Christian Brauner <brauner@...nel.org>
---
fs/nfs/nfs4idmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c
index 25b6a8920a6545d43f437f2f0330ccc35380ccc3..25a7c771cfd89f3e6d494f26a78212d3d619c135 100644
--- a/fs/nfs/nfs4idmap.c
+++ b/fs/nfs/nfs4idmap.c
@@ -311,9 +311,9 @@ static ssize_t nfs_idmap_get_key(const char *name, size_t namelen,
const struct user_key_payload *payload;
ssize_t ret;
- saved_cred = override_creds(get_new_cred(id_resolver_cache));
+ saved_cred = override_creds(id_resolver_cache);
rkey = nfs_idmap_request_key(name, namelen, type, idmap);
- put_cred(revert_creds(saved_cred));
+ revert_creds(saved_cred);
if (IS_ERR(rkey)) {
ret = PTR_ERR(rkey);
--
2.45.2
Powered by blists - more mailing lists