All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.2 v2 0/2] dm-qcow2: fix a read livelock at EOF of a read-only image
@ 2026-11-19 12:51 Denis V. Lunev
  2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 1/2] dm-qcow2: zero qio pages with memzero_page() instead of kmap() Denis V. Lunev
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Denis V. Lunev @ 2026-11-19 12:51 UTC (permalink / raw)
  To: alexander.ivanov, vasileios.almpanis; +Cc: devel

A read-only image whose file ends mid-page, such as a lower image made
by qemu-img convert -c, livelocks the dm-qcow2 worker on the first read
of its last compressed cluster. The fix zeroes the missing tail in the
read completion, so the zeroing helper first stops using kmap(), which
may sleep.

https://virtuozzo.atlassian.net/browse/VSTOR-155987

Tested in an HCI 8.2 VM: the livelock reproduces on stock and not with
the series, the debug kernel no longer warns about sleeping in atomic
context from either zeroing path, and the ploop test suite passes in
qcow2 and ploop formats.

v2: zero with memzero_page() in a separate patch, reword the message.
v1: http://lore.virtuozzo.com/kernel/20261119114802.765703-1-den@openvz.org/

Denis V. Lunev (2):
  dm-qcow2: zero qio pages with memzero_page() instead of kmap()
  dm-qcow2: fix a read livelock at EOF of a read-only image

 drivers/md/dm-qcow2-map.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

