https://git.reactos.org/?p=reactos.git;a=commitdiff;h=90ac794bf284f4c2b78b5…
commit 90ac794bf284f4c2b78b532dc02fcf9275783209
Author: maharmstone <mark(a)harmstone.com>
AuthorDate: Tue Oct 8 15:50:58 2019 +0100
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Tue Oct 8 16:50:57 2019 +0200
[FREELDR] Handle Btrfs sparse extents (#1959)
---
boot/freeldr/freeldr/lib/fs/btrfs.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/boot/freeldr/freeldr/lib/fs/btrfs.c b/boot/freeldr/freeldr/lib/fs/btrfs.c
index aa12d0e066c..16a861427c4 100644
--- a/boot/freeldr/freeldr/lib/fs/btrfs.c
+++ b/boot/freeldr/freeldr/lib/fs/btrfs.c
@@ -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)
{