From: Karel Zak Date: Mon, 16 Mar 2026 10:43:19 +0000 (+0100) Subject: libblkid: add debug message for private DM device skip X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b85d46a2edf3f871504ca86080102cde93e3725c;p=thirdparty%2Futil-linux.git libblkid: add debug message for private DM device skip Add a DBG() trace and set errno = EINVAL when blkid_new_probe_from_filename() skips a private device-mapper device, to aid troubleshooting and distinguish from I/O errors. Addresses: https://github.com/util-linux/util-linux/pull/4120 Signed-off-by: Karel Zak --- diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index d47c22c72..fba7eb124 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -224,8 +224,11 @@ blkid_probe blkid_new_probe_from_filename(const char *filename) * DM_DEVICE_REMOVE would otherwise see EBUSY. */ if (stat(filename, &sb) == 0 && S_ISBLK(sb.st_mode) && - sysfs_devno_is_dm_private(sb.st_rdev, NULL)) + sysfs_devno_is_dm_private(sb.st_rdev, NULL)) { + DBG(LOWPROBE, ul_debug("ignore private device mapper device")); + errno = EINVAL; return NULL; + } fd = open(filename, O_RDONLY | O_CLOEXEC | O_NONBLOCK); if (fd < 0)