On 01.10.24 19:28, Michael Tokarev wrote:
30.09.2024 11:43, Vladimir Sementsov-Ogievskiy wrote:
From: Fiona Ebner <f.eb...@proxmox.com>
Allow overlapping request by removing the assert that made it
impossible. There are only two callers:
1. block_copy_task_create()
It already asserts the very same condition before calling
reqlist_init_req().
2. cbw_snapshot_read_lock()
There is no need to have read requests be non-overlapping in
copy-before-write when used for snapshot-access. In fact, there was no
protection against two callers of cbw_snapshot_read_lock() calling
reqlist_init_req() with overlapping ranges and this could lead to an
assertion failure [1].
In particular, with the reproducer script below [0], two
cbw_co_snapshot_block_status() callers could race, with the second
calling reqlist_init_req() before the first one finishes and removes
its conflicting request.
Hm. This one applies to 7.2 too (current oldest stable series), with
the description above matching what the code is doing.
I picked it up for up to 7.2. Please let me know if this shouldn't be
done :)
I don't see any problems) Still, that's not a guarantee that we don't have
them. At least, we definitely lack a test for this case.
--
Best regards,
Vladimir