[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241124-work-cred-v1-13-f352241c3970@kernel.org>
Date: Sun, 24 Nov 2024 14:43:59 +0100
From: Christian Brauner <brauner@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Christian Brauner <brauner@...nel.org>,
Amir Goldstein <amir73il@...il.com>,
Miklos Szeredi <miklos@...redi.hu>,
linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: [PATCH 13/26] nfs/localio: avoid pointless cred reference count bumps
No need for the extra reference count bump.
Signed-off-by: Christian Brauner <brauner@...nel.org>
---
fs/nfs/localio.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c
index cb0ba4a810324cc9a4913767ce5a9b4f52c416ac..8f0ce82a677e1589092a30240d6e60a289d64a58 100644
--- a/fs/nfs/localio.c
+++ b/fs/nfs/localio.c
@@ -371,7 +371,7 @@ static void nfs_local_call_read(struct work_struct *work)
struct iov_iter iter;
ssize_t status;
- save_cred = override_creds(get_new_cred(filp->f_cred));
+ save_cred = override_creds(filp->f_cred);
nfs_local_iter_init(&iter, iocb, READ);
@@ -381,7 +381,7 @@ static void nfs_local_call_read(struct work_struct *work)
nfs_local_read_done(iocb, status);
nfs_local_pgio_release(iocb);
- put_cred(revert_creds(save_cred));
+ revert_creds(save_cred);
}
static int
@@ -541,7 +541,7 @@ static void nfs_local_call_write(struct work_struct *work)
ssize_t status;
current->flags |= PF_LOCAL_THROTTLE | PF_MEMALLOC_NOIO;
- save_cred = override_creds(get_new_cred(filp->f_cred));
+ save_cred = override_creds(filp->f_cred);
nfs_local_iter_init(&iter, iocb, WRITE);
@@ -554,7 +554,7 @@ static void nfs_local_call_write(struct work_struct *work)
nfs_local_vfs_getattr(iocb);
nfs_local_pgio_release(iocb);
- put_cred(revert_creds(save_cred));
+ revert_creds(save_cred);
current->flags = old_flags;
}
--
2.45.2
Powered by blists - more mailing lists