[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 02/21] block/io.c: drop assertion on double waiting for reques
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v7 02/21] block/io.c: drop assertion on double waiting for request serialisation |
Date: |
Wed, 21 Oct 2020 17:58:40 +0300 |
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>
---
block/io.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/block/io.c b/block/io.c
index 54f0968aee..bf6d4d5e77 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1784,7 +1784,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) {
@@ -1796,15 +1795,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.21.3
- [PATCH v7 00/21] preallocate filter, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 02/21] block/io.c: drop assertion on double waiting for request serialisation,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v7 01/21] block: simplify comment to BDRV_REQ_SERIALISING, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 03/21] block/io: split out bdrv_find_conflicting_request, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 04/21] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 05/21] block: bdrv_mark_request_serialising: split non-waiting function, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 06/21] block: introduce BDRV_REQ_NO_WAIT flag, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 14/21] scripts/simplebench: support iops, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 08/21] block: introduce preallocate filter, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 09/21] qemu-io: add preallocate mode parameter for truncate command, Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 16/21] simplebench: rename ascii() to results_to_text(), Vladimir Sementsov-Ogievskiy, 2020/10/21
- [PATCH v7 07/21] block: bdrv_check_perm(): process children anyway, Vladimir Sementsov-Ogievskiy, 2020/10/21