mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
block/io.c: drop assertion on double waiting for request serialisation
The comments states, that on misaligned request we should have already been waiting. But for bdrv_padding_rmw_read, we called bdrv_mark_request_serialising with align = request_alignment, and now we serialise with align = cluster_size. So we may have to wait again with larger alignment. Note, that the only user of BDRV_REQ_SERIALISING is backup which issues cluster-aligned requests, so seems the assertion should not fire for now. But it's wrong anyway. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201021145859.11201-3-vsementsov@virtuozzo.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
2153994e2e
commit
2e36da62cf
1 changed files with 1 additions and 10 deletions
11
block/io.c
11
block/io.c
|
@ -1827,7 +1827,6 @@ bdrv_co_write_req_prepare(BdrvChild *child, int64_t offset, uint64_t bytes,
|
||||||
BdrvTrackedRequest *req, int flags)
|
BdrvTrackedRequest *req, int flags)
|
||||||
{
|
{
|
||||||
BlockDriverState *bs = child->bs;
|
BlockDriverState *bs = child->bs;
|
||||||
bool waited;
|
|
||||||
int64_t end_sector = DIV_ROUND_UP(offset + bytes, BDRV_SECTOR_SIZE);
|
int64_t end_sector = DIV_ROUND_UP(offset + bytes, BDRV_SECTOR_SIZE);
|
||||||
|
|
||||||
if (bs->read_only) {
|
if (bs->read_only) {
|
||||||
|
@ -1839,15 +1838,7 @@ bdrv_co_write_req_prepare(BdrvChild *child, int64_t offset, uint64_t bytes,
|
||||||
assert(!(flags & ~BDRV_REQ_MASK));
|
assert(!(flags & ~BDRV_REQ_MASK));
|
||||||
|
|
||||||
if (flags & BDRV_REQ_SERIALISING) {
|
if (flags & BDRV_REQ_SERIALISING) {
|
||||||
waited = bdrv_mark_request_serialising(req, bdrv_get_cluster_size(bs));
|
bdrv_mark_request_serialising(req, bdrv_get_cluster_size(bs));
|
||||||
/*
|
|
||||||
* For a misaligned request we should have already waited earlier,
|
|
||||||
* because we come after bdrv_padding_rmw_read which must be called
|
|
||||||
* with the request already marked as serialising.
|
|
||||||
*/
|
|
||||||
assert(!waited ||
|
|
||||||
(req->offset == req->overlap_offset &&
|
|
||||||
req->bytes == req->overlap_bytes));
|
|
||||||
} else {
|
} else {
|
||||||
bdrv_wait_serialising_requests(req);
|
bdrv_wait_serialising_requests(req);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue