From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 12 09:50:51 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06D6516A41C for ; Tue, 12 Jul 2005 09:50:51 +0000 (GMT) (envelope-from jas_arlerr@yahoo.com.cn) Received: from web15007.mail.cnb.yahoo.com (web15007.mail.cnb.yahoo.com [202.165.103.64]) by mx1.FreeBSD.org (Postfix) with SMTP id 0DE0643D49 for ; Tue, 12 Jul 2005 09:50:49 +0000 (GMT) (envelope-from jas_arlerr@yahoo.com.cn) Received: (qmail 60124 invoked by uid 60001); 12 Jul 2005 09:50:48 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.cn; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=LoWEuWCa6gNemmoVEO3sHEfevXiO3gFoyI4dUDKYvT6yd1BIomKW6a6qjJXXlrAZr0GkMpIf4g9wcbhZj7do/84CmyZlOYIV3UpbjPSJsDWOzH/Ty8ultsyZtXq0XFRfuYQrjPK/R5bc2xmUiM9bp6PqSr1MmHf9BNlWGWndp9U= ; Message-ID: <20050712095048.60122.qmail@web15007.mail.cnb.yahoo.com> Received: from [61.187.54.10] by web15007.mail.cnb.yahoo.com via HTTP; Tue, 12 Jul 2005 17:50:48 CST Date: Tue, 12 Jul 2005 17:50:48 +0800 (CST) From: Jone Jas To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: limit jail disk space 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, 12 Jul 2005 09:50:51 -0000 Hi hackers, As far as I know, there is no limit of the disk space that a jail can use. As for the Linux VServer(similar to jail), its dlimit does such thing for the "security context". I read the dlimit code and find that it achieves that by limiting the number of inodes and data blocks the vserver can get. The hooks are inserted in the functions such as ext2_new_inode, ext2_free_inode, ext2_new_block and ext2_free_block. My question is if we can do such thing to the jail. If so, where should we insert the hooks? It seems that the FreeBSD inode/block allocation/free functions are not so explicit as Linux. There are serveral places, I'm not sure which are the correct ones: for inodes: ffs_valloc, ffs_vfree for blocks: ffs_alloc, ffs_freeblk, or ufs_balloc_ufs1/2 Any reply or hints is appreciated! Regards! Jas --------------------------------- DO YOU YAHOO!? 雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