diff options
author | Fabian Ebner <f.ebner@proxmox.com> | 2022-05-20 09:59:22 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-06-24 17:07:06 +0200 |
commit | 9b38fc56c054c7de65fa3bf7cdd82b32654f6b7d (patch) | |
tree | 576d9e62b7d91225cffd71f586ea98c6a2be5fbd /util/aio-wait.c | |
parent | 66dc5f9606bec7ce029e98a90f209153dfade82e (diff) | |
download | qemu-9b38fc56c054c7de65fa3bf7cdd82b32654f6b7d.zip qemu-9b38fc56c054c7de65fa3bf7cdd82b32654f6b7d.tar.gz qemu-9b38fc56c054c7de65fa3bf7cdd82b32654f6b7d.tar.bz2 |
block/gluster: correctly set max_pdiscard
On 64-bit platforms, assigning SIZE_MAX to the int64_t max_pdiscard
results in a negative value, and the following assertion would trigger
down the line (it's not the same max_pdiscard, but computed from the
other one):
qemu-system-x86_64: ../block/io.c:3166: bdrv_co_pdiscard: Assertion
`max_pdiscard >= bs->bl.request_alignment' failed.
On 32-bit platforms, it's fine to keep using SIZE_MAX.
The assertion in qemu_gluster_co_pdiscard() is checking that the value
of 'bytes' can safely be passed to glfs_discard_async(), which takes a
size_t for the argument in question, so it is kept as is. And since
max_pdiscard is still <= SIZE_MAX, relying on max_pdiscard is still
fine.
Fixes: 0c8022876f ("block: use int64_t instead of int in driver discard handlers")
Cc: qemu-stable@nongnu.org
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Message-Id: <20220520075922.43972-1-f.ebner@proxmox.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'util/aio-wait.c')
0 files changed, 0 insertions, 0 deletions