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 <kzak@redhat.com>
* 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)