diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5f805bc944fad00127cf812a922e54ccd9f7b396..24dfa27a4f76f03bf35dc3292cb7f7738a10baf9 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6086,16 +6086,8 @@ static noinline int uncompress_inline(struct btrfs_path *path, max_size = min_t(unsigned long, PAGE_CACHE_SIZE, max_size); ret = btrfs_decompress(compress_type, tmp, page, extent_offset, inline_size, max_size); - if (ret) { - char *kaddr = kmap_atomic(page); - unsigned long copy_size = min_t(u64, - PAGE_CACHE_SIZE - pg_offset, - max_size - extent_offset); - memset(kaddr + pg_offset, 0, copy_size); - kunmap_atomic(kaddr); - } kfree(tmp); - return 0; + return ret; } /* @@ -6296,7 +6288,10 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, ret = uncompress_inline(path, inode, page, pg_offset, extent_offset, item); - BUG_ON(ret); /* -ENOMEM */ + if (ret) { + err = ret; + goto out; + } } else { map = kmap(page); read_extent_buffer(leaf, map + pg_offset, ptr,