summaryrefslogtreecommitdiff
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-12-15 16:44:56 (GMT)
committerChris Mason <chris.mason@oracle.com>2008-12-15 16:44:56 (GMT)
commit42dc7babdcc99feadb04d461592ce5898a362550 (patch)
tree9497d6dddba1a046b4a40a51a49cc41a13922394 /fs/btrfs/ctree.c
parent17d217fe970d34720f4f1633dca73a6aa2f3d9d1 (diff)
downloadlinux-42dc7babdcc99feadb04d461592ce5898a362550.tar.xz
Btrfs: Fix compressed writes on truncated pages
The compression code was using isize to limit the amount of data it sent through zlib. But, it wasn't properly limiting the looping to just the pages inside i_size. The end result was trying to compress too many pages, including those that had not been setup and properly locked down. This made the compression code oops while trying find_get_page on a page that didn't exist. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index c0c95cc..f6f7a6a 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2887,8 +2887,8 @@ int btrfs_split_item(struct btrfs_trans_handle *trans,
path->keep_locks = 0;
BUG_ON(ret);
- BUG_ON(btrfs_leaf_free_space(root, leaf) < sizeof(struct btrfs_item));
leaf = path->nodes[0];
+ BUG_ON(btrfs_leaf_free_space(root, leaf) < sizeof(struct btrfs_item));
split:
item = btrfs_item_nr(leaf, path->slots[0]);