The libblkid always verify that /dev/disk/by-* symlinks match with
on-device LABELs/UUIDs. It means that all requests (e.g. mount -L |
-U) generates extra superblocks scans on the device.
Currently, many users and tools (GNOME, systemd, ...etc) use the
symlink directly and udev maintains the symlinks by inotify (+watch
rule). It seems better for system performance to disable the extra
paranoid mode and trust in udev.
Signed-off-by: Karel Zak <kzak@redhat.com>
#ifndef _BLKID_BLKIDP_H
#define _BLKID_BLKIDP_H
-
+/* support debug output if LIBBLKID_DEBUG env. variable is set */
#define CONFIG_BLKID_DEBUG 1
+/* Always confirm that /dev/disk-by symlinks match with LABEL/UUID on device */
+/* #define CONFIG_BLKID_VERIFY_UDEV 1 */
+
#include <sys/types.h>
#include <dirent.h>
#include <sys/stat.h>
* API.
*/
+#ifdef CONFIG_BLKID_VERIFY_UDEV
/* returns zero when the device has NAME=value (LABEL/UUID) */
static int verify_tag(const char *devname, const char *name, const char *value)
{
/* for non-root users we use unverified udev links */
return errsv == EACCES ? 0 : rc;
}
+#endif /* CONFIG_BLKID_VERIFY_UDEV*/
/**
* blkid_send_uevent:
if (!path)
return NULL;
+#ifdef CONFIG_BLKID_VERIFY_UDEV
if (verify_tag(path, token, value))
goto failed;
+#endif
return path;
failed: