summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index c40060cc481f..231503935652 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6709,6 +6709,20 @@ static noinline int uncompress_inline(struct btrfs_path *path,
6709 max_size = min_t(unsigned long, PAGE_SIZE, max_size); 6709 max_size = min_t(unsigned long, PAGE_SIZE, max_size);
6710 ret = btrfs_decompress(compress_type, tmp, page, 6710 ret = btrfs_decompress(compress_type, tmp, page,
6711 extent_offset, inline_size, max_size); 6711 extent_offset, inline_size, max_size);
6712
6713 /*
6714 * decompression code contains a memset to fill in any space between the end
6715 * of the uncompressed data and the end of max_size in case the decompressed
6716 * data ends up shorter than ram_bytes. That doesn't cover the hole between
6717 * the end of an inline extent and the beginning of the next block, so we
6718 * cover that region here.
6719 */
6720
6721 if (max_size + pg_offset < PAGE_SIZE) {
6722 char *map = kmap(page);
6723 memset(map + pg_offset + max_size, 0, PAGE_SIZE - max_size - pg_offset);
6724 kunmap(page);
6725 }
6712 kfree(tmp); 6726 kfree(tmp);
6713 return ret; 6727 return ret;
6714} 6728}