All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org, stefanha@redhat.com, afaria@redhat.com,
	 qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] file-posix: Add 'accept-read-only-device' option
Date: Wed, 28 Oct 2026 12:54:31 -0500	[thread overview]
Message-ID: <auI1mzkqNehP_-FM@redhat.com> (raw)
In-Reply-To: <20261028171057.139326-2-kwolf@redhat.com>

On Wed, Oct 28, 2026 at 06:10:56PM +0100, Kevin Wolf wrote:
> The host_device block driver refuses to open a block device read-write
> if the BLKROGET ioctl tells it that it's actually read-only. For such
> devices it's possible to open a read-write file descriptor, but any
> writes to the device would fail.
> 
> There are valid use cases for which this check gets in the way, as
> explained in the bug report:
> 
>     However, this behavior prevents a legitimate enterprise use case:
>     running VMs against storage replication target LUNs in a disaster
>     recovery configuration. Enterprise storage arrays (Dell Powermax,
>     Pure Storage) set the SCSI Write Protect bit on replication target
>     LUNs, causing the Linux kernel to mark them read-only via BLKROGET.
>     The VMs on the passive DR site need to start with these LUNs
>     attached - writes are expected to fail (the application middleware
>     knows it's on the passive side), and after a DR role swap the LUN
>     becomes writable and writes should succeed immediately without any
>     VM restart.
> 
> In order to allow such use cases in which a currently read-only device
> is deliberately opened read-write, add a new option to the host_device
> driver that allows the user to skip the check.
> 
> Buglink: https://redhat.atlassian.net/browse/RHEL-186136
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  qapi/block-core.json | 19 ++++++++++++++++++-
>  block/file-posix.c   | 23 ++++++++++++++++++++---
>  2 files changed, 38 insertions(+), 4 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



  reply	other threads:[~2026-10-28 17:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 17:10 [PATCH 0/2] file-posix: Add 'accept-read-only-device' option Kevin Wolf
2026-10-28 17:10 ` [PATCH 1/2] " Kevin Wolf
2026-10-28 17:54   ` Eric Blake [this message]
2026-10-28 17:10 ` [PATCH 2/2] iotests: Add loop-accept-ro-dev test Kevin Wolf
2026-10-28 18:10   ` Eric Blake
2026-10-29 16:42     ` Kevin Wolf
2026-10-28 19:49 ` [PATCH 0/2] file-posix: Add 'accept-read-only-device' option 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=auI1mzkqNehP_-FM@redhat.com \
    --to=eblake@redhat.com \
    --cc=afaria@redhat.com \
    --cc=kwolf@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.