OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 0/2] dm-qcow2, dm-ploop: do not merge discards with gaps
@ 2026-11-09 15:36 Andrey Zhadchenko
  2026-11-09 15:36 ` [Devel] [PATCH hci-8.1 1/2] dm-qcow2: set max discard segments to one Andrey Zhadchenko
  2026-11-09 15:36 ` [Devel] [PATCH hci-8.1 2/2] dm-ploop: " Andrey Zhadchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Andrey Zhadchenko @ 2026-11-09 15:36 UTC (permalink / raw)
  To: khorenko, alexander.ivanov; +Cc: devel

The block layer may merge non-contiguous discard bios into a single
request when the queue allows more than one discard segment, and the
stacking default for dm is max_discard_segments = USHRT_MAX.

Both dm-qcow2 and dm-ploop handle a discard request as one contiguous
range taken from blk_rq_pos() and blk_rq_bytes(). For a request built
from bios [0, 512) and [1024, 1536) they discard [0, 1024), which hits
sectors that were never asked to be discarded and misses part of the
range that was.

Set max_discard_segments to 1 in both targets so each discard request
always describes a single contiguous range.

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

Andrey Zhadchenko (2):
  dm-qcow2: set max discard segments to one
  dm-ploop: set max discard segments to one

 drivers/md/dm-ploop-target.c | 1 +
 drivers/md/dm-qcow2-target.c | 1 +
 2 files changed, 2 insertions(+)

-- 
2.43.5

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

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

end of thread, other threads:[~2026-11-09 15:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 15:36 [Devel] [PATCH hci-8.1 0/2] dm-qcow2, dm-ploop: do not merge discards with gaps Andrey Zhadchenko
2026-11-09 15:36 ` [Devel] [PATCH hci-8.1 1/2] dm-qcow2: set max discard segments to one Andrey Zhadchenko
2026-11-09 15:44   ` no-reply
2026-11-09 15:36 ` [Devel] [PATCH hci-8.1 2/2] dm-ploop: " Andrey Zhadchenko
2026-11-09 15:44   ` no-reply

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox