All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, Hanna Reitz <hreitz@redhat.com>,
	nsoffer@redhat.com, qemu-block@nongnu.org
Subject: Re: [PATCH v2 1/2] file-posix: fix Linux alignment probing when EIO is returned
Date: Fri, 11 Nov 2022 12:08:36 +0100	[thread overview]
Message-ID: <Y24tNEQWKXVJ2Fls@redhat.com> (raw)
In-Reply-To: <20221103183609.363027-2-stefanha@redhat.com>

Am 03.11.2022 um 19:36 hat Stefan Hajnoczi geschrieben:
> Linux v6.0 dm-crypt returns errno EIO from unaligned O_DIRECT pread(2)
> calls. Alignment probing fails on dm-crypt devices because the code
> expects EINVAL. This is a kernel regression that is expected to be fixed
> upstream:
> https://lore.kernel.org/linux-block/20221103193837.3b5b4bac@xps.demsh.org/T/#t
> 
> Treating any errno as an "unaligned" indicator would be easy, but breaks
> commit 22d182e82b4b ("block/raw-posix: fix launching with failed
> disks"). Offline disks return EIO for correctly aligned requests and
> EINVAL for unaligned requests.
> 
> It's possible to make both v6.0 dm-crypt and offline disks work: look
> for the transition from EINVAL to EIO instead of for a single EINVAL
> value.
> 
> Buglink: https://gitlab.com/qemu-project/qemu/-/issues/1290
> Fixes: 22d182e82b4b ("block/raw-posix: fix launching with failed disks")
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

I haven't tested it myself, but from the comments in the bug tracker and
on the mailing this, I don't think this can actually distinguish the two
cases: AIUI, even with the buggy dm-crypt, you get a transition from
EINVAL to EIO because everything < 512 (such as our first probed value
1) will still return EINVAL.

So even with this patch, I think we would still probe the incorrect
512 bytes when the dm-crypt bug is present.

Kevin



  reply	other threads:[~2022-11-11 11:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 18:36 [PATCH v2 0/2] file-posix: alignment probing improvements Stefan Hajnoczi
2022-11-03 18:36 ` [PATCH v2 1/2] file-posix: fix Linux alignment probing when EIO is returned Stefan Hajnoczi
2022-11-11 11:08   ` Kevin Wolf [this message]
2022-11-03 18:36 ` [PATCH v2 2/2] file-posix: add statx(STATX_DIOALIGN) support Stefan Hajnoczi
2022-11-11 11:22   ` Kevin Wolf

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=Y24tNEQWKXVJ2Fls@redhat.com \
    --to=kwolf@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=nsoffer@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.