]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/btrfs/transaction.c
Btrfs: use reserved space for creating a snapshot
[mirror_ubuntu-artful-kernel.git] / fs / btrfs / transaction.c
index a83d486cc70c8d0831bc32055c3b9b8451f580ba..4330433b7b4f5617edfd36ffb68a252e509328ea 100644 (file)
@@ -1123,6 +1123,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
 
        rsv = trans->block_rsv;
        trans->block_rsv = &pending->block_rsv;
+       trans->bytes_reserved = trans->block_rsv->reserved;
 
        dentry = pending->dentry;
        parent = dget_parent(dentry);
@@ -1276,6 +1277,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
 fail:
        dput(parent);
        trans->block_rsv = rsv;
+       trans->bytes_reserved = 0;
 no_free_objectid:
        kfree(new_root_item);
 root_item_alloc_fail: