All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fiona Ebner <f.ebner@proxmox.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org, hreitz@redhat.com,
	fam@euphon.net
Subject: Re: [RFC v2 0/6] block/io: avoid failure caused by misaligned BLKZEROOUT ioctl
Date: Thu, 28 May 2026 09:26:21 -0400	[thread overview]
Message-ID: <20260528132621.GA40266@fedora> (raw)
In-Reply-To: <800f05f8-e77a-496b-8a25-253ad7cafecb@proxmox.com>

[-- Attachment #1: Type: text/plain, Size: 3788 bytes --]

On Thu, May 28, 2026 at 10:32:32AM +0200, Fiona Ebner wrote:
> Am 27.05.26 um 11:06 PM schrieb Stefan Hajnoczi:
> > On Thu, Feb 5, 2026 at 11:03 AM Kevin Wolf <kwolf@redhat.com> wrote:
> >>
> >> Am 05.02.2026 um 13:13 hat Fiona Ebner geschrieben:
> >>> Hi Stefan,
> >>>
> >>> Am 02.02.26 um 11:15 PM schrieb Stefan Hajnoczi:
> >>>> On Fri, Jan 09, 2026 at 01:08:27PM +0100, Fiona Ebner wrote:
> >>>>> Previous discussion here:
> >>>>> https://lore.kernel.org/qemu-devel/20260105143416.737482-1-f.ebner@proxmox.com/
> >>>>>
> >>>>> Commit 5634622bcb ("file-posix: allow BLKZEROOUT with -t writeback")
> >>>>> enables the BLKZEROOUT ioctl when using 'writeback' cache, regressing
> >>>>> certain 'qemu-img convert' invocations, because of a pre-existing
> >>>>> issue. Namely, the BLKZEROOUT ioctl might fail with errno EINVAL when
> >>>>> the request is shorter than the block size of the block device.
> >>>>>
> >>>>> Stefan suggested prioritizing bl.pwrite_zeroes_alignment in
> >>>>> bdrv_co_do_zero_pwritev(). This RFC explores that approach and the
> >>>>> issues with qcow2 I encountered, where
> >>>>> bl.pwrite_zeroes_alignment = s->subcluster_size;
> >>>>> I would be happy to discuss potential solutions and whether we should
> >>>>> use this approach after all.
> >>>>
> >>>> Hi Fiona,
> >>>> I wanted to continue this discussion. My thoughts are that making
> >>>> bdrv_co_do_zero_pwritev() use bl.pwrite_zeroes_alignment is the right
> >>>> long-term solution to keep all the padding logic in one place.
> >>>>
> >>>> On the other hand, your series shows it involves fixing a bunch of test
> >>>> failures and that's not fun. The original bug that is being solved here
> >>>> is my doing, so feel free to hand this over to me if you decide you
> >>>> don't want to work on it.
> >>>
> >>> in your other mail, you mentioned you'll ask Kevin for his opinion. So
> >>> in part, I was waiting for that. But I also was side-tracked by other
> >>> things, and it will be 1-2 more weeks until I can really focus on this
> >>> again. If that is too long, please go ahead and pick it up.
> >>
> >> I didn't review this thoroughly yet, but I agree that considering the
> >> alignment from the start is the better solution and also more consistent
> >> with what we're already doing for normal reads and writes.
> >>
> >> We just need to make sure that we use the right alignments in the right
> >> places, which can be a bit confusing with the fallbacks to buffered zero
> >> writes here and there.
> >>
> >> I assume that there is enough time left to do this before the 11.0
> >> release and there is no need to take something like v1 as an
> >> intermediate solution?
> > 
> > No progress has been made and I'm unable to commit time at the moment.
> 
> Me neither unfortunately.
> 
> > Is everyone okay with merging Fiona's smaller original patch? While it
> > would be nice to implement a deeper fix, it's better to have a fix and
> > I think there is no great risk merging the original patch.
> > 
> > https://lore.kernel.org/qemu-devel/20260105143416.737482-1-f.ebner@proxmox.com/
> 
> FWIW, we have been using that patch downstream since mid-February [0]
> and nobody reported issues with it as far as I'm aware. I suppose it
> could use a 'TODO' code comment that the proper fix looks different. If
> you choose to go with that patch, should I send a v2 with such a comment
> or can that be added when applying?

I can add the comment when merging the patch. I will merge it on Monday
so Kevin still has some time to reply in case he has an opinion.

Stefan

> 
> Best Regards,
> Fiona
> 
> [0]:
> https://git.proxmox.com/?p=pve-qemu.git;a=commitdiff;h=6960b5e033fa911f9882751950df28a193255683
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2026-05-28 13:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-09 12:08 [RFC v2 0/6] block/io: avoid failure caused by misaligned BLKZEROOUT ioctl Fiona Ebner
2026-01-09 12:08 ` [PATCH 1/6] block/io: pass alignment to bdrv_init_padding() Fiona Ebner
2026-01-09 12:08 ` [PATCH 2/6] block/io: add 'bytes' parameter to bdrv_padding_rmw_read() Fiona Ebner
2026-01-09 12:08 ` [PATCH 3/6] block/io: honor pwrite_zeroes_alignment in bdrv_co_do_zero_pwritev() Fiona Ebner
2026-01-09 12:08 ` [PATCH 4/6] block/io: safeguard max transfer calculation in bdrv_aligned_pwritev() Fiona Ebner
2026-01-19 19:34   ` Stefan Hajnoczi
2026-02-05 15:57     ` Kevin Wolf
2026-01-09 12:08 ` [PATCH 5/6] block/io: handle image length not aligned to write zeroes alignment in bdrv_co_do_zero_pwritev() Fiona Ebner
2026-01-09 12:08 ` [PATCH 6/6] block/io: keep zero flag for head/tail parts of misaligned zero write when possible Fiona Ebner
2026-02-02 22:10   ` Stefan Hajnoczi
2026-01-19 19:38 ` [RFC v2 0/6] block/io: avoid failure caused by misaligned BLKZEROOUT ioctl Stefan Hajnoczi
2026-02-02 22:16 ` Stefan Hajnoczi
2026-02-05 12:13   ` Fiona Ebner
2026-02-05 15:26     ` Stefan Hajnoczi
2026-02-05 16:02     ` Kevin Wolf
2026-05-27 21:06       ` Stefan Hajnoczi
2026-05-28  8:32         ` Fiona Ebner
2026-05-28 13:26           ` Stefan Hajnoczi [this message]

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=20260528132621.GA40266@fedora \
    --to=stefanha@redhat.com \
    --cc=f.ebner@proxmox.com \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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.