linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>, <cyril.scetbon@free.fr>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] Btrfs: qgroup: free reserved in exceeding quota.
Date: Tue, 9 Dec 2014 10:42:08 -0500	[thread overview]
Message-ID: <54871850.3020809@fb.com> (raw)
In-Reply-To: <b5f44049f85f372a286a1c7e600d274dc03a2e25.1418124311.git.yangds.fnst@cn.fujitsu.com>

On 12/09/2014 06:27 AM, Dongsheng Yang wrote:
> When we exceed quota limit in writing, we will free
> some reserved extent when we need to drop but not free
> account in qgroup. It means, each time we exceed quota
> in writing, there will be some remain space in qg->reserved
> we can not use any more. If things go on like this, the
> all space will be ate up.
>
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
> ---
>   fs/btrfs/extent-tree.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index a84e00d..014b7f2 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -5262,8 +5262,11 @@ out_fail:
>   			to_free = 0;
>   	}
>   	spin_unlock(&BTRFS_I(inode)->lock);
> -	if (dropped)
> +	if (dropped) {
> +		if (root->fs_info->quota_enabled)
> +			btrfs_qgroup_free(root, dropped * root->nodesize);

This needs to be num_bytes + dropped * root->nodesize.  Thanks,

Josef

  parent reply	other threads:[~2014-12-09 15:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BA68E495-8B7B-4F0F-A64B-0413B1480B9C@free.fr>
2014-12-09 11:27 ` [PATCH 1/2] Btrfs: qgroup: free reserved in exceeding quota Dongsheng Yang
2014-12-09 11:27   ` [PATCH 2/2] Btrfs: qgroup: Introduce a may_use to account space_info->bytes_may_use Dongsheng Yang
2014-12-09 15:55     ` Josef Bacik
2014-12-10  8:09       ` Dongsheng Yang
2014-12-09 15:42   ` Josef Bacik [this message]
2014-12-10  8:09     ` [PATCH 1/2] Btrfs: qgroup: free reserved in exceeding quota Dongsheng Yang
2014-12-11 18:25       ` Josef Bacik
2014-12-12  0:44         ` Dongsheng Yang
2014-12-12  8:44           ` [PATCH v2 " Dongsheng Yang
2014-12-12  8:44             ` [PATCH v2 2/2] Btrfs: qgroup: Introduce a may_use to account space_info->bytes_may_use Dongsheng Yang
     [not found]               ` <549CBAB1.3070909@cn.fujitsu.com>
2014-12-26  5:43                 ` Satoru Takeuchi
2014-12-26  6:49                   ` Dongsheng Yang
2014-12-26  7:00                     ` Dongsheng Yang
2014-12-28  2:03                   ` Dongsheng Yang
2015-01-05  6:16                   ` [PATCH v3 0/3] Btrfs: Enhancment for qgroup Dongsheng Yang
2015-01-05  6:16                     ` [PATCH v3 1/3] Btrfs: qgroup: free reserved in exceeding quota Dongsheng Yang
2015-01-05  6:16                     ` [PATCH v3 2/3] Btrfs: qgroup: Introduce a may_use to account space_info->bytes_may_use Dongsheng Yang
2015-01-05  6:16                     ` [PATCH v3 3/3] Btrfs: qgroup, Account data space in more proper timings Dongsheng Yang
2015-01-07  0:49                     ` [PATCH v3 0/3] Btrfs: Enhancment for qgroup Satoru Takeuchi
2015-01-08  3:53                       ` Dongsheng Yang

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=54871850.3020809@fb.com \
    --to=jbacik@fb.com \
    --cc=cyril.scetbon@free.fr \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=yangds.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).