aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-10-01 17:24:44 -0400
committerChris Mason <chris.mason@oracle.com>2009-10-01 17:24:44 -0400
commit9c2693c9243b81802c6860570557165e874779a7 (patch)
treec857a96a78cdc9fcd640ea4279e7214d6c9713b3 /fs/btrfs
parent8aa38c31b7659e338fee4d9af4c3805acbd9806f (diff)
parentfbf190874407f23d2891b53ffdf7d3c6be8d47ff (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable into for-linus
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/inode.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 5b9c8e0d6dd6..f4001112df78 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4909,10 +4909,21 @@ again:
4909 goto again; 4909 goto again;
4910 } 4910 }
4911 4911
4912 /*
4913 * XXX - page_mkwrite gets called every time the page is dirtied, even
4914 * if it was already dirty, so for space accounting reasons we need to
4915 * clear any delalloc bits for the range we are fixing to save. There
4916 * is probably a better way to do this, but for now keep consistent with
4917 * prepare_pages in the normal write path.
4918 */
4919 clear_extent_bits(&BTRFS_I(inode)->io_tree, page_start, page_end,
4920 EXTENT_DIRTY | EXTENT_DELALLOC, GFP_NOFS);
4921
4912 ret = btrfs_set_extent_delalloc(inode, page_start, page_end); 4922 ret = btrfs_set_extent_delalloc(inode, page_start, page_end);
4913 if (ret) { 4923 if (ret) {
4914 unlock_extent(io_tree, page_start, page_end, GFP_NOFS); 4924 unlock_extent(io_tree, page_start, page_end, GFP_NOFS);
4915 ret = VM_FAULT_SIGBUS; 4925 ret = VM_FAULT_SIGBUS;
4926 btrfs_free_reserved_data_space(root, inode, PAGE_CACHE_SIZE);
4916 goto out_unlock; 4927 goto out_unlock;
4917 } 4928 }
4918 ret = 0; 4929 ret = 0;