From: Miao Xie <miaox@cn.fujitsu.com>
To: Linux Btrfs <linux-btrfs@vger.kernel.org>
Cc: Arne Jansen <sensille@gmx.net>, wangshilong <wangsl-fnst@cn.fujitsu.com>
Subject: [RFC PATCH] Btrfs-progs: disable qgroupid 0 for quota_tree
Date: Thu, 08 Nov 2012 17:55:35 +0800 [thread overview]
Message-ID: <509B8197.2090601@cn.fujitsu.com> (raw)
In-Reply-To: <509B8053.3080509@cn.fujitsu.com>
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>
---
cmds-qgroup.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
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);
-- 1.7.7.6
next parent reply other threads:[~2012-11-08 9:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <509B8053.3080509@cn.fujitsu.com>
2012-11-08 9:55 ` Miao Xie [this message]
2012-11-08 23:33 ` [RFC PATCH] Btrfs-progs: disable qgroupid 0 for quota_tree Chris Samuel
2012-11-12 2:21 ` Miao Xie
2012-11-12 6:25 ` Jan Schmidt
2012-11-12 7:08 ` Miao Xie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=509B8197.2090601@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=sensille@gmx.net \
--cc=wangsl-fnst@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.