All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Martin Wilck <mwilck@suse.com>
Cc: "Hannes Reinecke" <hare@suse.de>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Benjamin Marzinski" <bmarzins@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-block@nongnu.org, "Kevin Wolf" <kwolf@redhat.com>,
	afaria@redhat.com, qemu-devel@nongnu.org,
	"Mikulas Patocka" <mpatocka@redhat.com>
Subject: Re: Moving from qemu-pr-helper and libmpathpersist to <linux/pr.h>
Date: Tue, 10 Feb 2026 08:59:31 -0500	[thread overview]
Message-ID: <20260210135931.GA90664@fedora> (raw)
In-Reply-To: <cd9c02195bcda43c4ac992c17a2a1de5d51102e7.camel@suse.com>

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

On Tue, Feb 10, 2026 at 11:23:51AM +0100, Martin Wilck wrote:
> On Mon, 2026-02-09 at 09:23 -0500, Stefan Hajnoczi wrote:
> > On Mon, Feb 09, 2026 at 01:50:00PM +0100, Hannes Reinecke wrote:
> > > 
> > > My concern with opening the block device with BLK_OPEN_WRITE is
> > > that
> > > this will trigger udev to 'synthesize' (ie regenerate) an 'add'
> > > event
> > > on close, causing 'interesting' effects as this will cascade down
> > > through the udev rule chain, triggering blkid, partition scan, you
> > > name it.
> > > Horrible, horrible, horrible.
> > > Don't do it.
> > > 
> > > Especially not as you are only interested in reading information,
> > > and not changing the disk state in any way.
> > 
> > I see. I will send patches to change blkdev_pr_read_keys()
> > blkdev_pr_read_reservation() to require only BLK_OPEN_READ.
> 
> Hm, but then if you need to make an actual reservation and call e.g.
> blkdev_pr_reserve(), you'll need to re-open the device r/w, and have
> the same problem. I'm not sure I understand the issue here ... doesn't
> your process have an open fd to the device in question anyway? You just
> need to be sure not to _close_ it, as that's what causes the uevents
> (udev uses an IN_CLOSE_WRITE inotify(7) event on the device node).

Shell scripts are the most exposed to this issue because they invoke
blkpr(8) anew each time instead of keeping the fd open between reading
reservation details and performing a reservation operation.

Stefan

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

  reply	other threads:[~2026-02-10 14:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 18:47 Moving from qemu-pr-helper and libmpathpersist to <linux/pr.h> Stefan Hajnoczi
2026-01-27 19:45 ` Paolo Bonzini
2026-01-28 14:18   ` Stefan Hajnoczi
2026-01-28 15:30     ` Hannes Reinecke
2026-01-28 16:13       ` Stefan Hajnoczi
2026-01-27 21:06 ` Benjamin Marzinski
2026-02-03 15:09   ` Stefan Hajnoczi
2026-02-03 17:53     ` Benjamin Marzinski
2026-02-03 18:04       ` Stefan Hajnoczi
2026-02-04 13:19         ` Martin Wilck
2026-02-04 18:32           ` Stefan Hajnoczi
2026-02-04 23:57             ` Hannes Reinecke
2026-02-05  1:03               ` Benjamin Marzinski
2026-02-05 10:20                 ` Martin Wilck
2026-02-05 11:52             ` Martin Wilck
2026-02-05 12:01               ` Daniel P. Berrangé
2026-02-05 13:39                 ` Stefan Hajnoczi
2026-02-06  0:03                   ` Hannes Reinecke
2026-02-06 14:08                     ` Stefan Hajnoczi
2026-02-09 12:50                       ` Hannes Reinecke
2026-02-09 14:23                         ` Stefan Hajnoczi
2026-02-10 10:23                           ` Martin Wilck
2026-02-10 13:59                             ` Stefan Hajnoczi [this message]
2026-02-10 14:29                               ` Martin Wilck
2026-02-05 14:28               ` 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=20260210135931.GA90664@fedora \
    --to=stefanha@redhat.com \
    --cc=afaria@redhat.com \
    --cc=berrange@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=hare@suse.de \
    --cc=kwolf@redhat.com \
    --cc=mpatocka@redhat.com \
    --cc=mwilck@suse.com \
    --cc=pbonzini@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.