From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-block@nongnu.org, stefanha@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH] file-posix: Fix crash on discard_granularity == 0
Date: Wed, 30 Apr 2025 17:54:59 +0200 [thread overview]
Message-ID: <aBJH0yv2dLI40nYV@redhat.com> (raw)
In-Reply-To: <rszddhhx6nbqx3nvpnowdednlc5oa3nu5p4i7iv5yx6zfdsyh7@istyvqkqqzqq>
Am 29.04.2025 um 23:09 hat Eric Blake geschrieben:
> On Tue, Apr 29, 2025 at 05:56:54PM +0200, Kevin Wolf wrote:
> > 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>
> > ---
> > block/file-posix.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
> (Coverity has proven its worth, yet again)
Oh, interesting, you're right, Coverity flagged this, too. I got its
notification a few hours after sending the patch. :-)
I actually ran into this myself with an iscsi disk I used for testing
the multipath failover stuff.
Kevin
next prev parent reply other threads:[~2025-04-30 15:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 15:56 [PATCH] file-posix: Fix crash on discard_granularity == 0 Kevin Wolf
2025-04-29 21:09 ` Eric Blake
2025-04-30 15:54 ` Kevin Wolf [this message]
2025-04-30 15:37 ` Stefan Hajnoczi
2025-04-30 15:40 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aBJH0yv2dLI40nYV@redhat.com \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.