From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
dm-devel@lists.linux.dev, Martin Wilck <mwilck@suse.com>
Subject: Re: [PATCH v2 02/12] libmultipath: libmp_mapinfo(): return DMP_NO_MATCH for multi-target maps
Date: Tue, 12 Nov 2024 19:11:56 -0500 [thread overview]
Message-ID: <ZzPuzLATq1b4o-dA@redhat.com> (raw)
In-Reply-To: <20241112150215.90182-3-mwilck@suse.com>
On Tue, Nov 12, 2024 at 04:02:05PM +0100, Martin Wilck wrote:
> 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>
> ---
> libmultipath/devmapper.c | 2 +-
> tests/mapinfo.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
> index 52bfe9c..ab6eefc 100644
> --- a/libmultipath/devmapper.c
> +++ b/libmultipath/devmapper.c
> @@ -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, ¶ms) != 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);
I feel like given the choice between DMP_NOT_FOUND and DMP_NO_MATCH, an
empty table should be DMP_NO_MATCH since we did find a device. I
assume you left this case alone because it will get changed with the
addition of a new error code for empty tables (I plan on posting that
shortly). So
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> diff --git a/tests/mapinfo.c b/tests/mapinfo.c
> index fca6462..66c81e8 100644
> --- a/tests/mapinfo.c
> +++ b/tests/mapinfo.c
> @@ -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)
> --
> 2.47.0
next prev parent reply other threads:[~2024-11-13 0:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 15:02 [PATCH v2 00/12] multipath fixes to tableless device handling Martin Wilck
2024-11-12 15:02 ` [PATCH v2 01/12] libmultipath: dm_get_maps(): don't bail out for single-map failures Martin Wilck
2024-11-12 15:02 ` [PATCH v2 02/12] libmultipath: libmp_mapinfo(): return DMP_NO_MATCH for multi-target maps Martin Wilck
2024-11-13 0:11 ` Benjamin Marzinski [this message]
2024-11-12 15:02 ` [PATCH v2 03/12] libmultipath: check DM UUID earlier in libmp_mapinfo__ Martin Wilck
2024-11-12 15:02 ` [PATCH v2 04/12] libmultipath: use MAPINFO_CHECK_UUID in dm_get_multipath Martin Wilck
2024-11-12 15:02 ` [PATCH v2 05/12] multipathd: print an error when failing to connect to multipathd Martin Wilck
2024-11-12 15:02 ` [PATCH v2 06/12] multipathd.service: restart multipathd on failure Martin Wilck
2024-11-12 15:02 ` [PATCH v2 07/12] libmultipath: make MAPINFO_CHECK_UUID work with partitions Martin Wilck
2024-11-12 15:02 ` [PATCH v2 08/12] libmultipath: check map UUID in do_foreach_partmaps Martin Wilck
2024-11-12 15:02 ` [PATCH v2 09/12] libmultipath: increase log level for removing partitions Martin Wilck
2024-11-12 15:02 ` [PATCH v2 10/12] libmultipath: reduce log level of libmp_mapinfo() messages Martin Wilck
2024-11-12 15:02 ` [PATCH v2 11/12] libmultipath: don't log boring state messages at level 3 Martin Wilck
2024-11-12 15:02 ` [PATCH v2 12/12] libmultipath: don't set dev_loss_tmo to 0 for NO_PATH_RETRY_FAIL Martin Wilck
2024-11-13 0:12 ` [PATCH v2 00/12] multipath fixes to tableless device handling Benjamin Marzinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZzPuzLATq1b4o-dA@redhat.com \
--to=bmarzins@redhat.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@lists.linux.dev \
--cc=martin.wilck@suse.com \
--cc=mwilck@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.