diff mbox

[12/13] Btrfs-progs: disable qgroupid 0 for quota_tree

Message ID 1358715858-4469-13-git-send-email-gene@czarc.net (mailing list archive)
State New, archived
Headers show

Commit Message

Gene Czarcinski Jan. 20, 2013, 9:04 p.m. UTC
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>

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.

Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Gene Czarcinski <gene@czarc.net>
---
 cmds-qgroup.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Gene Czarcinski Jan. 21, 2013, 2:11 p.m. UTC | #1
At the request of the patch's author, this should be dropped as it has 
been addressed by a patch to the kernel.

On 01/20/2013 04:04 PM, Gene Czarcinski wrote:
> From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
>
> 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.
>
> Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
> Signed-off-by: Gene Czarcinski <gene@czarc.net>
> ---
>   cmds-qgroup.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/cmds-qgroup.c b/cmds-qgroup.c
> index 70019d0..dfff1b9 100644
> --- a/cmds-qgroup.c
> +++ b/cmds-qgroup.c
> @@ -86,6 +86,10 @@ static int qgroup_create(int create, int argc, char **argv)
>   	args.create = create;
>   	args.qgroupid = parse_qgroupid(argv[1]);
>   
> +	if (!args.qgroupid) {
> +		fprintf(stderr, "ERROR: qgroup 0 is not supported\n");
> +		return 30;
> +	}
>   	fd = open_file_or_dir(path);
>   	if (fd < 0) {
>   		fprintf(stderr, "ERROR: can't access '%s'\n", path);

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index 70019d0..dfff1b9 100644
--- a/cmds-qgroup.c
+++ b/cmds-qgroup.c
@@ -86,6 +86,10 @@  static int qgroup_create(int create, int argc, char **argv)
 	args.create = create;
 	args.qgroupid = parse_qgroupid(argv[1]);
 
+	if (!args.qgroupid) {
+		fprintf(stderr, "ERROR: qgroup 0 is not supported\n");
+		return 30;
+	}
 	fd = open_file_or_dir(path);
 	if (fd < 0) {
 		fprintf(stderr, "ERROR: can't access '%s'\n", path);