summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorJosef Bacik2013-06-21 22:37:03 +0200
committerJosef Bacik2013-07-02 17:50:45 +0200
commit7ee9e4405f264e9eda808aa5ca4522746a1af9c1 (patch)
tree66b0ebcb2594309044e3f25ab6836b09662c7601 /fs/btrfs/extent_io.c
parentBtrfs: stop using try_to_writeback_inodes_sb_nr to flush delalloc (diff)
downloadkernel-qcow2-linux-7ee9e4405f264e9eda808aa5ca4522746a1af9c1.tar.gz
kernel-qcow2-linux-7ee9e4405f264e9eda808aa5ca4522746a1af9c1.tar.xz
kernel-qcow2-linux-7ee9e4405f264e9eda808aa5ca4522746a1af9c1.zip
Btrfs: check if we can nocow if we don't have data space
We always just try and reserve data space when we write, but if we are out of space but have prealloc'ed extents we should still successfully write. This patch will try and see if we can write to prealloc'ed space and if we can go ahead and allow the write to continue. With this patch we now pass xfstests generic/274. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index a83d7019ede9..f8586a957a02 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -543,6 +543,9 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
btrfs_debug_check_extent_io_range(tree->mapping->host, start, end);
+ if (bits & EXTENT_DELALLOC)
+ bits |= EXTENT_NORESERVE;
+
if (delete)
bits |= ~EXTENT_CTLBITS;
bits |= EXTENT_FIRST_DELALLOC;