From patchwork Wed Sep 8 02:58:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12479977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06285C433FE for ; Wed, 8 Sep 2021 02:58:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C9B4561131 for ; Wed, 8 Sep 2021 02:58:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C9B4561131 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 749B5940033; Tue, 7 Sep 2021 22:58:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 704EA900003; Tue, 7 Sep 2021 22:58:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BEA6940033; Tue, 7 Sep 2021 22:58:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id 476AB900003 for ; Tue, 7 Sep 2021 22:58:20 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 11E92180CD614 for ; Wed, 8 Sep 2021 02:58:20 +0000 (UTC) X-FDA: 78562897560.12.DA23E04 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf06.hostedemail.com (Postfix) with ESMTP id C4604801A88D for ; Wed, 8 Sep 2021 02:58:19 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id D9BBF6113C; Wed, 8 Sep 2021 02:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1631069899; bh=gTkP6jaWkfbYKLjyGTpii2sLP6eOwxMVLLTX8ZQ3TUk=; h=Date:From:To:Subject:In-Reply-To:From; b=zGSTenZ8CRhqLxzOmiUvftL5Ykv0Ujon26sT2H2RMqZCGqzzr0XKlLHs4hFkyGMfW yz/6mujt8jdjg7v7MC48GLt4h3/Q8b5qWUV9Wm7dQXZ/7k7WcgLY4o2eEDTO/UHXE3 9YNVh6R7M3Gj2Bvw5BawMGVc2tnRKjzz4sUr7L1A= Date: Tue, 07 Sep 2021 19:58:18 -0700 From: Andrew Morton To: akpm@linux-foundation.org, linux-mm@kvack.org, mm-commits@vger.kernel.org, rdunlap@infradead.org, sh_def@163.com, torvalds@linux-foundation.org, yang.yang29@zte.com.cn, zealci@zte.com.cn Subject: [patch 094/147] kernel/acct.c: use dedicated helper to access rlimit values Message-ID: <20210908025818.SN1YMF0Cv%akpm@linux-foundation.org> In-Reply-To: <20210907195226.14b1d22a07c085b22968b933@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=zGSTenZ8; spf=pass (imf06.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: C4604801A88D X-Stat-Signature: c3oekjeucaje95w4jp4hc7fqwasg6phw X-HE-Tag: 1631069899-963184 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Yang Yang 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@zte.com.cn Signed-off-by: Yang Yang Reported-by: Zeal Robot Cc: Randy Dunlap Cc: sh_def@163.com Cc: Yang Yang Signed-off-by: Andrew Morton --- 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);