Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp119754ybz; Tue, 28 Apr 2020 19:42:36 -0700 (PDT) X-Google-Smtp-Source: APiQypLkfCCTz/JT+bfGqxuUkf896ddaBTe9ctA+y+DWhCizMp2QbhdryGJrT5ERzs3mq9BLnPkr X-Received: by 2002:a50:9dc4:: with SMTP id l4mr651918edk.234.1588128156378; Tue, 28 Apr 2020 19:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588128156; cv=none; d=google.com; s=arc-20160816; b=kN719cSnNTGC/rYeKRBCogM5ffGA4xxrA6NG8KggT6C9Qv4uoBNx/XtoDSrccdiKdV 3PGxYcnbQSY6QoHPR5XHF/hxpLU+71sZG/64Pu3qpX61wPWXeWWHXUqnPZqlgvPLGa2I tgW0B4suT8ItP1G/8H9rBGromGys5p/FA2H7Qifez5D2EZBNjHZKYWOcLI/6tIw80phi b//ZudlnTwCNb8mymBKLEi5G65bJgPgoCEcXZwGTbXxS1ytsSmBoi3zntLxuWZeoWEGN JnpLANmh8W3pJO/tyW+5UJBaWkQ7+cdbifTOxvDW05DgyeyH+uQyhks6Fb8GFERlkHku ysZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Q15aKEnJZxNCJo2U3fxiXl1byEluyfS8aaF0FmgUtVc=; b=duzh+16tZExCut/ghlmvRr9/ZD+e3gEEaVo3mTJPdYgCtyOS+Wnlk72sjIZeDM1Nxb 6YmZjw1/89fIgbyWEEsDpjgNoWnQlnRjUnmiXO40AyKKH0nLaCEBwd04pTzQTbijXa6x vBMfw6e4PmiUjjtCQBxOfOUkdtb2eX2mEBUAO7CcfEaGEipHanHVnPqwAAc05z/15wmA AwHCW/Fc6AE4gT714qc+56cbw+bhPxgLlDGPEWSCXrNeADLmRzBGdLept9/syfRG8hwk JePJnsIJxHYisWfW+16XRUi94BaArIpfEhyQp/TqODDvZ6HGRqY3IupzRQRHErqHdFOy TYXQ== 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 a4si3271103edf.478.2020.04.28.19.42.12; Tue, 28 Apr 2020 19:42:36 -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 S1726422AbgD2CmG (ORCPT + 99 others); Tue, 28 Apr 2020 22:42:06 -0400 Received: from mail105.syd.optusnet.com.au ([211.29.132.249]:53895 "EHLO mail105.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbgD2CmG (ORCPT ); Tue, 28 Apr 2020 22:42:06 -0400 Received: from dread.disaster.area (pa49-195-157-175.pa.nsw.optusnet.com.au [49.195.157.175]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 889BF3A296C; Wed, 29 Apr 2020 12:42:02 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1jTcfh-0001e5-4c; Wed, 29 Apr 2020 12:42:01 +1000 Date: Wed, 29 Apr 2020 12:42:01 +1000 From: Dave Chinner To: Jan Kara Cc: "Darrick J. Wong" , Francois , linux-ext4@vger.kernel.org Subject: Re: ext4 and project quotas bugs Message-ID: <20200429024201.GE2005@dread.disaster.area> References: <20200428153228.GB6426@quack2.suse.cz> <20200428155351.GH6733@magnolia> <20200428164824.GD6426@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200428164824.GD6426@quack2.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=W5xGqiek c=1 sm=1 tr=0 a=ONQRW0k9raierNYdzxQi9Q==:117 a=ONQRW0k9raierNYdzxQi9Q==:17 a=kj9zAlcOel0A:10 a=cl8xLZFz6L8A:10 a=7-415B0cAAAA:8 a=6m63xNJIwqfvyKoSR8cA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Apr 28, 2020 at 06:48:24PM +0200, Jan Kara wrote: > On Tue 28-04-20 08:53:51, Darrick J. Wong wrote: > > On Tue, Apr 28, 2020 at 05:32:28PM +0200, Jan Kara wrote: > > > > dd if=/dev/zero of=someoutput oflag=append > > > > dd: failed to open 'someoutput': Invalid argument > > > > > > Yes, that's a bug that should be fixed. Thanks for reporting this! -1 means > > > 'this id is not expressible in current user namespace' and some code gets > > > confused along the way. We should refuse to set project -1 for a file... > > > > Awkward part: projid 4294967295 is allowed on XFS (at least by the > > kernel), though the xfs quota tools do not permit that. > > Are you OK with just refusing to set projid 4294967295 for everybody? Or > should we just not try to translate project IDs through user namespaces? > Because XFS does not seem to translate them while ext4 does... What a mess. We do not translate project IDs through user names space because they are not usable as a mappable id. Project IDs are only used for customised aggregation of space accounting, unlike UIDs and GIDS that are used primarily for access control. IOWs, PRIDs are fundamentally different to UIDs and GIDs. Project IDs were already being used in the init namespace for directory quotas to limit containers using bind mounts on a host filesystem to an amount of disk space less than the entire hosting filesystem. And once you use PRIDs in the init namespace, they cannot be used by users in other user namespaces, regardless of whether they are mappable or not. Essentially, the project ID mapping stuff was implemented by someone who didn't understand what project IDs were or how project IDs were being used, and then refused to listen to the people who knew these things and wanted them to drop the PRID mapping stuff. And then Linus pulled their tree containing all the uid/gid/prid mapping code without warning and we've been stuck with this shit ever since. Hence in XFS we simply do not allow project IDs to be manipulated outside of the init user namespace, and so mapping them is irrelevant because users in confined namespaces cannot usefully interact with them in any way. Cheers, Dave. -- Dave Chinner david@fromorbit.com