From owner-freebsd-hackers@FreeBSD.ORG Tue May 26 12:33:19 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 138AD1065686 for ; Tue, 26 May 2009 12:33:19 +0000 (UTC) (envelope-from kostjn@peterhost.ru) Received: from mail.z8.ru (mail.z8.ru [80.93.58.56]) by mx1.freebsd.org (Postfix) with ESMTP id C04458FC1B for ; Tue, 26 May 2009 12:33:18 +0000 (UTC) (envelope-from kostjn@peterhost.ru) Received: from [85.235.196.139] (helo=kostjn.pht) by mail.z8.ru with esmtpa (Exim 4.67 (FreeBSD)) (envelope-from ) id 1M8vq9-0008dK-6k for freebsd-hackers@freebsd.org; Tue, 26 May 2009 16:33:09 +0400 Message-ID: <4A1BE1F8.9050804@peterhost.ru> Date: Tue, 26 May 2009 16:35:04 +0400 From: Menshikov Konstantin User-Agent: Thunderbird 2.0.0.18 (X11/20090328) MIME-Version: 1.0 CC: freebsd-hackers@freebsd.org References: <4A1B8CF8.7030102@peterhost.ru> <20090526120313.GA1927@deviant.kiev.zoral.com.ua> In-Reply-To: <20090526120313.GA1927@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Disk quota for Jail. Discussion. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2009 12:33:19 -0000 Kostik Belousov wrote: > On Tue, May 26, 2009 at 10:32:24AM +0400, Menshikov Konstantin wrote: > >> Hi. >> Jail now have no disk quotas. >> Users which use jail, use separate zfs or md device for jail, but it >> from a hopelessness. >> It is necessary to discuss possible ways of realisation. >> I suggest to make disk quotas for jail on the basis of the user quotas. >> >> Introduction. >> User UID and GID are located in inode and are always accessible. >> No information about jail in ufs is present. All activity jail is >> limited root path. >> >> The work scheme. >> In structure prison it is added structures containing disk quotas and usage. >> At start Jail, we calculate the size root path and number of files in >> it, thus receiving current use of a disk. >> In functions of allocation of disk blocks and inode, we check quotas and >> we increase current use. >> > UFS cannot determine whether the new allocation goes under the jail > root or not. > 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. >> If jail exceeds a quota, inquiry about allocation of the disk block or >> inode it is rejected. >> After work end jail the information on disk use is lost. >> >> What do you think about it? >> There are other offers? >> >> If jail will get access to disk devices in/dev/and will mount file system of a problem also will not arise, I think... Can be eat other problems which are not visible at first sight?