Skip to content

Commit 6256d23

Browse files
committed
acct: avoid pointless reference count bump
file->f_cred already holds a reference count that is stable during the operation. 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 b690668 commit 6256d23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/acct.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ static void do_acct_process(struct bsd_acct_struct *acct)
501501
flim = rlimit(RLIMIT_FSIZE);
502502
current->signal->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
503503
/* Perform file operations on behalf of whoever enabled accounting */
504-
orig_cred = override_creds(get_new_cred(file->f_cred));
504+
orig_cred = override_creds(file->f_cred);
505505

506506
/*
507507
* First check to see if there is enough free_space to continue
@@ -541,7 +541,7 @@ static void do_acct_process(struct bsd_acct_struct *acct)
541541
}
542542
out:
543543
current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim;
544-
put_cred(revert_creds(orig_cred));
544+
revert_creds(orig_cred);
545545
}
546546

547547
/**

0 commit comments

Comments
 (0)