From 07576f7e511f8b7084871c5f3f306760c85a16fd Mon Sep 17 00:00:00 2001 From: David Teigland Date: Thu, 1 Aug 2024 11:30:10 -0500 Subject: [PATCH] devices: fix dev_dm_uuid If a non-dm device is passed, the dm code doesn't fail and returns some dm uuid. --- lib/activate/dev_manager.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index c2d857231..781a478b1 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -902,6 +902,9 @@ int devno_dm_uuid(struct cmd_context *cmd, int major, int minor, const char *uuid; int r = 0; + if (major != cmd->dev_types->device_mapper_major) + return 0; + if (dm_devs_cache_use()) { if ((dm_dev = dm_devs_cache_get_by_devno(cmd, MKDEV(major, minor)))) { dm_strncpy(uuid_buf, dm_dev->uuid, uuid_buf_size);