-- 
2.55.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Devel] [PATCH hci-8.2 v2 1/2] dm-qcow2: zero qio pages with memzero_page() instead of kmap()
  2026-11-19 12:51 [Devel] [PATCH hci-8.2 v2 0/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
@ 2026-11-19 12:51 ` Denis V. Lunev
  2026-11-19 12:56   ` no-reply
  2026-11-19 16:38   ` Konstantin Khorenko
  2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 12+ messages in thread
From: Denis V. Lunev @ 2026-11-19 12:51 UTC (permalink / raw)
  To: alexander.ivanov, vasileios.almpanis; +Cc: devel

From: Denis V. Lunev <den@openvz.org>

zero_fill_iter_bvec() maps each page with kmap(), which may sleep, but
parse_l2() calls it through perform_zero_read() with md_pages_lock
held: a read of a cluster whose L2 entry is dirty or under writeback
reads as zeroes. A debug kernel then prints "BUG: sleeping function
called from invalid context" from the dm-qcow2 worker.

The loop also walks multi-page bvecs and clears across page boundaries
through the mapping of the first page, which works only without
highmem.

Walk single-page segments and clear each with memzero_page().

https://virtuozzo.atlassian.net/browse/VSTOR-155987

Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
Feature: dm-qcow2: block device over QCOW2 files driver
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 drivers/md/dm-qcow2-map.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 32373114580e..c7e186fa6115 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -283,9 +283,7 @@ static void zero_fill_iter_bvec(struct bvec_iter *bi_iter, struct bio_vec *bi_io
 	struct bio_vec bv;
 	u32 bytes;
 
-	qcow2_for_each_bvec(iter, bv, *bi_iter, bi_io_vec) {
-		void *data;
-
+	for_each_bvec(bv, bi_io_vec, iter, *bi_iter) {
 		if (!count)
 			break;
 		if (from >= bv.bv_len) {
@@ -297,10 +295,7 @@ static void zero_fill_iter_bvec(struct bvec_iter *bi_iter, struct bio_vec *bi_io
 		if (bytes > count)
 			bytes = count;
 
-		data = kmap(bv.bv_page);
-		memset(data + bv.bv_offset + from, 0, bytes);
-		flush_dcache_page(bv.bv_page);
-		kunmap(bv.bv_page);
+		memzero_page(bv.bv_page, bv.bv_offset + from, bytes);
 		from = 0;
 		count -= bytes;
 	}
-- 
2.55.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image
  2026-11-19 12:51 [Devel] [PATCH hci-8.2 v2 0/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
  2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 1/2] dm-qcow2: zero qio pages with memzero_page() instead of kmap() Denis V. Lunev
@ 2026-11-19 12:51 ` Denis V. Lunev
  2026-11-19 12:58   ` no-reply
                     ` (2 more replies)
  2026-11-19 15:25 ` [Devel] [PATCH hci-8.2 v2 0/2] " Alexander Ivanov
                   ` (2 subsequent siblings)
  4 siblings, 3 replies; 12+ messages in thread
From: Denis V. Lunev @ 2026-11-19 12:51 UTC (permalink / raw)
  To: alexander.ivanov, vasileios.almpanis; +Cc: devel

From: Denis V. Lunev <den@openvz.org>

submit_read_compressed() reads a compressed cluster up to a page
boundary, and qcow2_parse_header() pads the file to a page only when
the image is writable. On a read-only image whose file ends mid-page
on a sector boundary, as qemu-img convert -c leaves a lower image, that
read runs past EOF and comes back short.

data_rw_complete() takes the short read for partial I/O and resubmits
the rest. The resubmit starts at EOF, reads 0 bytes, trips
WARN_ON_ONCE(qio->ret == 0) in data_rw_complete() and is resubmitted
forever.

The worker spins, and the first reader of the device, usually udev or
partprobe at mount, never returns.

Accept a short read that ends at EOF of a read-only image less than a
page short, the padding such an image lacks, and zero the rest, as
md_page_read_complete() does for metadata. The zeroing runs in the I/O
completion, which the previous patch made safe. End a read that
returns 0 bytes with -EIO instead of resubmitting it, which also covers
an L2 entry that points at or past EOF.

https://virtuozzo.atlassian.net/browse/VSTOR-155987

Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
Feature: dm-qcow2: block device over QCOW2 files driver
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 drivers/md/dm-qcow2-map.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index c7e186fa6115..cf66b9a98085 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -3012,13 +3012,21 @@ static void data_rw_complete(struct qio *qio)
 	unsigned long flags;
 
 	if (unlikely(qio->ret != qio->bi_iter.bi_size)) {
-		if (qio->ret >= 0) {
+		if (!write && qio->ret > 0 && !qcow2_file_is_writable(qcow2) &&
+		    to_bytes(qio->bi_iter.bi_sector) + qio->ret == qcow2->file_size &&
+		    qio->bi_iter.bi_size - qio->ret < PAGE_SIZE) {
+			/* Read near EOF, same as md_page_read_complete() */
+			zero_fill_qio(qio, qio->ret, qio->bi_iter.bi_size - qio->ret);
+		} else if (!write && qio->ret == 0) {
+			bi_status = BLK_STS_IOERR;
+		} else if (qio->ret >= 0) {
 			WARN_ON_ONCE(qio->ret == 0);
 			qio_advance(qio, qio->ret);
 			qcow2_queue_resubmit(qio);
 			return;
+		} else {
+			bi_status = errno_to_blk_status(qio->ret);
 		}
-		bi_status = errno_to_blk_status(qio->ret);
 	}
 
 	if (qio->writer_md)
-- 
2.55.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 v2 1/2] dm-qcow2: zero qio pages with memzero_page() instead of kmap()
  2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 1/2] dm-qcow2: zero qio pages with memzero_page() instead of kmap() Denis V. Lunev
@ 2026-11-19 12:56   ` no-reply
  2026-11-19 16:38   ` Konstantin Khorenko
  1 sibling, 0 replies; 12+ messages in thread
From: no-reply @ 2026-11-19 12:56 UTC (permalink / raw)
  To: Denis V. Lunev, alexander.ivanov, vasileios.almpanis; +Cc: devel

