diff options
author | Kevin Wolf <kwolf@redhat.com> | 2025-04-29 17:56:54 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2025-04-30 11:40:05 -0400 |
commit | 71a30d54e6ab1d5c102a8bee2c263414697402ea (patch) | |
tree | 692e760bbc1ff8a24f6e3bced5019ef9c8dedf37 /hw/pci-host/uninorth.c | |
parent | 73d29ea2417b58ca55fba1aa468ba38e3607b583 (diff) | |
download | qemu-71a30d54e6ab1d5c102a8bee2c263414697402ea.zip qemu-71a30d54e6ab1d5c102a8bee2c263414697402ea.tar.gz qemu-71a30d54e6ab1d5c102a8bee2c263414697402ea.tar.bz2 |
file-posix: Fix crash on discard_granularity == 0
Block devices that don't support discard have a discard_granularity of
0. Currently, this results in a division by zero when we try to make
sure that it's a multiple of request_alignment. Only try to update
bs->bl.pdiscard_alignment when we got a non-zero discard_granularity
from sysfs.
Fixes: f605796aae4 ('file-posix: probe discard alignment on Linux block devices')
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20250429155654.102735-1-kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/pci-host/uninorth.c')
0 files changed, 0 insertions, 0 deletions