summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-10-01 23:24:44 +0200
committerChris Mason <chris.mason@oracle.com>2009-10-01 23:24:44 +0200
commit9c2693c9243b81802c6860570557165e874779a7 (patch)
treec857a96a78cdc9fcd640ea4279e7214d6c9713b3 /fs
parentBtrfs: remove duplicates of filemap_ helpers (diff)
parentBtrfs: fix data space leak fix (diff)
downloadlinux-9c2693c9243b81802c6860570557165e874779a7.tar.xz
linux-9c2693c9243b81802c6860570557165e874779a7.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable into for-linus
Diffstat (limited to 'fs')
-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:
goto again;
}
+ /*
+ * XXX - page_mkwrite gets called every time the page is dirtied, even
+ * if it was already dirty, so for space accounting reasons we need to
+ * clear any delalloc bits for the range we are fixing to save. There
+ * is probably a better way to do this, but for now keep consistent with
+ * prepare_pages in the normal write path.
+ */
+ clear_extent_bits(&BTRFS_I(inode)->io_tree, page_start, page_end,
+ EXTENT_DIRTY | EXTENT_DELALLOC, GFP_NOFS);
+
ret = btrfs_set_extent_delalloc(inode, page_start, page_end);
if (ret) {
unlock_extent(io_tree, page_start, page_end, GFP_NOFS);
ret = VM_FAULT_SIGBUS;
+ btrfs_free_reserved_data_space(root, inode, PAGE_CACHE_SIZE);
goto out_unlock;
}
ret = 0;