From patchwork Mon May 9 10:53:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 9045001 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0991FBF29F for ; Mon, 9 May 2016 10:57:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2099120149 for ; Mon, 9 May 2016 10:57:11 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16D82200E6 for ; Mon, 9 May 2016 10:57:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u49ArVFi029114; Mon, 9 May 2016 06:53:31 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u49Ar9FK028720 for ; Mon, 9 May 2016 06:53:09 -0400 Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u49Ar95K002237 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 9 May 2016 06:53:09 -0400 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51C3146292; Mon, 9 May 2016 10:53:08 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D3A48ABDB; Mon, 9 May 2016 10:53:06 +0000 (UTC) From: Hannes Reinecke To: Christophe Varoqui Date: Mon, 9 May 2016 12:53:00 +0200 Message-Id: <1462791185-2903-3-git-send-email-hare@suse.de> In-Reply-To: <1462791185-2903-1-git-send-email-hare@suse.de> References: <1462791185-2903-1-git-send-email-hare@suse.de> X-RedHat-Spam-Score: -3.98 (BAYES_50, DCC_REPUT_00_12, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, SPF_PASS) 195.135.220.15 mx2.suse.de 195.135.220.15 mx2.suse.de X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-loop: dm-devel@redhat.com Cc: Hannes Reinecke , dm-devel@redhat.com Subject: [dm-devel] [PATCH 2/7] devmapper: do not call dm_udev_complete if dm_task_set_cookie() failed 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-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As per Benjamin Marzinski libdevice-mapper will take care of cleaning up the cookie for us. So there's no need to call dm_udev_complete() if dm_task_set_cookie() fails. Signed-off-by: Hannes Reinecke --- libmultipath/devmapper.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 2ac62a5..8a89f46 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -232,10 +232,9 @@ dm_simplecmd (int task, const char *name, int no_flush, int need_sync, uint16_t #endif if (udev_wait_flag && !dm_task_set_cookie(dmt, &cookie, - DM_UDEV_DISABLE_LIBRARY_FALLBACK | udev_flags)) { - dm_udev_complete(cookie); + DM_UDEV_DISABLE_LIBRARY_FALLBACK | udev_flags)) goto out; - } + r = dm_task_run (dmt); if (udev_wait_flag) { @@ -320,10 +319,9 @@ dm_addmap (int task, const char *target, struct multipath *mpp, if (task == DM_DEVICE_CREATE && !dm_task_set_cookie(dmt, &cookie, - DM_UDEV_DISABLE_LIBRARY_FALLBACK)) { - dm_udev_complete(cookie); + DM_UDEV_DISABLE_LIBRARY_FALLBACK)) goto freeout; - } + r = dm_task_run (dmt); if (task == DM_DEVICE_CREATE) {