From mboxrd@z Thu Jan 1 00:00:00 1970 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 50AF3C433EF for ; Tue, 2 Nov 2021 19:01:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2538A61165 for ; Tue, 2 Nov 2021 19:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbhKBTDq (ORCPT ); Tue, 2 Nov 2021 15:03:46 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:59496 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbhKBTDo (ORCPT ); Tue, 2 Nov 2021 15:03:44 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]:45766) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mhz1w-00EdGr-Do; Tue, 02 Nov 2021 13:01:08 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95]:38626 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 1mhz1u-006oyn-QO; Tue, 02 Nov 2021 13:01:07 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Linus Torvalds Cc: , Alexey Gladkov , Rune Kleveland , Yu Zhao , Jordan Glover , Antoine Martin , David Howells , Jarkko Sakkinen Date: Tue, 02 Nov 2021 14:01:00 -0500 Message-ID: <87bl325qmr.fsf@disp2133> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1mhz1u-006oyn-QO;;;mid=<87bl325qmr.fsf@disp2133>;;;hst=in01.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19QwnNL3n7EIzbBrvxjzcJUMDV2bTOoDzI= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [GIT PULL] ucount cleanups for v5.16 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus, Please pull the ucount-fixes-for-v5.16 branch from the git tree: git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git ucount-fixes-for-v5.16 HEAD: 32342701b4ba57a6fd77e8aca2f65f68c0fa1da6 ucounts: Use atomic_long_sub_return for clarity While working on the ucount fixes a for v5.15 a number of cleanups suggested themselves. Little things like not testing for NULL when a pointer can not be NULL and wrapping atomic_add_negative with a more descriptive name, so that people reading the code can more quickly understand what is going on. 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