Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 May 2009 13:51:23 +0100 (BST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Menshikov Konstantin <kostjn@peterhost.ru>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Disk quota for Jail. Discussion.
Message-ID:  <alpine.BSF.2.00.0905271340260.95509@fledge.watson.org>
In-Reply-To: <4A1BE827.2030303@peterhost.ru>
References:  <4A1B8CF8.7030102@peterhost.ru> <20090526120313.GA1927@deviant.kiev.zoral.com.ua> <4A1BE1F8.9050804@peterhost.ru> <20090526123632.GB1927@deviant.kiev.zoral.com.ua> <4A1BE827.2030303@peterhost.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, 26 May 2009, Menshikov Konstantin wrote:

>>> Yes. But jail cannot allocate block and inode above root path. In 
>>> allocation functions, whether for example ffs_alloc we have access to 
>>> ucred process and we can check up there is a process in jail.
>> 
>> Yes, you can check this for jailed process. Think about non-jailed 
>> processes that can do allocation below the jail root.
>
> Processes out of jail are not considered. I do not understand, these 
> processes have what relation to disk to quotas for jail. Please explain more 
> in detail

Historic UFS quotas are actually not interested in processes at all, really, 
except in as much as processes are where exception states are exposed.  UFS 
quotas count blocks and inodes owned by users based on the 'uid' and 'gid' 
fields in the inode.  There's now 'jailid' field, so quotas on this model 
can't capture the notion of per-jail quotas.  In fact, quotacheck relies on 
being able to walk the file system looking only at file system data in order 
to establish initial usage accounting.  You can imagine adding one, or 
managing the uid spaces across jails such that all uids are unique, etc, but 
all of these require some amount of rethinking.

Or, some other model of quota.  Frankly, I've always been a fan of the AFS 
model, now accessible locally via ZFS, in which lightweight volumes with quota 
limits are used for individual user home directories, virtual machines, etc. 
This was hard to do in FreeBSD before ZFS because (a) UFS didn't want to 
resize trivially and (b) having lots and lots of mountpoints and file systems 
wasn't something we made administratively easy.

Robert N M Watson
Computer Laboratory
University of Cambridge



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0905271340260.95509>