diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-06-21 16:37:03 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-07-02 11:50:45 -0400 |
commit | 7ee9e4405f264e9eda808aa5ca4522746a1af9c1 (patch) | |
tree | 66b0ebcb2594309044e3f25ab6836b09662c7601 /fs/btrfs/extent_io.c | |
parent | 925a6efb8ff0c2bdbec107ed9890e62650c83306 (diff) | |
download | blackbird-op-linux-7ee9e4405f264e9eda808aa5ca4522746a1af9c1.tar.gz blackbird-op-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.c | 3 |
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; |