From: Yang Yang <yang.yang29@xxxxxxxxxx> Subject: kernel/acct.c: use dedicated helper to access rlimit values Use rlimit() helper instead of manually writing whole chain from task to rlimit value. See patch "posix-cpu-timers: Use dedicated helper to access rlimit values". Link: https://lkml.kernel.org/r/20210728030822.524789-1-yang.yang29@xxxxxxxxxx Signed-off-by: Yang Yang <yang.yang29@xxxxxxxxxx> Reported-by: Zeal Robot <zealci@xxxxxxxxxx> Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Cc: sh_def@xxxxxxx <sh_def@xxxxxxx> Cc: Yang Yang <yang.yang29@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/acct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/acct.c~acct-use-dedicated-helper-to-access-rlimit-values +++ a/kernel/acct.c @@ -478,7 +478,7 @@ static void do_acct_process(struct bsd_a /* * Accounting records are not subject to resource limits. */ - flim = current->signal->rlim[RLIMIT_FSIZE].rlim_cur; + flim = rlimit(RLIMIT_FSIZE); current->signal->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY; /* Perform file operations on behalf of whoever enabled accounting */ orig_cred = override_creds(file->f_cred); _