> From: Denis V. Lunev <den@openvz.org>
> 
> zero_fill_iter_bvec() maps each page with kmap(), which may sleep, but
> parse_l2() calls it through perform_zero_read() with md_pages_lock
> held: a read of a cluster whose L2 entry is dirty or under writeback
> reads as zeroes. A debug kernel then prints "BUG: sleeping function
> called from invalid context" from the dm-qcow2 worker.
> 
> The loop also walks multi-page bvecs and clears across page boundaries
> through the mapping of the first page, which works only without
> highmem.
> 
> Walk single-page segments and clear each with memzero_page().
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-155987
> 
> Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
> Feature: dm-qcow2: block device over QCOW2 files driver
> Signed-off-by: Denis V. Lunev <den@openvz.org>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261119125121.861804-1-den@openvz.org?part=1


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image
  2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
@ 2026-11-19 12:58   ` no-reply
  2026-11-19 13:35   ` Alexander Ivanov
  2026-11-19 16:38   ` Konstantin Khorenko
  2 siblings, 0 replies; 12+ messages in thread
From: no-reply @ 2026-11-19 12:58 UTC (permalink / raw)
  To: Denis V. Lunev, alexander.ivanov, vasileios.almpanis; +Cc: devel

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dm-qcow2: EOF short-read zero-fill in data_rw_complete() is not
  limited to compressed reads
--

commit c25b34c5c45200dab6bd4dd82cb5bf43dc324b92
Author: Denis V. Lunev <den@openvz.org>

dm-qcow2: fix a read livelock at EOF of a read-only image

data_rw_complete() now accepts a short read that ends at EOF of a read-only image, less than a page short, and zeroes the rest. A read that returns 0 bytes now ends with -EIO instead of being resubmitted.

> diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
> index c7e186fa6115..cf66b9a98085 100644
> --- a/drivers/md/dm-qcow2-map.c
> +++ b/drivers/md/dm-qcow2-map.c
> @@ -3012,13 +3012,21 @@ static void data_rw_complete(struct qio *qio)
>  	unsigned long flags;
>  
>  	if (unlikely(qio->ret != qio->bi_iter.bi_size)) {
> -		if (qio->ret >= 0) {
> +		if (!write && qio->ret > 0 && !qcow2_file_is_writable(qcow2) &&
> +		    to_bytes(qio->bi_iter.bi_sector) + qio->ret == qcow2->file_size &&
> +		    qio->bi_iter.bi_size - qio->ret < PAGE_SIZE) {
> +			/* Read near EOF, same as md_page_read_complete() */
> +			zero_fill_qio(qio, qio->ret, qio->bi_iter.bi_size - qio->ret);

[Severity: Low]
Is this branch meant to apply to every read that completes through data_rw_complete()?

The commit message justifies it only by the page rounding in submit_read_compressed(). The condition checks only !write, ret > 0, a read-only image, the end of the read at file_size, and a shortfall below PAGE_SIZE. It does not identify a compressed read. data_rw_complete() is also the completion for plain data reads and whole-COW reads.

On a truncated or corrupt read-only image, one of those reads that ends exactly at EOF and is less than a page short used to be resubmitted. It now completes with BLK_STS_OK and up to 4095 bytes of zeros in place of data. Could the branch be limited to the compressed read, or to a read whose requested end is the page-rounded EOF?

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261119125121.861804-1-den@openvz.org?part=2

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image
  2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
  2026-11-19 12:58   ` no-reply
