]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Detail: fix --detail --export for uuid_zero
authorKinga Stefaniuk <kinga.stefaniuk@intel.com>
Tue, 23 Jul 2024 13:38:41 +0000 (15:38 +0200)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Wed, 24 Jul 2024 10:10:22 +0000 (12:10 +0200)
Mentioned commit (see Fixes) causes that devices with UUID
equal to uuid_zero was not recognized properly. For few devices
the first one was taken always, and the same information was
printed. It caused regression, when few containers were created,
symlinks were generated only for the first one.

Add checking if uuid is uuid_zero and, if yes, use devname to
differentiate devices.

Fixes: 60c19530dd7c ("Detail: remove duplicated code")
Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@intel.com>
Detail.c

index 55a086d3378ff2172d307c0ad3ecf0bdb01f531a..f8b9e8479cce268082aa395f4cfa82d81b703dfa 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -274,7 +274,7 @@ int Detail(char *dev, struct context *c)
                                       array.minor_version);
                }
 
-               if (info)
+               if (info && memcmp(info->uuid, uuid_zero, sizeof(int[4])) != 0)
                        mp = map_by_uuid(&map, info->uuid);
                if (!mp)
                        mp = map_by_devnm(&map, fd2devnm(fd));