All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH for-5.1 2/3] file-posix: Fix check_hdev_writable() with auto-read-only
Date: Fri, 17 Jul 2020 13:50:44 +0200	[thread overview]
Message-ID: <6edffcd1-ac03-b0ad-dd87-5ba923f4763a@redhat.com> (raw)
In-Reply-To: <20200717105426.51134-3-kwolf@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1062 bytes --]

On 17.07.20 12:54, Kevin Wolf wrote:
> For Linux block devices, being able to open the device read-write
> doesn't necessarily mean that the device is actually writable (one
> example is a read-only LV, as you get with lvchange -pr <device>). We
> have check_hdev_writable() to check this condition and fail opening the
> image read-write if it's not actually writable.
> 
> However, this check doesn't take auto-read-only into account, but
> results in a hard failure instead of downgrading to read-only where
> possible.
> 
> Fix this and do the writable check not based on BDRV_O_RDWR, but only
> when this actually results in opening the file read-write. A second
> check is inserted in raw_reconfigure_getfd() to have the same check when
> dynamic auto-read-only upgrades an image file from read-only to
> read-write.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block/file-posix.c | 33 +++++++++++++++++++++------------
>  1 file changed, 21 insertions(+), 12 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>


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

  reply	other threads:[~2020-07-17 11:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 10:54 [PATCH for-5.1 0/3] file-posix: Fix check_hdev_writable() with auto-read-only Kevin Wolf
2020-07-17 10:54 ` [PATCH for-5.1 1/3] file-posix: Move check_hdev_writable() up Kevin Wolf
2020-07-17 11:45   ` Max Reitz
2020-07-17 10:54 ` [PATCH for-5.1 2/3] file-posix: Fix check_hdev_writable() with auto-read-only Kevin Wolf
2020-07-17 11:50   ` Max Reitz [this message]
2020-07-17 10:54 ` [PATCH for-5.1 3/3] file-posix: Fix leaked fd in raw_open_common() error path Kevin Wolf
2020-07-17 11:55   ` Max Reitz
2020-07-17 11:49 ` [PATCH for-5.1 0/3] file-posix: Fix check_hdev_writable() with auto-read-only no-reply

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=6edffcd1-ac03-b0ad-dd87-5ba923f4763a@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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.