All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Btrfs: fix the qgroup reserved space is released prematurely
@ 2013-02-20  9:13 Miao Xie
  2013-02-20 14:36 ` Liu Bo
  0 siblings, 1 reply; 2+ messages in thread
From: Miao Xie @ 2013-02-20  9:13 UTC (permalink / raw)
  To: Linux Btrfs; +Cc: Arne Jansen

In start_transactio(), we will try to join the transaction again after
the current transaction is committed, so we should not release the
reserved space of the qgroup. Fix it.

Cc: Arne Jansen <sensille@gmx.net>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
 fs/btrfs/transaction.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index fc03aa6..bc2f2d1 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -383,7 +383,7 @@ again:
 	h->block_rsv = NULL;
 	h->orig_rsv = NULL;
 	h->aborted = 0;
-	h->qgroup_reserved = qgroup_reserved;
+	h->qgroup_reserved = 0;
 	h->delayed_ref_elem.seq = 0;
 	h->type = type;
 	INIT_LIST_HEAD(&h->qgroup_ref_list);
@@ -401,6 +401,7 @@ again:
 		h->block_rsv = &root->fs_info->trans_block_rsv;
 		h->bytes_reserved = num_bytes;
 	}
+	h->qgroup_reserved = qgroup_reserved;
 
 got_it:
 	btrfs_record_root_in_trans(h, root);
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] Btrfs: fix the qgroup reserved space is released prematurely
  2013-02-20  9:13 [PATCH 1/3] Btrfs: fix the qgroup reserved space is released prematurely Miao Xie
@ 2013-02-20 14:36 ` Liu Bo
  0 siblings, 0 replies; 2+ messages in thread
From: Liu Bo @ 2013-02-20 14:36 UTC (permalink / raw)
  To: Miao Xie; +Cc: Linux Btrfs, Arne Jansen

On Wed, Feb 20, 2013 at 05:13:32PM +0800, Miao Xie wrote:
> In start_transactio(), we will try to join the transaction again after
> the current transaction is committed, so we should not release the
> reserved space of the qgroup. Fix it.

Why do we release the reserved space of the qgroup?

join
 |
 v
blocked && commit && goto again
 |
 v
fail somehow
 |
 v
release qgroup reserved space

The release part seems to be all right, am I missing something?

thanks,
liubo

> 
> Cc: Arne Jansen <sensille@gmx.net>
> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
> ---
>  fs/btrfs/transaction.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index fc03aa6..bc2f2d1 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -383,7 +383,7 @@ again:
>  	h->block_rsv = NULL;
>  	h->orig_rsv = NULL;
>  	h->aborted = 0;
> -	h->qgroup_reserved = qgroup_reserved;
> +	h->qgroup_reserved = 0;
>  	h->delayed_ref_elem.seq = 0;
>  	h->type = type;
>  	INIT_LIST_HEAD(&h->qgroup_ref_list);
> @@ -401,6 +401,7 @@ again:
>  		h->block_rsv = &root->fs_info->trans_block_rsv;
>  		h->bytes_reserved = num_bytes;
>  	}
> +	h->qgroup_reserved = qgroup_reserved;
>  
>  got_it:
>  	btrfs_record_root_in_trans(h, root);
> -- 
> 1.6.5.2
> --
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-20 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-20  9:13 [PATCH 1/3] Btrfs: fix the qgroup reserved space is released prematurely Miao Xie
2013-02-20 14:36 ` Liu Bo

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.