libmultipath: Fix MAPINFO_CHECK_UUID with partitions
Benjamin Marzinski
maintainerPATCH 1/1 libmultipath: Fix MAPINFO_CHECK_UUID with partitions
In libmp_mapinfo__(), if is_mpath_part_uuid() succeeded, instead of ending the 'if' statement, is_mpath_uuid() would be called because of the OR operator. This would always fail if is_mpath_part_uuid() passed. This meant that libmp_mapinfo__() could never match partitions with MAPINFO_CHECK_UUID.
Fix that by not calling is_mpath_uuid() if MAPINFO_PART_ONLY is set.
--- libmultipath/devmapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/devmapper.c +1 -1
@@ -734,7 +734,7 @@ static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *maif (flags &MAPINFO_CHECK_UUID && ((flags &MAPINFO_PART_ONLY && !is_mpath_part_uuid (uuid,NULL )) || - !is_mpath_uuid (uuid))) { + (!(flags &MAPINFO_PART_ONLY ) && !is_mpath_uuid (uuid)))) {condlog (4 ,"%s: UUID mismatch: %s" , fname__, uuid);return DMP_NO_MATCH ; }
Signature · 1 line
2.46.2
Quoted 7 lines · Benjamin Marzinski
In
libmp_mapinfo__(), ifis_mpath_part_uuid()succeeded, instead of ending the 'if' statement,is_mpath_uuid()would be called because of the OR operator. This would always fail ifis_mpath_part_uuid()passed.
This meant thatlibmp_mapinfo__()could never match partitions withMAPINFO_CHECK_UUID.
Quoted 5 lines
Fix that by not calling
is_mpath_uuid()ifMAPINFO_PART_ONLYis set.Fixes c1aa0285 ("libmultipath: make MAPINFO_CHECK_UUID work withpartitions")
Signed-off-by Benjamin Marzinski <[email protected]>
Ouch. Thanks!!
Benjamin Marzinski
maintainerQuoted 8 lines · Martin Wilck
Quoted 7 lines · Benjamin Marzinski
In
libmp_mapinfo__(), ifis_mpath_part_uuid()succeeded, instead of ending the 'if' statement,is_mpath_uuid()would be called because of the OR operator. This would always fail ifis_mpath_part_uuid()passed.
This meant thatlibmp_mapinfo__()could never match partitions withMAPINFO_CHECK_UUID.
Quoted 8 lines
Quoted 5 lines
Fix that by not calling
is_mpath_uuid()ifMAPINFO_PART_ONLYis set.Fixes c1aa0285 ("libmultipath: make MAPINFO_CHECK_UUID work withpartitions")
Signed-off-by Benjamin Marzinski <[email protected]>Ouch. Thanks!!
Reviewed-by Martin Wilck <[email protected]>
So, in theory the next step would be to open a PR for the upstream stable branch, if that existed, right?
-Ben
Benjamin Marzinski
maintainerQuoted 15 lines · Benjamin Marzinski
Quoted 14 lines · Martin Wilck
Quoted 12 lines · Benjamin Marzinski
In
libmp_mapinfo__(), ifis_mpath_part_uuid()succeeded, instead of ending the 'if' statement,is_mpath_uuid()would be called because of the OR operator. This would always fail ifis_mpath_part_uuid()passed.
This meant thatlibmp_mapinfo__()could never match partitions withMAPINFO_CHECK_UUID.Fix that by not calling
is_mpath_uuid()ifMAPINFO_PART_ONLYis set.Fixes c1aa0285 ("libmultipath: make MAPINFO_CHECK_UUID work withpartitions")
Signed-off-by Benjamin Marzinski <[email protected]>
Quoted 5 lines
Quoted 2 lines
Ouch. Thanks!!
Reviewed-by Martin Wilck <[email protected]>So, in theory the next step would be to open a PR for the upstream stable branch, if that existed, right?
But I suppose the better actual plan here is just to update the 0.11.0 PR.
Quoted 2 lines
-Ben