[FREELDR] Handle Btrfs sparse extents (#1959)

This commit is contained in:
maharmstone 2019-10-08 15:50:58 +01:00 committed by Hermès BÉLUSCA - MAÏTO
parent 63e22b8287
commit 90ac794bf2

View file

@ -687,6 +687,13 @@ static u64 btrfs_read_extent_reg(struct btrfs_path *path, struct btrfs_file_exte
if (size > dlen - offset)
size = dlen - offset;
/* Handle sparse extent */
if (extent->disk_bytenr == 0 && extent->disk_num_bytes == 0)
{
RtlZeroMemory(out, size);
return size;
}
physical = logical_physical(extent->disk_bytenr);
if (physical == INVALID_ADDRESS)
{