Btrfs: fix decompressing of snappy-compressed inline extents
PATCH 1/1 Btrfs: fix decompressing of snappy-compressed inline extents
The first four bytes is the length of all data chunks, and the first four bytes of each chunk is the length of compressed chunk data, even when there's only one chunk, which is the case for inline extents.
Signed-off-by Li Zefan <[email protected]>
--- fs/btrfs/snappy.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
fs/btrfs/snappy.c +4 -0
@@ -392,12 +392,16 @@ static int btrfs_snappy_decompress(struct list_head *ws, unsigned char *data_in, struct workspace *workspace = list_entry(ws, struct workspace, list);size_t in_len;size_t out_len; +size_t tot_len;int ret =0 ;char *kaddr;unsigned long bytes;BUG_ON (srclen <SNAPPY_LEN ); + tot_len =read_compress_length (data_in); + data_in +=SNAPPY_LEN ; + in_len =read_compress_length (data_in); data_in +=SNAPPY_LEN ;
Signature · 1 line
1.7.3.1