aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorLiu Bo <liubo2009@cn.fujitsu.com>2012-07-06 05:31:33 -0400
committerChris Mason <chris.mason@fusionio.com>2012-07-23 16:28:01 -0400
commit067893842341e7b7487062367ecfaa46c97505e0 (patch)
tree4e02d6bdb940623e11fd5b95d73a123ebc1a7de0 /fs/btrfs/extent-tree.c
parent83eea1f1bacd5dc7b44dcf84f5fdca54fdea5453 (diff)
Btrfs: do not abort transaction in prealloc case
During disk balance, we prealloc new file extent for file data relocation, but we may fail in 'no available space' case, and it leads to flipping btrfs into readonly. It is not necessary to bail out and abort transaction since we do have several ways to rescue ourselves from ENOSPC case. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index d1ebd2a06116..67bd12a52369 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5748,7 +5748,11 @@ loop:
5748 ret = do_chunk_alloc(trans, root, num_bytes + 5748 ret = do_chunk_alloc(trans, root, num_bytes +
5749 2 * 1024 * 1024, data, 5749 2 * 1024 * 1024, data,
5750 CHUNK_ALLOC_LIMITED); 5750 CHUNK_ALLOC_LIMITED);
5751 if (ret < 0) { 5751 /*
5752 * Do not bail out on ENOSPC since we
5753 * can do more things.
5754 */
5755 if (ret < 0 && ret != -ENOSPC) {
5752 btrfs_abort_transaction(trans, 5756 btrfs_abort_transaction(trans,
5753 root, ret); 5757 root, ret);
5754 goto out; 5758 goto out;