From patchwork Mon Oct 18 17:54:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 12567551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFA21C433F5 for ; Mon, 18 Oct 2021 17:55:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4ACDD60F02 for ; Mon, 18 Oct 2021 17:55:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4ACDD60F02 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xmission.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C7FCC900003; Mon, 18 Oct 2021 13:55:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2ECD900002; Mon, 18 Oct 2021 13:55:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1D09900003; Mon, 18 Oct 2021 13:55:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0083.hostedemail.com [216.40.44.83]) by kanga.kvack.org (Postfix) with ESMTP id A3992900002 for ; Mon, 18 Oct 2021 13:55:10 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5AF4818260C62 for ; Mon, 18 Oct 2021 17:55:10 +0000 (UTC) X-FDA: 78710309580.11.8D9A4E5 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) by imf12.hostedemail.com (Postfix) with ESMTP id DEA5110000AA for ; Mon, 18 Oct 2021 17:55:09 +0000 (UTC) Received: from in01.mta.xmission.com ([166.70.13.51]:44280) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mcWqp-00ESzV-HC; Mon, 18 Oct 2021 11:55:07 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95]:47614 helo=email.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mcWqo-004AnW-NK; Mon, 18 Oct 2021 11:55:07 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Alexey Gladkov Cc: Rune Kleveland , Yu Zhao , Jordan Glover , LKML , linux-mm@kvack.org, containers@lists.linux-foundation.org, Hillf Danton References: <1M9_d6wrcu6rdPe1ON0_k0lOxJMyyot3KAb1gdyuwzDPC777XVUWPHoTCEVmcK3fYfgu7sIo3PSaLe9KulUdm4TWVuqlbKyYGxRAjsf_Cpk=@protonmail.ch> <87ee9pa6xw.fsf@disp2133> <878rzw77i3.fsf@disp2133> <20210929173611.fo5traia77o63gpw@example.org> <20210930130640.wudkpmn3cmah2cjz@example.org> <878rz8wwb6.fsf@disp2133> <87v92cvhbf.fsf@disp2133> <87mtnavszx.fsf_-_@disp2133> <87fssytizw.fsf_-_@disp2133> <871r4itfjw.fsf_-_@disp2133> Date: Mon, 18 Oct 2021 12:54:35 -0500 In-Reply-To: <871r4itfjw.fsf_-_@disp2133> (Eric W. Biederman's message of "Mon, 18 Oct 2021 12:21:07 -0500") Message-ID: <877dearzfo.fsf_-_@disp2133> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-XM-SPF: eid=1mcWqo-004AnW-NK;;;mid=<877dearzfo.fsf_-_@disp2133>;;;hst=in01.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/tEUz60tuIgGwnBsMjtXOnMtSfTAnHyoE= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [PATCH 0/4] ucounts: misc cleanups X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) X-Stat-Signature: mtsu6oejxyyukwpe3y35bwtatzgsomdz Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of ebiederm@xmission.com designates 166.70.13.233 as permitted sender) smtp.mailfrom=ebiederm@xmission.com; dmarc=pass (policy=none) header.from=xmission.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DEA5110000AA X-HE-Tag: 1634579709-8374 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: The following changes are a set of miscellaneous fixes that makes the ucount code a little bit easier to read. There are all things that I ran into while helping hunt the crazy reference count bug. I am aiming these at the next merge window and 5.16 rather than bug fixes to get into the current 5.15. Eric W. Biederman (4): ucounts: In set_cred_ucounts assume new->ucounts is non-NULL ucounts: Remove unnecessary test for NULL ucount in get_ucounts ucounts: Add get_ucounts_or_wrap for clarity ucounts: Use atomic_long_sub_return for clarity kernel/cred.c | 5 ++--- kernel/ucount.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) Eric Tested-by: Yu Zhao