Btrfs: Fix csum error for compressed data
authorYan Zheng <zheng.yan@oracle.com>
Mon, 10 Nov 2008 12:34:43 +0000 (07:34 -0500)
committerChris Mason <chris.mason@oracle.com>
Mon, 10 Nov 2008 12:34:43 +0000 (07:34 -0500)
commitff5b7ee33d82414bf4baf299c21fb703bcc89629
tree926786cf57b375e5ef1f865427c910c3d4bdfc7a
parentf2b1c41cf94d7f839fe9ede5f3ead92698a93fb3
Btrfs: Fix csum error for compressed data

The decompress code doesn't take the logical offset in extent
pointer into account. If the logical offset isn't zero, data
will be decompressed into wrong pages.

The solution used here is to record the starting offset of the extent
in the file separately from the logical start of the extent_map struct.
This allows us to avoid problems inserting overlapping extents.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
fs/btrfs/compression.c
fs/btrfs/extent_map.h
fs/btrfs/file.c
fs/btrfs/inode.c