]> sourceware.org Git - lvm2.git/commitdiff
devices: fix dev_dm_uuid main master 1397422518
authorDavid Teigland <teigland@redhat.com>
Thu, 1 Aug 2024 16:30:10 +0000 (11:30 -0500)
committerDavid Teigland <teigland@redhat.com>
Thu, 1 Aug 2024 16:32:56 +0000 (11:32 -0500)
If a non-dm device is passed, the dm code doesn't fail and returns
some dm uuid.

lib/activate/dev_manager.c

index c2d857231f90eda00bdf36d4ab532861b2340702..781a478b1a75875e1f54d86cc81861173e07fc7b 100644 (file)
@@ -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);
This page took 0.030867 seconds and 5 git commands to generate.