From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 4/4] quota: add generic subtree quota support Date: Tue, 16 Feb 2010 04:03:37 -0500 Message-ID: <20100216090337.GA9837@infradead.org> References: <1266298312-25885-1-git-send-email-dmonakhov@openvz.org> <1266298312-25885-2-git-send-email-dmonakhov@openvz.org> <1266298312-25885-3-git-send-email-dmonakhov@openvz.org> <1266298312-25885-4-git-send-email-dmonakhov@openvz.org> <1266298312-25885-5-git-send-email-dmonakhov@openvz.org> <20100216081426.GA2622@infradead.org> <87d405vb7r.fsf@openvz.org> <20100216082850.GA14821@infradead.org> <877hqdv9rn.fsf@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, jack@suse.cz To: Dmitry Monakhov Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:34167 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755620Ab0BPJDi (ORCPT ); Tue, 16 Feb 2010 04:03:38 -0500 Content-Disposition: inline In-Reply-To: <877hqdv9rn.fsf@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Feb 16, 2010 at 11:56:44AM +0300, Dmitry Monakhov wrote: > what do you mean by "slightly limited" ? > I dont now xfs project-id feature very well. > I cant find good explanation of this feature(except man pages). > Can you please post main design assumptions. The only difference from your subtree quota is that multiple subtrees can belong to a project. XFS project quotas work the following way: - an inode can be marked as belonging to a project, in which case a 32bit project ID is stored in the inode - a flag on the inode is set to inherit the project ID - adding links from outside the subtree is not allowed quota uses the project ID for accounting, similar to the user/group id. One other small difference is that going over the project quota does not return EDQUOT but ENOSPC. > In fact i use get_id in order to support second-level quota feature > *Second-level quota* > In order to isolate user/group quota in one subtree from other subtree > we have to remap quota id similar to: > quota_uid = (subtree_id << 32) | uid; > > And yes, fs-specific quota interfaces are an utter nightmare, speaking > > as the person fixing all this crap up right now. > I've prepare patches against ext4 because: It's perfectly fine to impement it for one filesystem, the important bit is to make sure we have consistant interfaces for it in generic code. I don't think having a get_id callback to allow fs-specific mappings is a good idea for that.