diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-10-25 16:55:08 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-11 22:07:58 -0500 |
commit | d788a34929a90f70b945c100cfe9efd4d49fb446 (patch) | |
tree | bbb4a0338ca120305271de08ccf18f888534cfe8 /fs/btrfs | |
parent | 02ecd2c278471a3a7fd255662df92861c6759ebf (diff) |
Btrfs: don't abort transaction in run_delalloc_nocow
This is just the write path, the only reason we start a transaction is so we can
check cross references, we don't make any actual changes, so there is no reason
to abort the transaction if we fail. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a44ca6a4feff..5916ad8681cd 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -1180,10 +1180,8 @@ static noinline int run_delalloc_nocow(struct inode *inode, | |||
1180 | while (1) { | 1180 | while (1) { |
1181 | ret = btrfs_lookup_file_extent(trans, root, path, ino, | 1181 | ret = btrfs_lookup_file_extent(trans, root, path, ino, |
1182 | cur_offset, 0); | 1182 | cur_offset, 0); |
1183 | if (ret < 0) { | 1183 | if (ret < 0) |
1184 | btrfs_abort_transaction(trans, root, ret); | ||
1185 | goto error; | 1184 | goto error; |
1186 | } | ||
1187 | if (ret > 0 && path->slots[0] > 0 && check_prev) { | 1185 | if (ret > 0 && path->slots[0] > 0 && check_prev) { |
1188 | leaf = path->nodes[0]; | 1186 | leaf = path->nodes[0]; |
1189 | btrfs_item_key_to_cpu(leaf, &found_key, | 1187 | btrfs_item_key_to_cpu(leaf, &found_key, |
@@ -1197,10 +1195,8 @@ next_slot: | |||
1197 | leaf = path->nodes[0]; | 1195 | leaf = path->nodes[0]; |
1198 | if (path->slots[0] >= btrfs_header_nritems(leaf)) { | 1196 | if (path->slots[0] >= btrfs_header_nritems(leaf)) { |
1199 | ret = btrfs_next_leaf(root, path); | 1197 | ret = btrfs_next_leaf(root, path); |
1200 | if (ret < 0) { | 1198 | if (ret < 0) |
1201 | btrfs_abort_transaction(trans, root, ret); | ||
1202 | goto error; | 1199 | goto error; |
1203 | } | ||
1204 | if (ret > 0) | 1200 | if (ret > 0) |
1205 | break; | 1201 | break; |
1206 | leaf = path->nodes[0]; | 1202 | leaf = path->nodes[0]; |
@@ -1291,10 +1287,8 @@ out_check: | |||
1291 | ret = cow_file_range(inode, locked_page, | 1287 | ret = cow_file_range(inode, locked_page, |
1292 | cow_start, found_key.offset - 1, | 1288 | cow_start, found_key.offset - 1, |
1293 | page_started, nr_written, 1); | 1289 | page_started, nr_written, 1); |
1294 | if (ret) { | 1290 | if (ret) |
1295 | btrfs_abort_transaction(trans, root, ret); | ||
1296 | goto error; | 1291 | goto error; |
1297 | } | ||
1298 | cow_start = (u64)-1; | 1292 | cow_start = (u64)-1; |
1299 | } | 1293 | } |
1300 | 1294 | ||
@@ -1341,10 +1335,8 @@ out_check: | |||
1341 | BTRFS_DATA_RELOC_TREE_OBJECTID) { | 1335 | BTRFS_DATA_RELOC_TREE_OBJECTID) { |
1342 | ret = btrfs_reloc_clone_csums(inode, cur_offset, | 1336 | ret = btrfs_reloc_clone_csums(inode, cur_offset, |
1343 | num_bytes); | 1337 | num_bytes); |
1344 | if (ret) { | 1338 | if (ret) |
1345 | btrfs_abort_transaction(trans, root, ret); | ||
1346 | goto error; | 1339 | goto error; |
1347 | } | ||
1348 | } | 1340 | } |
1349 | 1341 | ||
1350 | extent_clear_unlock_delalloc(inode, cur_offset, | 1342 | extent_clear_unlock_delalloc(inode, cur_offset, |
@@ -1366,10 +1358,8 @@ out_check: | |||
1366 | if (cow_start != (u64)-1) { | 1358 | if (cow_start != (u64)-1) { |
1367 | ret = cow_file_range(inode, locked_page, cow_start, end, | 1359 | ret = cow_file_range(inode, locked_page, cow_start, end, |
1368 | page_started, nr_written, 1); | 1360 | page_started, nr_written, 1); |
1369 | if (ret) { | 1361 | if (ret) |
1370 | btrfs_abort_transaction(trans, root, ret); | ||
1371 | goto error; | 1362 | goto error; |
1372 | } | ||
1373 | } | 1363 | } |
1374 | 1364 | ||
1375 | error: | 1365 | error: |