[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/30] block/io.c: drop assertion on double waiting for request se
From: |
Max Reitz |
Subject: |
[PULL 06/30] block/io.c: drop assertion on double waiting for request serialisation |
Date: |
Fri, 18 Dec 2020 16:12:25 +0100 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
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>
---
block/io.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/block/io.c b/block/io.c
index 24205f5168..27370107b2 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1827,7 +1827,6 @@ bdrv_co_write_req_prepare(BdrvChild *child, int64_t
offset, uint64_t bytes,
BdrvTrackedRequest *req, int flags)
{
BlockDriverState *bs = child->bs;
- bool waited;
int64_t end_sector = DIV_ROUND_UP(offset + bytes, BDRV_SECTOR_SIZE);
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));
if (flags & BDRV_REQ_SERIALISING) {
- waited = 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));
+ bdrv_mark_request_serialising(req, bdrv_get_cluster_size(bs));
} else {
bdrv_wait_serialising_requests(req);
}
--
2.29.2
- [PULL 00/30] Block patches, Max Reitz, 2020/12/18
- [PULL 01/30] block: add bdrv_refresh_perms() helper, Max Reitz, 2020/12/18
- [PULL 03/30] block: bdrv_child_set_perm() drop redundant parameters., Max Reitz, 2020/12/18
- [PULL 02/30] block: bdrv_set_perm() drop redundant parameters., Max Reitz, 2020/12/18
- [PULL 04/30] block: drop tighten_restrictions, Max Reitz, 2020/12/18
- [PULL 06/30] block/io.c: drop assertion on double waiting for request serialisation,
Max Reitz <=
- [PULL 07/30] block/io: split out bdrv_find_conflicting_request, Max Reitz, 2020/12/18
- [PULL 08/30] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg, Max Reitz, 2020/12/18
- [PULL 09/30] block: bdrv_mark_request_serialising: split non-waiting function, Max Reitz, 2020/12/18
- [PULL 11/30] block: bdrv_check_perm(): process children anyway, Max Reitz, 2020/12/18
- [PULL 05/30] block: simplify comment to BDRV_REQ_SERIALISING, Max Reitz, 2020/12/18
- [PULL 10/30] block: introduce BDRV_REQ_NO_WAIT flag, Max Reitz, 2020/12/18
- [PULL 14/30] iotests: qemu_io_silent: support --image-opts, Max Reitz, 2020/12/18
- [PULL 13/30] qemu-io: add preallocate mode parameter for truncate command, Max Reitz, 2020/12/18
- [PULL 12/30] block: introduce preallocate filter, Max Reitz, 2020/12/18
- [PULL 15/30] iotests.py: execute_setup_common(): add required_fmts argument, Max Reitz, 2020/12/18