pagemap: detect EOF on truncated pages in process_async_reads()

Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
This commit is contained in:
Lorenzo Fontana 2026-02-20 09:06:14 +01:00 committed by Alexander Mikhalitsyn
parent f21a484253
commit d990bd76e8
No known key found for this signature in database
GPG key ID: B1F47F5CB05B4FA3

View file

@ -559,6 +559,12 @@ static int process_async_reads(struct page_read *pr)
return -1;
}
if (ret == 0 && piov->end != piov->from) {
pr_err("Unexpected EOF reading pages: expected %ju more bytes at offset %ju\n",
piov->end - piov->from, piov->from);
return -1;
}
if (opts.auto_dedup && punch_hole(pr, piov->from, ret, false))
return -1;