Skip to content

Commit

Permalink
block/file-posix: fix workaround in raw_do_pwrite_zeroes()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vladimir Sementsov-Ogievskiy authored and kevmw committed Dec 11, 2020
1 parent 7cc25f6 commit 9b100af
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion block/file-posix.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9b100af

Please sign in to comment.