From: Benjamin Marzinski Subject: [PATCH v2 5/8] libmultipath: deal with flushing no maps Date: Tue, 11 Aug 2020 16:58:40 -0500 Message-ID: <1597183123-15797-6-git-send-email-bmarzins@redhat.com> References: <1597183123-15797-1-git-send-email-bmarzins@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1597183123-15797-1-git-send-email-bmarzins@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Christophe Varoqui Cc: device-mapper development , Martin Wilck List-Id: dm-devel.ids dm_flush_maps() was failing if there were no device-mapper devices at all, instead of returning success, since there is nothing to do. Fixes: "libmultipath: make dm_flush_maps only return 0 on success" Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 126cd728..b8199cb5 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -1024,10 +1024,10 @@ int dm_flush_maps (int need_suspend, int retries) if (!(names = dm_task_get_names (dmt))) goto out; + r = 0; if (!names->dev) goto out; - r = 0; do { if (need_suspend) r |= dm_suspend_and_flush_map(names->name, retries); -- 2.17.2