Discard is a special type of request that can have non-contiguous
bios.
Imagine we have a request with starting sector 0 and length 1024,
so read or write means [0, 1024) range in the file. For discard this
request can have 2 bios [0, 512) and [1024, 1536), but we always
discarded [0, 1024).
Set max_discard_segments to 1 to avoid such merges.

https://virtuozzo.atlassian.net/browse/VSTOR-154159
Fixes: 6ddad5a4d226 ("dm-ploop: Add ploop target driver")
Feature: dm-ploop: ploop target driver
Signed-off-by: Andrey Zhadchenko <[email protected]>
---
 drivers/md/dm-ploop-target.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index d8279c79ef56d..b1f502d664447 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -661,6 +661,7 @@ static void ploop_io_hints(struct dm_target *ti, struct 
queue_limits *limits)
        limits->max_hw_discard_sectors = CLU_TO_SEC(ploop, 1);
        limits->discard_granularity = CLU_SIZE(ploop);
        limits->discard_alignment = 0;
+       limits->max_discard_segments = 1;
 
        limits->fua = BLK_NO_FUA;
 }
-- 
2.43.5

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to