From patchwork Wed Jul 13 18:30:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 972992 Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6DIXJi3008184 for ; Wed, 13 Jul 2011 18:33:40 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p6DIUpOn002477; Wed, 13 Jul 2011 14:30:53 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p6DIUoYO007489 for ; Wed, 13 Jul 2011 14:30:50 -0400 Received: from ether.msp.redhat.com (ether.msp.redhat.com [10.15.80.119]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6DIUinS025207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 13 Jul 2011 14:30:44 -0400 Received: from ether.msp.redhat.com (localhost.localdomain [127.0.0.1]) by ether.msp.redhat.com (8.14.1/8.14.1) with ESMTP id p6DIUhiT002056 for ; Wed, 13 Jul 2011 13:30:43 -0500 Received: (from bmarzins@localhost) by ether.msp.redhat.com (8.14.1/8.14.1/Submit) id p6DIUhNK002055 for dm-devel@redhat.com; Wed, 13 Jul 2011 13:30:43 -0500 Date: Wed, 13 Jul 2011 13:30:42 -0500 From: Benjamin Marzinski To: device-mapper development Message-ID: <20110713183042.GT15149@ether.msp.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH] multipath: check setup_multipath return value. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 13 Jul 2011 18:33:40 +0000 (UTC) When setup_multipath() fails, it removes the map. So update_path_groups() needs check the return value, and fail without touching the map anymore if setup_multipath() fails. Signed-off-by: Benjamin Marzinski --- multipathd/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: multipath-tools-110713/multipathd/main.c =================================================================== --- multipath-tools-110713.orig/multipathd/main.c +++ multipath-tools-110713/multipathd/main.c @@ -1060,7 +1060,8 @@ int update_path_groups(struct multipath return 1; } dm_lib_release(); - setup_multipath(vecs, mpp); + if (setup_multipath(vecs, mpp) != 0) + return 1; sync_map_state(mpp); return 0;