I''ve noticed a peculiarity with child filesystems, has anyone else come across this when creating two ZFS file systems and applying quotas to them, eg: sunsmpt2:/# zfs create uts/parent sunsmpt2:/# zfs set quota=100m uts/parent sunsmpt2:/# zfs create uts/parent/child sunsmpt2:/# zfs set quota=500m uts/parent/child sunsmpt2:/# zfs list -o name,zoned,mountpoint,quota -r uts/parent NAME ZONED MOUNTPOINT QUOTA uts/parent off /uts/parent 100M uts/parent/child off /uts/parent/child 500M sunsmpt2:/# df -h | grep uts/parent uts/parent 100M 8K 100M 1% /uts/parent uts/parent/child 500M 8K [u]100M[/u] 1% /uts/parent/child sunsmpt2:/# mkfile 100m /uts/parent/test /uts/parent/test: initialized 104726528 of 104857600 bytes: Disc quota exceeded sunsmpt2:/# df -h | grep uts/parent uts/parent 100M [u]100M[/u] 0K 100% /uts/parent uts/parent/child 500M 8K 0K [u]100%[/u] /uts/parent/child sunsmpt2:/# sunsmpt2:/# mkfile 100m /uts/parent/child/test Could not open /uts/parent/child/test: Disc quota exceeded sunsmpt2:/# Initially I hadn''t read the part about how descendents inherit the quota limits of the parent - my mistake - but when I did, whilst explaining why the above happened, it made me wonder why it lets you do this in the first place. Is there a valid reason why you can set a higher quota limit on a descendent, or child f/s than that of the parent??? Is there perhaps a need for a check to be made to prevent this as the only way to resolve this is to bump up the quota on the parent. sunsmpt2:/# zfs set quota=600m uts/parent sunsmpt2:/# zfs list -o name,zoned,mountpoint,quota -r uts/parent NAME ZONED MOUNTPOINT QUOTA uts/parent off /uts/parent 600M uts/parent/child off /uts/parent/child 500M sunsmpt2:/# df -h | grep uts/parent uts/parent [u]600M[/u] 100M 500M 17% /uts/parent uts/parent/child 500M 8K [u]500M[/u] 1% /uts/parent/child sunsmpt2:/# mkfile 100m /uts/parent/child/test sunsmpt2:/# ls -l /uts/parent/child/test -rw------T 1 root root 104857600 Dec 29 10:45 /uts/parent/child/test sunsmpt2:/# df -h | grep uts/parent uts/parent 600M 100M 400M 21% /uts/parent uts/parent/child 500M 100M 400M 21% /uts/parent/child This message posted from opensolaris.org
> Is there a valid reason > why you can set a higher quota limit on a descendent, > or child f/s than that of the parent??? Is there > perhaps a need for a check to be made to prevent this > as the only way to resolve this is to bump up the > quota on the parent.It might be a good idea to print a warning message when setting a quota that won''t be relevant due to an ancestor''s lower quota. Perhaps also when setting a quota that is lower than some descendents'' quotas, thus causing them to not be relevant. Do you think that such a message would have helped to avoid confusion in this case? This message posted from opensolaris.org
A warning at this point would be useful, or better a total refusal to allow you to set a higher quota on a child than what''s already set on the parent. This message posted from opensolaris.org
On 1/3/06, Phil Coleman <phil.c.coleman at britishairways.com> wrote:> A warning at this point would be useful, or better a total refusal to allow you to set a higher quota on a child than what''s already set on the parent.I''d argue that a total refusal would be best in these two cases, both in setting a higher quota on a child than what''s on the parent and in setting a lower quota on a parent than what''s on a child. A warning message at the time is useful for the person setting the quota, but it says nothing to the person who comes along later and can''t figure out why they can''t fit 200MB into a filesystem with a 500MB quota. Another possible solution would be to list the child quota with an asterisk noting that it''s overridden by some parent quota, but I think that would confusing and would just cover up for the fact that you were allowed to do something illogical in the first place. Chad Mynhier
On Tue, Jan 03, 2006 at 09:51:52AM -0500, Chad Mynhier wrote:> On 1/3/06, Phil Coleman <phil.c.coleman at britishairways.com> wrote: > > A warning at this point would be useful, or better a total refusal to allow you to set a higher quota on a child than what''s already set on the parent. > > I''d argue that a total refusal would be best in these two cases, both > in setting a higher quota on a child than what''s on the parent and in > setting a lower quota on a parent than what''s on a child. A warning > message at the time is useful for the person setting the quota, but it > says nothing to the person who comes along later and can''t figure out > why they can''t fit 200MB into a filesystem with a 500MB quota.Really? What if you needed to lower some quota temporarily and didn''t want to have to go change the quota of all the child filesystems, and then later wanted to restore the quotas to their originals?> Another possible solution would be to list the child quota with an > asterisk noting that it''s overridden by some parent quota, but I think > that would confusing and would just cover up for the fact that you > were allowed to do something illogical in the first place.I like this better.
>> Another possible solution would be to list the child quota with an >> asterisk noting that it''s overridden by some parent quota, but I think >> that would confusing and would just cover up for the fact that you >> were allowed to do something illogical in the first place. > >I like this better.Why not list the effective quota with the set quota? If you know that it is limited you probably know how it''s limited too. Casper
Nicolas Williams wrote:> On Tue, Jan 03, 2006 at 09:51:52AM -0500, Chad Mynhier wrote: >>Another possible solution would be to list the child quota with an >>asterisk noting that it''s overridden by some parent quota, but I think >>that would confusing and would just cover up for the fact that you >>were allowed to do something illogical in the first place. > > I like this better.I definitely prefer this to refusing to set the parent quota at all. But I''m not convinced that I actually like it. Consider another common (and useful) case: the sum of the child quotas is larger than the parent quota, even though each child quota is smaller than the parent. How would this be represented? --Ed -- Ed Gould Sun Microsystems File System Architect Sun Cluster ed.gould at sun.com 17 Network Circle +1.650.786.4937 M/S UMPK17-201 x84937 Menlo Park, CA 94025
On Tue, Jan 03, 2006 at 10:19:25PM +0100, Casper.Dik at Sun.COM wrote:> > >> Another possible solution would be to list the child quota with an > >> asterisk noting that it''s overridden by some parent quota, but I think > >> that would confusing and would just cover up for the fact that you > >> were allowed to do something illogical in the first place. > > > >I like this better. > > Why not list the effective quota with the set quota? If you know that it > is limited you probably know how it''s limited too.Even better!
On Tue, Jan 03, 2006 at 01:26:20PM -0800, Ed Gould wrote:> Nicolas Williams wrote: > >On Tue, Jan 03, 2006 at 09:51:52AM -0500, Chad Mynhier wrote: > >>Another possible solution would be to list the child quota with an > >>asterisk noting that it''s overridden by some parent quota, but I think > >>that would confusing and would just cover up for the fact that you > >>were allowed to do something illogical in the first place. > > > >I like this better. > > I definitely prefer this to refusing to set the parent quota at all. > But I''m not convinced that I actually like it. > > Consider another common (and useful) case: the sum of the child quotas > is larger than the parent quota, even though each child quota is smaller > than the parent. How would this be represented?As an asterisk on the parent OR, rather, to follow Casper''s suggestion, by giving the sum of the children''s quotes parenthetically, say.
>On Tue, Jan 03, 2006 at 01:26:20PM -0800, Ed Gould wrote: >> Nicolas Williams wrote: >> >On Tue, Jan 03, 2006 at 09:51:52AM -0500, Chad Mynhier wrote: >> >>Another possible solution would be to list the child quota with an >> >>asterisk noting that it''s overridden by some parent quota, but I think >> >>that would confusing and would just cover up for the fact that you >> >>were allowed to do something illogical in the first place. >> > >> >I like this better. >> >> I definitely prefer this to refusing to set the parent quota at all. >> But I''m not convinced that I actually like it. >> >> Consider another common (and useful) case: the sum of the child quotas >> is larger than the parent quota, even though each child quota is smaller >> than the parent. How would this be represented? > >As an asterisk on the parent OR, rather, to follow Casper''s suggestion, >by giving the sum of the children''s quotes parenthetically, say.Unless we keep that somewhere cached, the sum of all children''s quota could be expensive to compute as it requires you to visit all children. Looking at just the parents and grand parents is a cheap operation. Casper
On Tue, Jan 03, 2006 at 10:58:31PM +0100, Casper.Dik at Sun.COM wrote:> Unless we keep that somewhere cached, the sum of all children''s > quota could be expensive to compute as it requires you to visit all > children. Looking at just the parents and grand parents is a > cheap operation.And there''s other issues: which to count towards a grandfather''s sum-of-children''s quotas, a child''s quota or its sum-of-children''s quotas? Nico --
On 1/3/06, Nicolas Williams <Nicolas.Williams at sun.com> wrote:> On Tue, Jan 03, 2006 at 09:51:52AM -0500, Chad Mynhier wrote: > > On 1/3/06, Phil Coleman <phil.c.coleman at britishairways.com> wrote: > > > A warning at this point would be useful, or better a total refusal to allow you to set a higher quota on a child than what''s already set on the parent. > > > > I''d argue that a total refusal would be best in these two cases, both > > in setting a higher quota on a child than what''s on the parent and in > > setting a lower quota on a parent than what''s on a child. > > Really? What if you needed to lower some quota temporarily and didn''t > want to have to go change the quota of all the child filesystems, and > then later wanted to restore the quotas to their originals?You make a good point, and there are probably other situations that I''m not considering. I''ll retract my argument for a total refusal to set a quota in these cases. I like Casper''s suggestion to list both the effective and the set quota. I''d only request either that they always be listed together or that the effective quota be the default quota to be listed. Thanks, Chad Mynhier
Has there been any solution to the problem discussed above in ZFS version 8?? This message posted from opensolaris.org
Rahul Mehta wrote:> Has there been any solution to the problem discussed above in ZFS version 8??We expect it to be fixed within a month. See: http://opensolaris.org/os/community/arc/caselog/2007/555/ --matt
Hi everyone, I have been following this thread and I feel that this has been resolved in the ZFS version 8, which is done as follows, bash-3.00# zfs list NAME USED AVAIL REFER MOUNTPOINT tank 266K 263G 32.0K /tank tank/bm 28.8K 5.00G 28.8K /tank/bm tank/rm 59.1K 5.00G 30.4K /tank/rm tank/rm/child1 28.8K 5.00G 28.8K /tank/rm/child1 bash-3.00# zfs create tank/rm/child2 bash-3.00# zfs set quota=10G tank/rm/child2 bash-3.00# zfs list NAME USED AVAIL REFER MOUNTPOINT tank 304K 263G 32.0K /tank tank/bm 28.8K 5.00G 28.8K /tank/bm tank/rm 89.5K 5.00G 32.0K /tank/rm tank/rm/child1 28.8K 5.00G 28.8K /tank/rm/child1 tank/rm/child2 28.8K 5.00G 28.8K /tank/rm/child2 bash-3.00# Here you can see when I try to create a child with a quota of higher limit than the parent quota, it sets the child quota to the limit of the parent. This is my understanding of how the problem has been resolved (correct me if I am wrong), if anyone can please explain as to what exactly has been done here. Also, in the above example I will like to highlight the issue of how ZFS handles two child with the same quota limit as the parent (i.e. it means it doesn''t inherit the quota property from parent??). If anyone can explain this.... Thanks This message posted from opensolaris.org