@ 2026-11-19 13:35   ` Alexander Ivanov
  2026-11-19 14:44     ` Denis V. Lunev
  2026-11-19 16:38   ` Konstantin Khorenko
  2 siblings, 1 reply; 12+ messages in thread
From: Alexander Ivanov @ 2026-11-19 13:35 UTC (permalink / raw)
  To: Denis V. Lunev, vasileios.almpanis; +Cc: devel


On 11/19/26 13:51, Denis V. Lunev wrote:
> From: Denis V. Lunev <den@openvz.org>
>
> submit_read_compressed() reads a compressed cluster up to a page
> boundary, and qcow2_parse_header() pads the file to a page only when
> the image is writable. On a read-only image whose file ends mid-page
> on a sector boundary, as qemu-img convert -c leaves a lower image, that
> read runs past EOF and comes back short.
>
> data_rw_complete() takes the short read for partial I/O and resubmits
> the rest. The resubmit starts at EOF, reads 0 bytes, trips
> WARN_ON_ONCE(qio->ret == 0) in data_rw_complete() and is resubmitted
> forever.
>
> The worker spins, and the first reader of the device, usually udev or
> partprobe at mount, never returns.
>
> Accept a short read that ends at EOF of a read-only image less than a
> page short, the padding such an image lacks, and zero the rest, as
> md_page_read_complete() does for metadata. The zeroing runs in the I/O
> completion, which the previous patch made safe. End a read that
> returns 0 bytes with -EIO instead of resubmitting it, which also covers
> an L2 entry that points at or past EOF.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-155987
>
> Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
> Feature: dm-qcow2: block device over QCOW2 files driver
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> ---
>   drivers/md/dm-qcow2-map.c | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
> index c7e186fa6115..cf66b9a98085 100644
> --- a/drivers/md/dm-qcow2-map.c
> +++ b/drivers/md/dm-qcow2-map.c
> @@ -3012,13 +3012,21 @@ static void data_rw_complete(struct qio *qio)
>   	unsigned long flags;
>   
>   	if (unlikely(qio->ret != qio->bi_iter.bi_size)) {
> -		if (qio->ret >= 0) {
> +		if (!write && qio->ret > 0 && !qcow2_file_is_writable(qcow2) &&
> +		    to_bytes(qio->bi_iter.bi_sector) + qio->ret == qcow2->file_size &&
> +		    qio->bi_iter.bi_size - qio->ret < PAGE_SIZE) {
> +			/* Read near EOF, same as md_page_read_complete() */
> +			zero_fill_qio(qio, qio->ret, qio->bi_iter.bi_size - qio->ret);
> +		} else if (!write && qio->ret == 0) {
Writes still keep WARN_ON_ONCE(qio->ret == 0) and the resubmit, so a 
write that returns 0
would loop the same way. Can writes actually have 0 here?
> +			bi_status = BLK_STS_IOERR;
> +		} else if (qio->ret >= 0) {
>   			WARN_ON_ONCE(qio->ret == 0);
>   			qio_advance(qio, qio->ret);
>   			qcow2_queue_resubmit(qio);
>   			return;
> +		} else {
> +			bi_status = errno_to_blk_status(qio->ret);
>   		}
> -		bi_status = errno_to_blk_status(qio->ret);
>   	}
>   
>   	if (qio->writer_md)
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image
  2026-11-19 13:35   ` Alexander Ivanov
