limit jail disk space

Jone Jas jas_arlerr at
Tue Jul 12 09:50:51 GMT 2005

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! 



More information about the freebsd-hackers mailing list