aio: avoid pointless cred reference count bump

iocb->fsync.creds already holds a reference count that is stable while
the operation is performed.

Link: https://lore.kernel.org/r/20241125-work-cred-v2-10-68b9d38bb5b2@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Christian Brauner 2024-11-25 15:10:06 +01:00
parent 7c0c3b346a
commit b37eab47cf
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -1639,10 +1639,10 @@ static int aio_write(struct kiocb *req, const struct iocb *iocb,
static void aio_fsync_work(struct work_struct *work)
{
struct aio_kiocb *iocb = container_of(work, struct aio_kiocb, fsync.work);
const struct cred *old_cred = override_creds(get_new_cred(iocb->fsync.creds));
const struct cred *old_cred = override_creds(iocb->fsync.creds);
iocb->ki_res.res = vfs_fsync(iocb->fsync.file, iocb->fsync.datasync);
put_cred(revert_creds(old_cred));
revert_creds(old_cred);
put_cred(iocb->fsync.creds);
iocb_put(iocb);
}