All of lore.kernel.org
 help / color / mirror / Atom feed
From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
To: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>, <jbacik@fb.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: qgroup: move WARN_ON() to the correct location.
Date: Wed, 7 Jan 2015 10:52:45 +0900	[thread overview]
Message-ID: <54AC916D.4080307@jp.fujitsu.com> (raw)
In-Reply-To: <1420548882-12106-1-git-send-email-yangds.fnst@cn.fujitsu.com>

On 2015/01/06 21:54, Dongsheng Yang wrote:
> In function qgroup_excl_accounting(), we need to WARN when
> qg->excl is less than what we want to free, same to child
> and parents. But currently, for parent qgroup, the WARN_ON()
> is located after freeing qg->excl. It will WARN out even we
> free it normally.
> 
> This patch move this WARN_ON() before freeing qg->excl.
> 
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>

Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

> ---
>   fs/btrfs/qgroup.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 48b60db..97159a8 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -1431,9 +1431,8 @@ static int qgroup_excl_accounting(struct btrfs_fs_info *fs_info,
>   		qgroup = u64_to_ptr(unode->aux);
>   		qgroup->rfer += sign * oper->num_bytes;
>   		qgroup->rfer_cmpr += sign * oper->num_bytes;
> +		WARN_ON(sign < 0 && qgroup->excl < oper->num_bytes);
>   		qgroup->excl += sign * oper->num_bytes;
> -		if (sign < 0)
> -			WARN_ON(qgroup->excl < oper->num_bytes);
>   		qgroup->excl_cmpr += sign * oper->num_bytes;
>   		qgroup_dirty(fs_info, qgroup);
>   
> 


      reply	other threads:[~2015-01-07  1:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-06 12:54 [PATCH] btrfs: qgroup: move WARN_ON() to the correct location Dongsheng Yang
2015-01-07  1:52 ` Satoru Takeuchi [this message]

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=54AC916D.4080307@jp.fujitsu.com \
    --to=takeuchi_satoru@jp.fujitsu.com \
    --cc=jbacik@fb.com \
    --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 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.