From: Baokun Li <libaokun@linux.alibaba.com>
To: Theodore Tso <tytso@mit.edu>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
fstests@vger.kernel.org, zlang@kernel.org,
linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
sandeen@redhat.com, dgc@kernel.org
Subject: Re: [PATCH] generic/492: bypass the blkid cache when probing the label
Date: Thu, 24 Sep 2026 16:09:15 +0800 [thread overview]
Message-ID: <b020985c-2784-4438-baae-07d16f3afc7b@linux.alibaba.com> (raw)
In-Reply-To: <arRIECW5MBX7fwfe@mit.edu>
On 2026/9/24 10:25, Theodore Tso wrote:
> On Wed, Sep 23, 2026 at 06:02:38PM -0500, Baokun Li wrote:
>>>> ./configure --disable-libblkid --disable-fsck \
>>>> --disable-libuuid --disable-uuidd
>>> This works, but this wll also disable those e2fsprogs features that
>>> require those libraries. So mke2fs will not generate UUID's in the
>>> superblock, e2fsck won't handle LABEL=xyzzy specifiers, etc.
>>> Fortunately xfstests don't depend on these featuers, so this will work.
>> Hmm, what I disabled is exactly the set duplicated by util-linux:
>> the blkid/uuid libs and UUID/LABEL= handling all live there, so
>> the tools just link the system ones -- there is no functional loss.
> The fact that you needed the --disable options implies that e2fsprogs
> wasn't able to use the util-linux supplied libraries. If the
> configure script determines libblkid and libuuid are available for
> linking against, (e.g., libblkid-dev and uuid-dev are installed), the
> built-in libblkid and libuuid file systems are disabled.
>
> From the configure script output:
>
> checking for blkid_get_cache in -lblkid... yes
> Using system blkid library by default
>
> checking for uuid_generate in -luuid... yes
> Using system uuid by default
> Disabling uuidd by default
>
> In contrast, if you run the configure script on MacOS, NetBSD, or a
> Linux system missing the libuuid / libblkid development files, you
> will see:
>
> checking for uuid_generate in -luuid... no
> Enabling private uuid library by default
> Building uuidd by default
Right. The flags went in only after the development packages were
installed. The original hand build had no libblkid-dev, so it built
and installed the private copies, which is how the distro's
blkid/fsck/findfs got shadowed.
With libblkid-dev, uuid-dev and pkg-config installed, a plain
./configure now prints exactly your first output. Compared with my
--disable build, the only extra program it produces is the fsck
wrapper.
>> Also, a thought that just came up: on the blkid side, would it be
>> feasible to not trust the cache for mounted devices and always
>> re-probe? The mount / set label / umount / get label (within 2s)
>> window would remain, but it would be much smaller.
> Maybe. It's not clear how often people might be trying to query the
> blkid data. Also, figuring out whether or not a device is mounted is
> not free. That would mean that for every blkid query, it would have
> to read /proc/mounts to make that determination. And note that on
> some data center servers, there could potentially be hundreds if not
> thousands of entries in /proc/mounts, either because you have a huge
> number of bind mounts or overlayfs, and/or because you might have a
> huge number of read-only iscsi mounts to deliver software packages to
> your container based Borg or Kubernetes jobs.
>
> I suppose you could put in the blkid cache a hint as to whether the
> file system is mounted, but that in itself could get stale and out of
> date.
Agreed -- checking whether a device is mounted on every probe might
cost more than simply re-probing the device. Updating the mtime on
the write side (e.g., in tune2fs, xfs_io, or the kernel) looks like
the better approach.
Cheers,
Baokun
prev parent reply other threads:[~2026-09-24 8:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 9:41 [PATCH] generic/492: bypass the blkid cache when probing the label Baokun Li
2026-09-21 5:27 ` Darrick J. Wong
2026-09-21 9:07 ` Baokun Li
2026-09-21 23:49 ` Darrick J. Wong
2026-09-22 3:43 ` Theodore Tso
2026-09-22 7:17 ` Baokun Li
2026-09-22 14:53 ` Darrick J. Wong
2026-09-23 9:13 ` Baokun Li
2026-09-22 15:56 ` Theodore Tso
2026-09-23 10:02 ` Baokun Li
2026-09-24 2:25 ` Theodore Tso
2026-09-24 8:09 ` Baokun Li [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=b020985c-2784-4438-baae-07d16f3afc7b@linux.alibaba.com \
--to=libaokun@linux.alibaba.com \
--cc=dgc@kernel.org \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=tytso@mit.edu \
--cc=zlang@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