Message ID | 1420548882-12106-1-git-send-email-yangds.fnst@cn.fujitsu.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
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); > > -- 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 --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);
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> --- fs/btrfs/qgroup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)