From owner-freebsd-hackers@FreeBSD.ORG Tue May 26 12:36:37 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 F32371065673 for ; Tue, 26 May 2009 12:36:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 968378FC18 for ; Tue, 26 May 2009 12:36:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1M8vtT-000JkP-Ag; Tue, 26 May 2009 15:36:35 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n4QCaWVF056238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 May 2009 15:36:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n4QCaWVF056001; Tue, 26 May 2009 15:36:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n4QCaWV3056000; Tue, 26 May 2009 15:36:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 26 May 2009 15:36:32 +0300 From: Kostik Belousov To: Menshikov Konstantin Message-ID: <20090526123632.GB1927@deviant.kiev.zoral.com.ua> References: <4A1B8CF8.7030102@peterhost.ru> <20090526120313.GA1927@deviant.kiev.zoral.com.ua> <4A1BE1F8.9050804@peterhost.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iJxQupPLzo4E+zOu" Content-Disposition: inline In-Reply-To: <4A1BE1F8.9050804@peterhost.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.1 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1M8vtT-000JkP-Ag 0332f6bdb3bfd0d578ff36265a6f78df X-Terabit: YES Cc: freebsd-hackers@freebsd.org 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:36:37 -0000 --iJxQupPLzo4E+zOu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 26, 2009 at 04:35:04PM +0400, Menshikov Konstantin wrote: > Kostik Belousov wrote: > >On Tue, May 26, 2009 at 10:32:24AM +0400, Menshikov Konstantin wrote: > >>In structure prison it is added structures containing disk quotas and= =20 > >>usage. > >>At start Jail, we calculate the size root path and number of files in= =20 > >>it, thus receiving current use of a disk. > >>In functions of allocation of disk blocks and inode, we check quotas an= d=20 > >>we increase current use. > >> =20 > >UFS cannot determine whether the new allocation goes under the jail > >root or not. > > =20 > Yes. But jail cannot allocate block and inode above root path. In=20 > allocation functions, whether for example ffs_alloc we have access to=20 > 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. --iJxQupPLzo4E+zOu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkob4lAACgkQC3+MBN1Mb4glqgCfZYSHk0V1PwnEvo9b+FQMe45S vDsAoLur4g3iObSkj5FjOT7g8b4ZcRAi =AN0T -----END PGP SIGNATURE----- --iJxQupPLzo4E+zOu--