Skip to content

Commit

Permalink
libmultipath: reduce log level of libmp_mapinfo() messages
Browse files Browse the repository at this point in the history
Unless  MAPINFO_CHECK_UUID was set and we know that we are
looking at a map with a multipath UUID, encountering non-multipath
maps is not an error. Don't log this at verbosity level 2.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
  • Loading branch information
mwilck committed Nov 13, 2024
1 parent 75360e8 commit e8949c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libmultipath/devmapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,20 +740,22 @@ static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma
}

if (info.target || info.status || info.size || flags & MAPINFO_TGT_TYPE__) {
int lvl = MAPINFO_CHECK_UUID ? 2 : 4;

if (dm_get_next_target(dmt, NULL, &start, &length,
&target_type, &params) != NULL) {
condlog(2, "%s: map %s has multiple targets", fname__, map_id);
condlog(lvl, "%s: map %s has multiple targets", fname__, map_id);
return DMP_NO_MATCH;
}
if (!params) {
condlog(2, "%s: map %s has no targets", fname__, map_id);
condlog(lvl, "%s: map %s has no targets", fname__, map_id);
return DMP_NOT_FOUND;
}
if (flags & MAPINFO_TGT_TYPE__) {
const char *tgt_type = flags & MAPINFO_MPATH_ONLY ? TGT_MPATH : TGT_PART;

if (strcmp(target_type, tgt_type)) {
condlog(3, "%s: target type mismatch: \"%s\" != \"%s\"",
condlog(lvl, "%s: target type mismatch: \"%s\" != \"%s\"",
fname__, tgt_type, target_type);
return DMP_NO_MATCH;
}
Expand Down

0 comments on commit e8949c2

Please sign in to comment.