]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block/file-posix: fix workaround in raw_do_pwrite_zeroes()
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 3 Dec 2020 22:27:10 +0000 (01:27 +0300)
committerKevin Wolf <kwolf@redhat.com>
Fri, 11 Dec 2020 16:52:40 +0000 (17:52 +0100)
We should not set overlap_bytes:

1. Don't worry: it is calculated by bdrv_mark_request_serialising() and
   will be equal to or greater than bytes anyway.

2. If the request was already aligned up to some greater alignment,
   than we may break things: we reduce overlap_bytes, and further
   bdrv_mark_request_serialising() may not help, as it will not restore
   old bigger alignment.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20201203222713.13507-2-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/file-posix.c

index 806764f7e3c6e7648ea295a2b4820b7ba69a3920..9bee3d88d0d1706bea8c0eaa7665aa99416084c6 100644 (file)
@@ -2952,7 +2952,6 @@ raw_do_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int bytes,
 
         end = INT64_MAX & -(uint64_t)bs->bl.request_alignment;
         req->bytes = end - req->offset;
-        req->overlap_bytes = req->bytes;
 
         bdrv_mark_request_serialising(req, bs->bl.request_alignment);
     }