Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3119305pxf; Mon, 15 Mar 2021 01:42:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlDAoPUyAE5xmeLvlTPxqNPWUPjNOnfxaqF4dLuiIvDs9BfRQ1SN1UlRhJLXo2ZgbPI8PU X-Received: by 2002:a17:906:1519:: with SMTP id b25mr22437160ejd.254.1615797721136; Mon, 15 Mar 2021 01:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615797721; cv=none; d=google.com; s=arc-20160816; b=r3GTlCwbFxzLPaGoCBp1920C6RLuPqEDNPZpUtY3uQIGiukPQo5Tjq38Xe7oxP38hm 86IQCveELWw2mCXz79P3iDf/17zq5A9JjvYJOk8bdC6HOY67GlDn++LlaYGK8N6uTY57 In0g/5gp2kbfDzOOofhnJZTt8IW/wmoLBe0b6mverXrMHSmkuutEKTWZZrbw4f0Siy+1 vFjLLLK3VbTFMdfS5Y/yujXjn+eoM4ddP2WQfljxmpXA5gpFDjU42V8o39EWMQrMJ7yc YGQhPdoC1oBdCGyNT0uUucxTTrJbSELBPBrxkzZxygb/HkbMNoZzGd8rY2fiinL6e1EU 9dfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=FESQck8ONldPq2EUxWiottJU1zj6QYkJlUCLrlAUl3g=; b=da1geOAC0cQwlG5KrkvLtEG7hEik/BOJeop/sm7J5F47R2Fgt2MtOmCDcITpM3yqzO Nd0+TsmrZz5MFF9rws6E7sQk7GVKA/2zCsi+BHBnl3Q4iXxktzecw1HZd3mb9x/Zp+cM 7h2ttSqSf9Ij30QY8ZVyzLFYgVhHJaHLRf4oF4LnmWHF9Ci+BTKeQjSPIqAUFw/bwXcc MdXT8C7amu07mmhYams4rE9WKCU23sggrKJSn9rQRr9Ycce/WdwmLKMHf/cPdFqyFhsf 8S4IIMC0FIsEI7zigrHrCC844ysWF3gwcPm76BbGVl+n6BK2MyksEhtWw2z5cjhj4h1q JslA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay27si10510575edb.171.2021.03.15.01.41.35; Mon, 15 Mar 2021 01:42:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229524AbhCOIlD (ORCPT + 99 others); Mon, 15 Mar 2021 04:41:03 -0400 Received: from verein.lst.de ([213.95.11.211]:52881 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbhCOIkh (ORCPT ); Mon, 15 Mar 2021 04:40:37 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id BE66A68C4E; Mon, 15 Mar 2021 09:40:33 +0100 (CET) Date: Mon, 15 Mar 2021 09:40:33 +0100 From: Christoph Hellwig To: Christian Brauner Cc: Vivek Goyal , Christoph Hellwig , Alexander Viro , linux-fsdevel@vger.kernel.org, Andy Lutomirski , Theodore Tso , Alban Crequy , Tycho Andersen , Seth Forshee , =?iso-8859-1?Q?St=E9phane?= Graber , Linus Torvalds , Aleksa Sarai , "Eric W. Biederman" , Serge Hallyn , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Subject: Re: [PATCH v6 02/40] fs: add id translation helpers Message-ID: <20210315084033.GB28612@lst.de> References: <20210121131959.646623-1-christian.brauner@ubuntu.com> <20210121131959.646623-3-christian.brauner@ubuntu.com> <20210313000529.GA181317@redhat.com> <20210313143148.d6rhgmhxwq6abb6y@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210313143148.d6rhgmhxwq6abb6y@wittgenstein> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org > + struct user_namespace *s_user_ns = sb->s_user_ns; > + if (!kuid_has_mapping(s_user_ns, > + kuid_from_mnt(mnt_userns, current_fsuid()))) > + return false; > + if (!kgid_has_mapping(s_user_ns, > + kgid_from_mnt(mnt_userns, current_fsgid()))) > + return false; > + return true; Please don't use one tab indents for conditional continuations, as that looks really weird. Always use two tabs or align to the opening brace. Otherwise these helpers looks really useful.