From: Arne Jansen <sensille@gmx.net>
To: Wang Shilong <wangshilong1991@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] Btrfs: create the qgroup that limits root subvolume automatically
Date: Fri, 22 Feb 2013 14:19:23 +0100 [thread overview]
Message-ID: <5127705B.7080705@gmx.net> (raw)
In-Reply-To: <1361534540-2381-1-git-send-email-wangshilong1991@gmail.com>
On 02/22/13 13:02, Wang Shilong wrote:
> From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
>
> Creating the root subvolume qgroup when enabling quota,with
Why only create a qgroup for the root subvolume and not for
every existing subvolume?
> this patch,it will be ok to limit the whole filesystem size.
This will not limit the whole filesystem, but only the root
subvolume. To limit the whole filesystem you'd have to create
a level 1 qgroup and add all subvolumes to it.
-Arne
>
> Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
> Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
> Cc: Arne Jansen <sensille@gmx.net>
> ---
> fs/btrfs/qgroup.c | 12 ++++++++++++
> 1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index a5c8562..c409096 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -777,6 +777,7 @@ int btrfs_quota_enable(struct btrfs_trans_handle *trans,
> struct extent_buffer *leaf;
> struct btrfs_key key;
> int ret = 0;
> + struct btrfs_qgroup *qgroup = NULL;
>
> spin_lock(&fs_info->qgroup_lock);
> if (fs_info->quota_root) {
> @@ -823,7 +824,18 @@ int btrfs_quota_enable(struct btrfs_trans_handle *trans,
>
> btrfs_mark_buffer_dirty(leaf);
>
> + btrfs_release_path(path);
> + ret = add_qgroup_item(trans, quota_root, BTRFS_FS_TREE_OBJECTID);
> + if (ret)
> + goto out;
> +
> spin_lock(&fs_info->qgroup_lock);
> + qgroup = add_qgroup_rb(fs_info, BTRFS_FS_TREE_OBJECTID);
> + if (IS_ERR(qgroup)) {
> + spin_unlock(&fs_info->qgroup_lock);
> + ret = PTR_ERR(qgroup);
> + goto out;
> + }
> fs_info->quota_root = quota_root;
> fs_info->pending_quota_state = 1;
> spin_unlock(&fs_info->qgroup_lock);
>
next prev parent reply other threads:[~2013-02-22 13:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-22 12:02 [PATCH 1/2] Btrfs: create the qgroup that limits root subvolume automatically Wang Shilong
2013-02-22 13:19 ` Arne Jansen [this message]
2013-02-22 16:29 ` Shilong Wang
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=5127705B.7080705@gmx.net \
--to=sensille@gmx.net \
--cc=linux-btrfs@vger.kernel.org \
--cc=wangshilong1991@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox