From: Zdenek Kabelac <zkabelac@redhat.com>
To: Carlos Maiolino <cem@kernel.org>
Cc: kzak@redhat.com, util-linux@vger.kernel.org, amulhern@redhat.com
Subject: Re: [PATCH RFC 0/2] Fix API breakage in libblkid
Date: Wed, 8 Apr 2026 15:32:14 +0200 [thread overview]
Message-ID: <94e57a5d-2f49-4e16-8328-5cf30b41d7ff@redhat.com> (raw)
In-Reply-To: <adZMp4mazAAc9iFZ@nidhogg.toxiclabs.cc>
Dne 08. 04. 26 v 15:19 Carlos Maiolino napsal(a):
> On Wed, Apr 08, 2026 at 01:47:27PM +0200, Zdenek Kabelac wrote:
>> Dne 08. 04. 26 v 12:35 cem@kernel.org napsal(a):
>>> From: Carlos Maiolino <cem@kernel.org>
>>>
> So, although I agree with you that Stratis is using libblkid incorrectly,
> I still think this patch is wrong, as it changes the library's behavior
> to fix a problem in LVM (if there is where the race was), and not some
> inherent library problem. If, no user can use libblkid to query into a
> private device, then the above lib call sequence wasn't supposed to work
> either, and perhaps then, blkid_probe_set_device() should actually fail
> in a private device.
>
> Again, I just looked into the libblkid low-level implementation today,
> but it doesn't seem to be the library's job to be responsible for a race
> between open() and ioctl(DM_DEVICE_REMOVE).
>
Hi
The main missed concept here is - this is not breaking any API.
The concept of private DM device is to be a device that is not being touched
by libblkid. So this was a pure bug in the libblkid code when there was a
code path skipping check (and actually doing this check after opening private
device).
And actually IMHO there is a bigger issue - xfs tools are actually relying
too much on content of udev DB - this DB is by design unreliable - so it's
likely good for some quick checking - but i.e. in lvm2 - we always do a real
disk read - udevDB is only advisory.
Regards
Zdenek
next prev parent reply other threads:[~2026-04-08 13:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 10:35 [PATCH RFC 0/2] Fix API breakage in libblkid cem
2026-04-08 10:35 ` [PATCH RFC 1/2] Revert "libblkid: add debug message for private DM device skip" cem
2026-04-08 10:35 ` [PATCH RFC 2/2] Revert "libblkid: check for private DM device before open" cem
2026-04-08 11:47 ` [PATCH RFC 0/2] Fix API breakage in libblkid Zdenek Kabelac
2026-04-08 13:19 ` Carlos Maiolino
2026-04-08 13:32 ` Zdenek Kabelac [this message]
2026-04-08 14:49 ` Carlos Maiolino
2026-04-08 15:10 ` Zdenek Kabelac
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=94e57a5d-2f49-4e16-8328-5cf30b41d7ff@redhat.com \
--to=zkabelac@redhat.com \
--cc=amulhern@redhat.com \
--cc=cem@kernel.org \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox