aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-09-12 14:47:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-09-12 14:47:49 -0400
commit0b001b2edaead6fd906b1f87967ae05f082189c4 (patch)
tree2df377b4b08946af496941e9d18a48e9a100af6b /fs/btrfs/transaction.c
parent5dfcc87fd79dfb96ed155b524337dbd0da4f5993 (diff)
parentd525e8ab022cb000e6e31a515ba8c3cf0d9c6130 (diff)
Merge branch 'for-linus' of git://github.com/chrismason/linux
* 'for-linus' of git://github.com/chrismason/linux: Btrfs: add dummy extent if dst offset excceeds file end in Btrfs: calc file extent num_bytes correctly in file clone btrfs: xattr: fix attribute removal Btrfs: fix wrong nbytes information of the inode Btrfs: fix the file extent gap when doing direct IO Btrfs: fix unclosed transaction handle in btrfs_cont_expand Btrfs: fix misuse of trans block rsv Btrfs: reset to appropriate block rsv after orphan operations Btrfs: skip locking if searching the commit root in csum lookup btrfs: fix warning in iput for bad-inode Btrfs: fix an oops when deleting snapshots
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 7dc36fab4afc..e24b7964a155 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -884,6 +884,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
884 struct btrfs_root *tree_root = fs_info->tree_root; 884 struct btrfs_root *tree_root = fs_info->tree_root;
885 struct btrfs_root *root = pending->root; 885 struct btrfs_root *root = pending->root;
886 struct btrfs_root *parent_root; 886 struct btrfs_root *parent_root;
887 struct btrfs_block_rsv *rsv;
887 struct inode *parent_inode; 888 struct inode *parent_inode;
888 struct dentry *parent; 889 struct dentry *parent;
889 struct dentry *dentry; 890 struct dentry *dentry;
@@ -895,6 +896,8 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
895 u64 objectid; 896 u64 objectid;
896 u64 root_flags; 897 u64 root_flags;
897 898
899 rsv = trans->block_rsv;
900
898 new_root_item = kmalloc(sizeof(*new_root_item), GFP_NOFS); 901 new_root_item = kmalloc(sizeof(*new_root_item), GFP_NOFS);
899 if (!new_root_item) { 902 if (!new_root_item) {
900 pending->error = -ENOMEM; 903 pending->error = -ENOMEM;
@@ -1002,6 +1005,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
1002 btrfs_orphan_post_snapshot(trans, pending); 1005 btrfs_orphan_post_snapshot(trans, pending);
1003fail: 1006fail:
1004 kfree(new_root_item); 1007 kfree(new_root_item);
1008 trans->block_rsv = rsv;
1005 btrfs_block_rsv_release(root, &pending->block_rsv, (u64)-1); 1009 btrfs_block_rsv_release(root, &pending->block_rsv, (u64)-1);
1006 return 0; 1010 return 0;
1007} 1011}