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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 DF2ACC15509 for ; Thu, 4 Mar 2021 00:27:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A9AB164E6C for ; Thu, 4 Mar 2021 00:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231153AbhCCX7j (ORCPT ); Wed, 3 Mar 2021 18:59:39 -0500 Received: from verein.lst.de ([213.95.11.211]:35428 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355863AbhCCHCF (ORCPT ); Wed, 3 Mar 2021 02:02:05 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 16AAD68CFC; Wed, 3 Mar 2021 08:01:06 +0100 (CET) Date: Wed, 3 Mar 2021 08:01:03 +0100 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Christian Brauner , 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 , Theodore Tso , Alban Crequy , Tycho Andersen , David Howells , James Bottomley , Seth Forshee , =?iso-8859-1?Q?St=E9phane?= Graber , Linus Torvalds , Aleksa Sarai , Lennart Poettering , "Eric W. Biederman" , smbarber@chromium.org, Phil Estes , Serge Hallyn , Kees Cook , Todd Kjos , Paul Moore , Jonathan Corbet , containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-integrity@vger.kernel.org, selinux@vger.kernel.org Subject: Re: [PATCH v6 39/40] xfs: support idmapped mounts Message-ID: <20210303070103.GA7866@lst.de> References: <20210121131959.646623-1-christian.brauner@ubuntu.com> <20210121131959.646623-40-christian.brauner@ubuntu.com> <20210301200520.GK7272@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210301200520.GK7272@magnolia> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Mon, Mar 01, 2021 at 12:05:20PM -0800, Darrick J. Wong wrote: > > + if (breq->mnt_userns != &init_user_ns) { > > + xfs_warn_ratelimited(breq->mp, > > + "bulkstat not supported inside of idmapped mounts."); > > + return -EINVAL; > > Shouldn't this be -EPERM? > > Or -EOPNOTSUPP? -EINVAL is what we return for all our nor suppored ioctls, so I think it is the right choice here, and should generally trigger the right fallbacks. > Also, I'm not sure why bulkstat won't work in an idmapped mount but > bulkstat_single does? You can use the singleton version to stat inodes > that aren't inside the submount. Looking at it again I think we should fail BULKSTAT_SINGLE as well. I had somehow assumed BULKSTAT_SINGLE would operate on the inode of the open file, in which case it would be fine. But it doesn't so that argument doesn't count.