Skip to content

Commit 3e23a1c

Browse files
committed
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. Link: https://lore.kernel.org/r/[email protected] Acked-by: Chuck Lever <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Reviewed-by: Jens Axboe <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 6c7a0a6 commit 3e23a1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/nfs/nfs4idmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,9 @@ static ssize_t nfs_idmap_get_key(const char *name, size_t namelen,
311311
const struct user_key_payload *payload;
312312
ssize_t ret;
313313

314-
saved_cred = override_creds(get_new_cred(id_resolver_cache));
314+
saved_cred = override_creds(id_resolver_cache);
315315
rkey = nfs_idmap_request_key(name, namelen, type, idmap);
316-
put_cred(revert_creds(saved_cred));
316+
revert_creds(saved_cred);
317317

318318
if (IS_ERR(rkey)) {
319319
ret = PTR_ERR(rkey);

0 commit comments

Comments
 (0)