diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2011-01-20 01:19:37 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-02-01 07:17:27 -0500 |
commit | 98d5dc13e7e74b77ca3b4c3cbded9f48d2dbbbb7 (patch) | |
tree | 8e75f67b28b5b0d909483a06bb5258e0ba0c9789 /fs/btrfs/extent-tree.c | |
parent | 5df67083488ccbad925f583b698ab38f8629a016 (diff) |
btrfs: fix return value check of btrfs_start_transaction()
The error check of btrfs_start_transaction() is added, and the mistake
of the error check on several places is corrected.
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 9de4ff03882a..f07ba21cbf06 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -6271,6 +6271,8 @@ int btrfs_drop_snapshot(struct btrfs_root *root, | |||
6271 | BUG_ON(!wc); | 6271 | BUG_ON(!wc); |
6272 | 6272 | ||
6273 | trans = btrfs_start_transaction(tree_root, 0); | 6273 | trans = btrfs_start_transaction(tree_root, 0); |
6274 | BUG_ON(IS_ERR(trans)); | ||
6275 | |||
6274 | if (block_rsv) | 6276 | if (block_rsv) |
6275 | trans->block_rsv = block_rsv; | 6277 | trans->block_rsv = block_rsv; |
6276 | 6278 | ||
@@ -6368,6 +6370,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root, | |||
6368 | 6370 | ||
6369 | btrfs_end_transaction_throttle(trans, tree_root); | 6371 | btrfs_end_transaction_throttle(trans, tree_root); |
6370 | trans = btrfs_start_transaction(tree_root, 0); | 6372 | trans = btrfs_start_transaction(tree_root, 0); |
6373 | BUG_ON(IS_ERR(trans)); | ||
6371 | if (block_rsv) | 6374 | if (block_rsv) |
6372 | trans->block_rsv = block_rsv; | 6375 | trans->block_rsv = block_rsv; |
6373 | } | 6376 | } |
@@ -7587,7 +7590,7 @@ int btrfs_cleanup_reloc_trees(struct btrfs_root *root) | |||
7587 | 7590 | ||
7588 | if (found) { | 7591 | if (found) { |
7589 | trans = btrfs_start_transaction(root, 1); | 7592 | trans = btrfs_start_transaction(root, 1); |
7590 | BUG_ON(!trans); | 7593 | BUG_ON(IS_ERR(trans)); |
7591 | ret = btrfs_commit_transaction(trans, root); | 7594 | ret = btrfs_commit_transaction(trans, root); |
7592 | BUG_ON(ret); | 7595 | BUG_ON(ret); |
7593 | } | 7596 | } |
@@ -7831,7 +7834,7 @@ static noinline int relocate_one_extent(struct btrfs_root *extent_root, | |||
7831 | 7834 | ||
7832 | 7835 | ||
7833 | trans = btrfs_start_transaction(extent_root, 1); | 7836 | trans = btrfs_start_transaction(extent_root, 1); |
7834 | BUG_ON(!trans); | 7837 | BUG_ON(IS_ERR(trans)); |
7835 | 7838 | ||
7836 | if (extent_key->objectid == 0) { | 7839 | if (extent_key->objectid == 0) { |
7837 | ret = del_extent_zero(trans, extent_root, path, extent_key); | 7840 | ret = del_extent_zero(trans, extent_root, path, extent_key); |