From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Monakhov Subject: Re: [RFC] vfs generic subtree support Date: Tue, 16 Feb 2010 18:00:32 +0300 Message-ID: <87hbphns33.fsf@openvz.org> References: <87tythtptw.fsf@openvz.org> <20100216122029.GC30031@ZenIV.linux.org.uk> <87bpfpcq55.fsf@openvz.org> <20100216133836.GD30031@ZenIV.linux.org.uk> <87mxz9nutb.fsf@openvz.org> <20100216142154.GE30031@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Al Viro Return-path: Received: from mail-bw0-f219.google.com ([209.85.218.219]:39047 "EHLO mail-bw0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932201Ab0BPPAi (ORCPT ); Tue, 16 Feb 2010 10:00:38 -0500 Received: by bwz19 with SMTP id 19so4425208bwz.28 for ; Tue, 16 Feb 2010 07:00:35 -0800 (PST) In-Reply-To: <20100216142154.GE30031@ZenIV.linux.org.uk> (Al Viro's message of "Tue, 16 Feb 2010 14:21:54 +0000") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Al Viro writes: > On Tue, Feb 16, 2010 at 05:01:36PM +0300, Dmitry Monakhov wrote: > >> Let's call it "metagroup" id. If you know better (more descriptive) word >> for this purpose i please make your suggestion. >> >> - Such metagroup may be assigned to inode. And this id is stored on >> inode. >> - It may be inherent from parent, if corresponding flag is set >> on parent dir. - if inherent flag is not set, then inherent metagroup id from mnt_root >> - metagroup id may be used by generic quota. > > I would probably like to see example with fewer "may" and more details ;-) > Seriously, what kind of rules and uses for it do you have in mind? More > specific example would be nice... Use-cases: *Assing maximum disc space consumption for some hierarchy * 1) Create chroot environment # tar xf chroot_env.tar /var/xxx/chroot 2) Assign some metagroup id to the chroot content (via not yet existent ./metagroup cmd-tool) # find /var/xxx/chroot | xargs ./metagroup --set 1000 3) Setup quota limits # quota-set --type metagroup --blk_soft=1024M blk_hard=1024M /var 4) Export this tree (it may be more complex) # mount /var/xxx/chroot /mnt/chroot -obound 5)Now we may use this /mnt/chroot as: 5A) A regular chroot envirement, user is unable to exceed metagroup quota, regardless to real available space on /var/ 5B) As a container's (namespace) root. 5C) export this /mnt/chroot to nfs server and nfs client can not overcome given metagroup quota limit.