Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2693048pxx; Sun, 1 Nov 2020 06:47:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJipN0+Q+b+h9JnvwjlIsTLwbXz5sKxogCp8Q/WFWg1qYLh5Bk6YZGEE8RmHwcITVIGk4t X-Received: by 2002:aa7:c90a:: with SMTP id b10mr12382285edt.163.1604242061337; Sun, 01 Nov 2020 06:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604242061; cv=none; d=google.com; s=arc-20160816; b=X/QqT90FfMhOCjFcDnhNH/HdpBX7h19MgutxrwT+l6rFai35sf9n6gehOMJjbzjxhW 7ifYmjzHpJZs/BXuqd8Y614Q8BPYuGUJDXjKHer7Qui45m6D0MxSWNs3PlP9TQvi9NeN zxaIIUOgrADkFBv5gLPO2Lg1iMMEwb8dXmD9W4r/EVBHnEf8uEYTf7Q/SSCr/MWrk7u0 2z1849wjARHeRJsa6+Yvsffb7ivsXMOASh/19TYaN9Sv46txIFFwn4kwia3rIoVRoDb+ 8rDpt6WjFDDkC0Hrp5PWTW/ANi56TJKAAUHhAiKQtT7stvb439IvH6k/oQiu2Zm2EF8W 09Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ecTJHGTyUmsna16Nipqp/caudodMDR0L+6mieeHEVz0=; b=QPbUer9MIJi+e2ahr2TfLWdPM9BgTI98AJPIMJzPPYF8Xf4BPfTgtvoCmlSf6gdhUk K6K2d9f5Y1+Xsdap5meJ3pf7IpzlF5rJMso7JCRNg85i9MLE1nSm7cGbDK0j9wEWsBTu epjsvcRED3+RrJ5zQFH1oVbbZbx/3gM6O/5V1AamvpdqiVawPP7X0YHpVfAwd9Gr3e3R NtfpUvHlc+04u9QmihhXbg9a7RIYiYN/qIbI3eB+cHA2ebrunE3rlFOGvMeW8Iaq8U+N OztmO+QMdx+7EN3b8zVxquMGijFG+7NxPxz9a3fHqx0WRzMi5eRRC4WeglGGchHEU91S iYLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=q3mdWyij; 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 r27si8129317ejc.681.2020.11.01.06.47.18; Sun, 01 Nov 2020 06:47:41 -0800 (PST) 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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=q3mdWyij; 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 S1726541AbgKAOqh (ORCPT + 99 others); Sun, 1 Nov 2020 09:46:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbgKAOqh (ORCPT ); Sun, 1 Nov 2020 09:46:37 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C13A2C0617A6; Sun, 1 Nov 2020 06:46:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ecTJHGTyUmsna16Nipqp/caudodMDR0L+6mieeHEVz0=; b=q3mdWyijCuChf1I+Nl89lM1Hi/ 8QLngbL3lC1CUTaJQgH/l7Pdwl+4KIblTZJvnZtejunYcHjL3djEY8TdKoHYN6/27P2iKnQHDu2uG AI+fb51LwOCrwtw+Iy/+FwtHDgH+DA+lwLK/OADJQZk/zyf9D4PiZkzR5iAl9/mmQWn9MpsoF4VDI DyFp3zwImLfoJmCnI0vntmirHu+SW+YoTdKfXYoiDF1SJvYaga+iHBvq+ktMmoQOciLo90leiyiZA J0eTamb8RlQl3U+yihGs05QJ0ifcE1hZ10yx/Qe6q7/ykqutkrivTlB/L/LUPhzohONGtzltfUQ5R 4Qb+/11w==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZEcq-0006a4-4R; Sun, 01 Nov 2020 14:46:32 +0000 Date: Sun, 1 Nov 2020 14:46:32 +0000 From: Christoph Hellwig To: Christian Brauner Cc: Alexander Viro , Christoph Hellwig , linux-fsdevel@vger.kernel.org, John Johansen , James Morris , Mimi Zohar , Dmitry Kasatkin , Stephen Smalley , Casey Schaufler , Arnd Bergmann , Andreas Dilger , OGAWA Hirofumi , Geoffrey Thomas , Mrunal Patel , Josh Triplett , Andy Lutomirski , Amir Goldstein , Miklos Szeredi , Theodore Tso , Alban Crequy , Tycho Andersen , David Howells , James Bottomley , Jann Horn , Seth Forshee , St??phane Graber , Aleksa Sarai , Lennart Poettering , "Eric W. Biederman" , smbarber@chromium.org, Phil Estes , Serge Hallyn , Kees Cook , Todd Kjos , Jonathan Corbet , containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-audit@redhat.com, linux-integrity@vger.kernel.org, selinux@vger.kernel.org Subject: Re: [PATCH 06/34] fs: add id translation helpers Message-ID: <20201101144632.GD23378@infradead.org> References: <20201029003252.2128653-1-christian.brauner@ubuntu.com> <20201029003252.2128653-7-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201029003252.2128653-7-christian.brauner@ubuntu.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org > +static inline kuid_t kuid_into_mnt(struct user_namespace *to, kuid_t kuid) > +{ > +#ifdef CONFIG_IDMAP_MOUNTS > + return make_kuid(to, __kuid_val(kuid)); > +#else > + return kuid; > +#endif > +} > + > +static inline kgid_t kgid_into_mnt(struct user_namespace *to, kgid_t kgid) > +{ > +#ifdef CONFIG_IDMAP_MOUNTS > + return make_kgid(to, __kgid_val(kgid)); > +#else > + return kgid; > +#endif If you want to keep the config option please at least have on #ifdef/#else/#endif instead of this mess.