public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
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 17:10:59 +0200	[thread overview]
Message-ID: <19c4251f-d63d-453d-a51a-9eaed7d6029e@redhat.com> (raw)
In-Reply-To: <adZnDrqOXWtV9nUB@nidhogg.toxiclabs.cc>

Dne 08. 04. 26 v 16:49 Carlos Maiolino napsal(a):
> On Wed, Apr 08, 2026 at 03:32:14PM +0200, Zdenek Kabelac wrote:
>> 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.
> 
> I disagree... Same lib call, same device, works before your patch, does
> not after... You may call it a bug that shouldn't be relied on, but
> that's for sure an API breakage.
> 


Well - DM with private suffix is private  - that's the API  and defined long 
time in history - to avoid any interaction with private device and libblkid.

The fact here was a bug for a long while that such device could have been 
still explored by some libblkid calls does not make it a legit API.

Stratis has 2 easy solutions/fixes:

a) dropping  'private' check for their device in util-linux.

b) use non-private UUID for a device that should be managed by user-space tools.

For lvm2/dm - it's clear we never want libblkid to access internal raid legs 
or other types of private DM devs.

Also it should be noted - Stratis should not have been using 'internal' logic 
without fully understanding concept of 'private' device in the 1st. place....

So eventually as a 'middle' ground solution we may possibly have new:

    sysfs_devno_is_dm_really_private()

that would be called in my patch in this function that would be a replica of 
sysfs_devno_is_dm_private() just with LVM suffix check.
But still this kind of defeats the original 'intention' of this check and 
makes the code harder to follow.

So I'd still prefer a fix on Stratis to correct notation of the private device.

Regads

Zdenek


      reply	other threads:[~2026-04-08 15:11 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
2026-04-08 14:49       ` Carlos Maiolino
2026-04-08 15:10         ` Zdenek Kabelac [this message]

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=19c4251f-d63d-453d-a51a-9eaed7d6029e@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