Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH] generic/492: bypass the blkid cache when probing the label
@ 2026-09-20  9:41 Baokun Li
  2026-09-21  5:27 ` Darrick J. Wong
  0 siblings, 1 reply; 12+ messages in thread
From: Baokun Li @ 2026-09-20  9:41 UTC (permalink / raw)
  To: fstests; +Cc: zlang, linux-fsdevel, linux-ext4, sandeen, dgc

blkid may serve a stale label from its cache instead of probing the
device, so the label just set via xfs_io can be missed and the output
mismatch is non-deterministic.

Pass "-c /dev/null" so that blkid always probes the on-disk superblock
directly.  Unlike the low-level probing mode (-p), which requires
util-linux 2.16 or later, this is also supported by the legacy blkid
shipped with e2fsprogs.

Fixes: c3c9630968a6 ("generic: test online label ioctl")
Signed-off-by: Baokun Li <libaokun@linux.alibaba.com>
---
 tests/generic/492 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/generic/492 b/tests/generic/492
index 51a46b510453..0b4f69b80f17 100755
--- a/tests/generic/492
+++ b/tests/generic/492
@@ -28,14 +28,15 @@ $XFS_IO_PROG -c "label -c" $SCRATCH_MNT
 $XFS_IO_PROG -c "label" $SCRATCH_MNT
 
 # And that userspace can see it now, while mounted
-# NB: some blkid has trailing whitespace, filter it out here
+# NB: bypass the blkid cache which may hold a stale label, and filter
+# out the trailing whitespace some blkid versions emit
 $XFS_IO_PROG -c "label -s label.$seq" $SCRATCH_MNT
 $XFS_IO_PROG -c "label" $SCRATCH_MNT
-blkid -s LABEL $SCRATCH_DEV | _filter_scratch | sed -e "s/ $//g"
+blkid -c /dev/null -s LABEL $SCRATCH_DEV | _filter_scratch | sed -e "s/ $//g"
 
 # And that the it is still there when it's unmounted
 _scratch_unmount
-blkid -s LABEL $SCRATCH_DEV | _filter_scratch | sed -e "s/ $//g"
+blkid -c /dev/null -s LABEL $SCRATCH_DEV | _filter_scratch | sed -e "s/ $//g"
 
 # And that it persists after a remount
 _scratch_mount
-- 
2.43.7


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-09-24  8:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox