From patchwork Tue Aug 11 21:58:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 11709759 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 98EE8618 for ; Tue, 11 Aug 2020 22:01:05 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53108206C3 for ; Tue, 11 Aug 2020 22:01:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Dil0upIS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53108206C3 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597183264; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/QYgKsD2dgaA5qhiluATjPpFJtjqiAacy7WORxT2qD8=; b=Dil0upISAlmJF7/VpTZFTh7h0detgE8ydnqMiypuKZa7qpm/U6cjDZuO5Yc2aXyQb/NOiX SNfHzy6UoWGMCGl37CaeNK4kzJ1riBIHpTnZczgNYCHzas2SD5hI3FcmgbNvbFphBQeQoz 9ASzu4/t+IUbdUs3zUtnbOX9SMkyuOM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-374-VSDNe4FTPmuKv-NSMNDbcA-1; Tue, 11 Aug 2020 18:01:01 -0400 X-MC-Unique: VSDNe4FTPmuKv-NSMNDbcA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6397A1B18BCF; Tue, 11 Aug 2020 22:00:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 478168BB04; Tue, 11 Aug 2020 22:00:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1D9251809554; Tue, 11 Aug 2020 22:00:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07BLwrBl009164 for ; Tue, 11 Aug 2020 17:58:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id AF7BB5D9E8; Tue, 11 Aug 2020 21:58:53 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from octiron.msp.redhat.com (octiron.msp.redhat.com [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D4EA5D9DC; Tue, 11 Aug 2020 21:58:52 +0000 (UTC) Received: from octiron.msp.redhat.com (localhost.localdomain [127.0.0.1]) by octiron.msp.redhat.com (8.14.9/8.14.9) with ESMTP id 07BLwol7015855; Tue, 11 Aug 2020 16:58:50 -0500 Received: (from bmarzins@localhost) by octiron.msp.redhat.com (8.14.9/8.14.9/Submit) id 07BLwo1p015854; Tue, 11 Aug 2020 16:58:50 -0500 From: Benjamin Marzinski To: Christophe Varoqui Date: Tue, 11 Aug 2020 16:58:40 -0500 Message-Id: <1597183123-15797-6-git-send-email-bmarzins@redhat.com> In-Reply-To: <1597183123-15797-1-git-send-email-bmarzins@redhat.com> References: <1597183123-15797-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: dm-devel@redhat.com Cc: device-mapper development , Martin Wilck Subject: [dm-devel] [PATCH v2 5/8] libmultipath: deal with flushing no maps X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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);