mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 16:52:18 +00:00
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/20241125-work-cred-v2-23-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:
parent
b690668b65
commit
6256d2377e
@ -501,7 +501,7 @@ static void do_acct_process(struct bsd_acct_struct *acct)
|
|||||||
flim = rlimit(RLIMIT_FSIZE);
|
flim = rlimit(RLIMIT_FSIZE);
|
||||||
current->signal->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
|
current->signal->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
|
||||||
/* Perform file operations on behalf of whoever enabled accounting */
|
/* Perform file operations on behalf of whoever enabled accounting */
|
||||||
orig_cred = override_creds(get_new_cred(file->f_cred));
|
orig_cred = override_creds(file->f_cred);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First check to see if there is enough free_space to continue
|
* 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)
|
|||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim;
|
current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim;
|
||||||
put_cred(revert_creds(orig_cred));
|
revert_creds(orig_cred);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user