Skip to content

Commit

Permalink
Btrfs: fix the qgroup reserved space is released prematurely
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  • Loading branch information
Miao Xie authored and Josef Bacik committed Feb 20, 2013
1 parent cdb4c57 commit 4b82490
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ start_transaction(struct btrfs_root *root, u64 num_items, int type,
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;
h->allocating_chunk = false;
Expand All @@ -402,6 +402,7 @@ start_transaction(struct btrfs_root *root, u64 num_items, int type,
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);
Expand Down

0 comments on commit 4b82490

Please sign in to comment.