Linux filesystem development
 help / color / mirror / Atom feed
From: "Theodore Tso" <tytso@mit.edu>
To: Baokun Li <libaokun@linux.alibaba.com>
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: Tue, 22 Sep 2026 11:56:17 -0400	[thread overview]
Message-ID: <arKZu30pMe0ZavVA@mit.edu> (raw)
In-Reply-To: <74463cb5-14af-47bb-9380-ca75dc5d293a@linux.alibaba.com>

On Tue, Sep 22, 2026 at 03:17:27PM -0500, Baokun Li wrote:
> I checked my environment again though -- it turned out not to be
> xfstests-bld at all.  xfstests-bld never touches e2fsprogs.
> 
> What happened is that I had manually run "make install" of a locally
> patched e2fsprogs in the test VM, which overwrote util-linux's blkid
> and fsck.

What e2fsprogs's configure script will do is that it checks to see if
the blkid libraries are available for building against.  That is, if
you are using Debian or Ubuntu, you need to have the libblkid-dev
package install.  Among other things, this makes the following files
available:

/usr/include/blkid/blkid.h
/usr/lib/x86_64-linux-gnu/libblkid.a
/usr/lib/x86_64-linux-gnu/libblkid.so

... which are the files needed to build against libblkid and then link
against it statically or dynamically.  If these files aren't
available, then e2fsprogs will assume that it needs to build the local
libblkid, which is what is needed when building on Android, MacOS,
NetBSD, Open Solaris, etc.

> Rebuilding e2fsprogs with these options disabled made the test pass:
> 
>     ./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.

The way I build with a locally patched e2fsprogs is that I'll build it
using the Debian build tools, which will enforce building with the
necessary prereqsuite packages, and then I'll put the built packages
in the directory test-appliance/debs and then build a fresh test
appliance image.  Or I'll just upload the packages to the VM and then
install it before launching the tests.

> That said, I think the patch is still needed, because
> FS_IOC_SETFSLABEL does not update the block device's mtime:
> 
>     blkid -s LABEL ...    # get A
>     FS_IOC_SETFSLABEL     # set B (device mtime unchanged)
>     blkid -s LABEL ...    # still get A (within 2s)
> 
> The first read writes a cache entry with TIME=now, and the ioctl
> leaves the device mtime untouched, so a second read within the 2s
> window still trusts the cache.

The patch to xfstests might still be appropriate, but it seems to me
that tune2fs should get fixed to update the device mtime (if it can),
and perhaps the kernel should try to update block device inode as well
as part of the FS_IOC_SETFSLABEL ioctl to address potential corner
cases with systemd/udev.

						- Ted

  parent reply	other threads:[~2026-09-22 15:57 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 [this message]
2026-09-23 10:02             ` Baokun Li
2026-09-24  2:25               ` Theodore Tso
2026-09-24  8:09                 ` Baokun Li

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=arKZu30pMe0ZavVA@mit.edu \
    --to=tytso@mit.edu \
    --cc=dgc@kernel.org \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=libaokun@linux.alibaba.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --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