@ 2026-11-19 14:44     ` Denis V. Lunev
  0 siblings, 0 replies; 12+ messages in thread
From: Denis V. Lunev @ 2026-11-19 14:44 UTC (permalink / raw)
  To: Alexander Ivanov, Denis V. Lunev, vasileios.almpanis; +Cc: devel

On 11/19/26 14:35, Alexander Ivanov wrote:
> On 11/19/26 13:51, Denis V. Lunev wrote:
>> From: Denis V. Lunev <den@openvz.org>
>>
>> submit_read_compressed() reads a compressed cluster up to a page
>> boundary, and qcow2_parse_header() pads the file to a page only when
>> the image is writable. On a read-only image whose file ends mid-page
>> on a sector boundary, as qemu-img convert -c leaves a lower image, that
>> read runs past EOF and comes back short.
>>
>> data_rw_complete() takes the short read for partial I/O and resubmits
>> the rest. The resubmit starts at EOF, reads 0 bytes, trips
>> WARN_ON_ONCE(qio->ret == 0) in data_rw_complete() and is resubmitted
>> forever.
>>
>> The worker spins, and the first reader of the device, usually udev or
>> partprobe at mount, never returns.
>>
>> Accept a short read that ends at EOF of a read-only image less than a
>> page short, the padding such an image lacks, and zero the rest, as
>> md_page_read_complete() does for metadata. The zeroing runs in the I/O
>> completion, which the previous patch made safe. End a read that
>> returns 0 bytes with -EIO instead of resubmitting it, which also covers
>> an L2 entry that points at or past EOF.
>>
>> https://virtuozzo.atlassian.net/browse/VSTOR-155987
>>
>> Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
>> Feature: dm-qcow2: block device over QCOW2 files driver
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> ---
>>   drivers/md/dm-qcow2-map.c | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
>> index c7e186fa6115..cf66b9a98085 100644
>> --- a/drivers/md/dm-qcow2-map.c
>> +++ b/drivers/md/dm-qcow2-map.c
>> @@ -3012,13 +3012,21 @@ static void data_rw_complete(struct qio *qio)
>>   	unsigned long flags;
>>   
>>   	if (unlikely(qio->ret != qio->bi_iter.bi_size)) {
>> -		if (qio->ret >= 0) {
>> +		if (!write && qio->ret > 0 && !qcow2_file_is_writable(qcow2) &&
>> +		    to_bytes(qio->bi_iter.bi_sector) + qio->ret == qcow2->file_size &&
>> +		    qio->bi_iter.bi_size - qio->ret < PAGE_SIZE) {
>> +			/* Read near EOF, same as md_page_read_complete() */
>> +			zero_fill_qio(qio, qio->ret, qio->bi_iter.bi_size - qio->ret);
>> +		} else if (!write && qio->ret == 0) {
> Writes still keep WARN_ON_ONCE(qio->ret == 0) and the resubmit, so a 
> write that returns 0
> would loop the same way. Can writes actually have 0 here?
On ext4, no. When iomap fails to invalidate the page cache it turns
-ENOTBLK into 0, but ext4_dio_write_iter() then writes the rest
through the page cache and returns the full count.

On xfs, yes. xfs falls back to buffered I/O only for a reflink CoW, so
after a failed invalidation xfs_file_dio_write() returns the 0 from
iomap_dio_rw() as is. That needs someone else to have the image cached,
and it is transient: the resubmit makes progress once the pages are
gone. So resubmitting a write is right, while a read at EOF returns 0
for good, which is why the patch only changes reads.

What is wrong for writes is the WARN_ON_ONCE() in front of the
resubmit: with panic_on_warn it panics the host. That is older than
this series and not related to the EOF livelock, so I will fix it
separately rather than grow this patch.
 
Den
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 v2 0/2] dm-qcow2: fix a read livelock at EOF of a read-only image
  2026-11-19 12:51 [Devel] [PATCH hci-8.2 v2 0/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
  2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 1/2] dm-qcow2: zero qio pages with memzero_page() instead of kmap() Denis V. Lunev
  2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
@ 2026-11-19 15:25 ` Alexander Ivanov
  2026-11-19 16:38 ` Konstantin Khorenko
  2026-11-19 16:38 ` Konstantin Khorenko
  4 siblings, 0 replies; 12+ messages in thread
From: Alexander Ivanov @ 2026-11-19 15:25 UTC (permalink / raw)
  To: Denis V. Lunev, vasileios.almpanis; +Cc: devel

LGTM
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 v2 0/2] dm-qcow2: fix a read livelock at EOF of a read-only image
  2026-11-19 12:51 [Devel] [PATCH hci-8.2 v2 0/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
                   ` (2 preceding siblings ...)
  2026-11-19 15:25 ` [Devel] [PATCH hci-8.2 v2 0/2] " Alexander Ivanov
@ 2026-11-19 16:38 ` Konstantin Khorenko
  2026-11-19 16:38 ` Konstantin Khorenko
  4 siblings, 0 replies; 12+ messages in thread
From: Konstantin Khorenko @ 2026-11-19 16:38 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: devel

Applying the series as is, all v1 items are done, thanks.

Separate patches, not needed for this series. I created a task for it:

1. parse_l2() zero-fills a read of a cluster whose L2 entry is dirty
   or under writeback. The SEEK_DATA/SEEK_HOLE qio from
   alloc_seek_qio() is such a read with bi_io_vec == NULL, so a seek
   in parallel with a write that allocates that cluster walks a NULL
   bvec array (images without extended L2).
   https://virtuozzo.atlassian.net/browse/VSTOR-156079

On Thu, 19 Nov 2026 13:51:19 +0100, Denis V. Lunev wrote:
> v2: zero with memzero_page() in a separate patch, reword the message.

Thanks.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 v2 1/2] dm-qcow2: zero qio pages with memzero_page() instead of kmap()
  2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 1/2] dm-qcow2: zero qio pages with memzero_page() instead of kmap() Denis V. Lunev
  2026-11-19 12:56   ` no-reply
@ 2026-11-19 16:38   ` Konstantin Khorenko
  1 sibling, 0 replies; 12+ messages in thread
