Skip to content

Commit

Permalink
libmultipath: libmp_mapinfo(): return DMP_NO_MATCH for multi-target maps
Browse files Browse the repository at this point in the history
multi-target maps are more like maps with a single non-multipath
target than like maps with no target at all.

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 541906f commit 9a641bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libmultipath/devmapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ static int libmp_mapinfo__(int flags, mapid_t id, mapinfo_t info, const char *ma
if (dm_get_next_target(dmt, NULL, &start, &length,
&target_type, &params) != NULL) {
condlog(2, "%s: map %s has multiple targets", fname__, map_id);
return DMP_NOT_FOUND;
return DMP_NO_MATCH;
}
if (!params) {
condlog(2, "%s: map %s has no targets", fname__, map_id);
Expand Down
2 changes: 1 addition & 1 deletion tests/mapinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ static void test_mapinfo_bad_next_target_01(void **state)
rc = libmp_mapinfo(DM_MAP_BY_NAME,
(mapid_t) { .str = "foo", },
(mapinfo_t) { .size = &size });
assert_int_equal(rc, DMP_NOT_FOUND);
assert_int_equal(rc, DMP_NO_MATCH);
}

static void test_mapinfo_bad_next_target_02(void **state)
Expand Down

0 comments on commit 9a641bb

Please sign in to comment.