Skip to content

Commit b37eab4

Browse files
committed
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/[email protected] Reviewed-by: Jeff Layton <[email protected]> Reviewed-by: Jens Axboe <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 7c0c3b3 commit b37eab4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/aio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,10 +1639,10 @@ static int aio_write(struct kiocb *req, const struct iocb *iocb,
16391639
static void aio_fsync_work(struct work_struct *work)
16401640
{
16411641
struct aio_kiocb *iocb = container_of(work, struct aio_kiocb, fsync.work);
1642-
const struct cred *old_cred = override_creds(get_new_cred(iocb->fsync.creds));
1642+
const struct cred *old_cred = override_creds(iocb->fsync.creds);
16431643

16441644
iocb->ki_res.res = vfs_fsync(iocb->fsync.file, iocb->fsync.datasync);
1645-
put_cred(revert_creds(old_cred));
1645+
revert_creds(old_cred);
16461646
put_cred(iocb->fsync.creds);
16471647
iocb_put(iocb);
16481648
}

0 commit comments

Comments
 (0)