Re: [RFC PATCH] Btrfs-progs: disable qgroupid 0 for quota_tree
From: Miao Xie <hidden>
Date: 2012-11-12 02:20:58
On fri, 09 Nov 2012 10:33:52 +1100, Chris Samuel wrote:
On 08/11/12 20:55, Miao Xie wrote:quoted
In kernel, qgroupid 0 is a special number when we run the quota group limit command. So, we should not be able to create a quota group whose id is 0, otherwise the kernel can't deal with it. Fix it.This is probably a stupid question - but if its not meant to be possible to create such a thing shouldn't this be fixed in the kernel (as well as here) to reject attempts from user space to create it? Otherwise it's possible for a non-aware program (or a user who is playing) to still create it.
Right. It also should be fixed in the kernel side, the patch is coming. But since we know which number is valid or not, it is better that we also check the arguments in the user tool before they are passed into the kernel. So, we can avoid trapping into the kernel, which will waste time, and output the error information as soon as possible. Thanks Miao