Date: Wed, 13 Jul 2005 13:38:35 +0300 From: Vlad GALU <vladgalu@gmail.com> To: Jone Jas <jas_arlerr@yahoo.com.cn> Cc: freebsd hackers <freebsd-hackers@freebsd.org>, Alex Lyashkov <shadow@psoft.net> Subject: Re: limit jail disk space Message-ID: <79722fad05071303383a75e685@mail.gmail.com> In-Reply-To: <20050713102336.45802.qmail@web15007.mail.cnb.yahoo.com> References: <1121231035.4344.10.camel@berloga.shadowland> <20050713102336.45802.qmail@web15007.mail.cnb.yahoo.com>
index | next in thread | previous in thread | raw e-mail
On 7/13/05, Jone Jas <jas_arlerr@yahoo.com.cn> wrote: > > > Alex Lyashkov <shadow@psoft.net> 写道: > В Срд, 13.07.2005, в 06:42, Jone Jas пишет: > > > > Alex Lyashkov 写道: > > В Втр, 12.07.2005, в 16:03, Vlad GALU пишет: > > > On 7/12/05, Jone Jas wrote: > > > > Thanks for your reply. I googled and found this method but > > I just > > > > did not have a try. > > > > As for the code-hacking method I mentioned, anyone with > > any idea > > > > is appreciated! > > > > > > > > > See ufs_quota.c, especially chkdqchg(). It is passed a > > struct > > > ucred* parameter, which contains a struct prison* pointer. > > So I assume > > > you can make your decision based on that. Of course, the > > userland > > > quota management tools and the jail utilities need to be > > made aware of > > > the kernel changes. > > > > > > -- > > >if you compile kernel without QUOTA support it been disabled. > > >I think, more correctly way implement jail disk limit as > > parallel >for disk quota function. > > > > > > IMHO, we can use a sysctl variable to control the > > functionality. > > > >option QUOTA? or jail disklimit? > I mean jail disk limit > > >for jail disklimit more easy create tools who controled all limits >for jail. > >Look to LinuxVServer project (www.linux-vserver.org) or >FreeVPS. > Sure. The tools may control all limits such as cpu time, memory, bandwidth, disk space, etc. I have read the Linux VServer dlimit code. But I am not very sure where to put the hooks for inode/blocks control of jail in FreeBSD. This is why I open this thread. Vlad GALU said I can look to the quota method. I will try. Thanks. It will most probably be tricky, because you can practically have the same uid in both worlds (the host and the jail) with different quota settings mapped to it. So upon granting fs resources you'd have to check which 'world' the request came from. If the quota for that world isn't overdue, you check for that uid's quota inside that world and if that's still OK you grant the resource. You will probably have to add an extra member to the prison structure, to hold the global quota for that jail. > -- > FreeVPS Developers Team http://www.freevps.com > > > > > > --------------------------------- > DO YOU YAHOO!? > 雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- If it's there, and you can see it, it's real. If it's not there, and you can see it, it's virtual. If it's there, and you can't see it, it's transparent. If it's not there, and you can't see it, you erased it.help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?79722fad05071303383a75e685>