From: Konstantin Khorenko @ 2026-11-19 16:38 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: devel

Applying as is.

On Thu, 19 Nov 2026 13:51:20 +0100, Denis V. Lunev wrote:
> Walk single-page segments and clear each with memzero_page().

Thanks.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image
  2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
  2026-11-19 12:58   ` no-reply
  2026-11-19 13:35   ` Alexander Ivanov
@ 2026-11-19 16:38   ` Konstantin Khorenko
  2 siblings, 0 replies; 12+ messages in thread
From: Konstantin Khorenko @ 2026-11-19 16:38 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: devel

Applying as is.

On Thu, 19 Nov 2026 13:51:21 +0100, Denis V. Lunev wrote:
> Accept a short read that ends at EOF of a read-only image less than a
> page short, the padding such an image lacks, and zero the rest, as

On Sashiko's remark that this is not limited to compressed reads: a
plain data read ending less than a page past EOF used to livelock or
fail too, and qemu zero-fills short reads at EOF the same way.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] [PATCH hci-8.2 v2 0/2] dm-qcow2: fix a read livelock at EOF of a read-only image
  2026-11-19 12:51 [Devel] [PATCH hci-8.2 v2 0/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
                   ` (3 preceding siblings ...)
  2026-11-19 16:38 ` Konstantin Khorenko
@ 2026-11-19 16:38 ` Konstantin Khorenko
  4 siblings, 0 replies; 12+ messages in thread
From: Konstantin Khorenko @ 2026-11-19 16:38 UTC (permalink / raw)
  To: alexander.ivanov, vasileios.almpanis, Denis V. Lunev; +Cc: devel

On Thu, 19 Nov 2026 13:51:19 +0100, Denis V. Lunev wrote:
> dm-qcow2: fix a read livelock at EOF of a read-only image
> 
> A read-only image whose file ends mid-page, such as a lower image made
> by qemu-img convert -c, livelocks the dm-qcow2 worker on the first read
> of its last compressed cluster. The fix zeroes the missing tail in the
> read completion, so the zeroing helper first stops using kmap(), which
> may sleep.
> 
> [...]

Applied to branch-rh10-6.12.0-211.75.1.26.x.vz10-ovz, will be released in rh10-6.12.0-211.75.1.26.4.vz10, thanks!

[1/2] dm-qcow2: zero qio pages with memzero_page() instead of kmap()
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/f126ffac5d5f
[2/2] dm-qcow2: fix a read livelock at EOF of a read-only image
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/3426123235f7

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-11-19 16:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 12:51 [Devel] [PATCH hci-8.2 v2 0/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 1/2] dm-qcow2: zero qio pages with memzero_page() instead of kmap() Denis V. Lunev
2026-11-19 12:56   ` no-reply
2026-11-19 16:38   ` Konstantin Khorenko
2026-11-19 12:51 ` [Devel] [PATCH hci-8.2 v2 2/2] dm-qcow2: fix a read livelock at EOF of a read-only image Denis V. Lunev
2026-11-19 12:58   ` no-reply
2026-11-19 13:35   ` Alexander Ivanov
2026-11-19 14:44     ` Denis V. Lunev
2026-11-19 16:38   ` Konstantin Khorenko
2026-11-19 15:25 ` [Devel] [PATCH hci-8.2 v2 0/2] " Alexander Ivanov
2026-11-19 16:38 ` Konstantin Khorenko
2026-11-19 16:38 ` Konstantin Khorenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.