From patchwork Mon Nov 23 05:51:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chauhan, Vijay" X-Patchwork-Id: 62094 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAN5qjUM026862 for ; Mon, 23 Nov 2009 05:52:45 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 544306194B9; Mon, 23 Nov 2009 00:52:44 -0500 (EST) Received: from int-mx05.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id nAN5qgCk029404 for ; Mon, 23 Nov 2009 00:52:42 -0500 Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.13]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAN5qgHl030543 for ; Mon, 23 Nov 2009 00:52:42 -0500 Received: from na3sys009aog105.obsmtp.com (na3sys009aog105.obsmtp.com [74.125.149.75]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAN5qPqw003609 for ; Mon, 23 Nov 2009 00:52:26 -0500 Received: from source ([147.145.40.20]) by na3sys009aob105.postini.com ([74.125.148.12]) with SMTP ID DSNKSwojGH4M0EBhyOa38AJC0hqJA02QpSQq@postini.com; Sun, 22 Nov 2009 21:52:27 PST Received: from milmhbs0.lsil.com (mhbs.lsil.com [147.145.1.30]) by mail0.lsil.com (8.12.11/8.12.11) with ESMTP id nAN5qNFi021460; Sun, 22 Nov 2009 21:52:23 -0800 (PST) Received: from inbmail01.lsi.com (inbmail01.in.lsil.com [172.28.140.213]) by milmhbs0.lsil.com (8.12.11/8.12.11) with ESMTP id nAN5qOQ3003818; Sun, 22 Nov 2009 21:52:25 -0800 Received: from inbmail01.lsi.com ([172.28.140.213]) by inbmail01.lsi.com ([172.28.140.213]) with mapi; Mon, 23 Nov 2009 11:22:21 +0530 From: "Chauhan, Vijay" To: "sekharan@us.ibm.com" , device-mapper development Date: Mon, 23 Nov 2009 11:21:58 +0530 Subject: RE: [dm-devel] [PATCH] multipath-tools: multipath should allow only path with valid size to get added in the map Thread-Topic: [dm-devel] [PATCH] multipath-tools: multipath should allow only path with valid size to get added in the map Thread-Index: AcpqLI4FwoAA/qvYRKy0sJqEG0x9rgB0GGNQ Message-ID: <0D1E8821739E724A86F4D16902CE275C1C93C74E91@inbmail01.lsi.com> In-Reply-To: <1258754235.20768.1.camel@chandra-ubuntu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.13 X-Scanned-By: MIMEDefang 2.39 X-RedHat-Spam-Score: 0 () X-MIME-Autoconverted: from quoted-printable to 8bit by listman.util.phx.redhat.com id nAN5qgCk029404 X-loop: dm-devel@redhat.com Cc: "Dachepalli, Sudhir" , "Stankey, Robert" , "sekharan@linux.vnet.ibm.com" , "Moger, Babu" X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 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 diff -uprN multipath-tools-orig/multipathd/main.c multipath-tools/multipathd/main.c --- multipath-tools-orig/multipathd/main.c 2009-11-20 23:39:09.000000000 +0530 +++ multipath-tools/multipathd/main.c 2009-11-23 16:37:16.000000000 +0530 @@ -396,8 +396,29 @@ ev_add_path (char * devname, struct vect return 2; } mpp = pp->mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid); + if (!pp->size) { + condlog(0, "%s: not a valid path %s, " + " device size is 0 ", devname, pp->dev); + int i = find_slot(vecs->pathvec, (void *)pp); + if (i != -1) + vector_del_slot(vecs->pathvec, i); + free_path(pp); + return 1; + } + rescan: if (mpp) { + if (mpp->size != pp->size) { + condlog(0, "%s: failed to add new path %s, " + "device size mismatch", + devname, pp->dev); + int i = find_slot(vecs->pathvec, (void *)pp); + if (i != -1) + vector_del_slot(vecs->pathvec, i); + free_path(pp); + return 1; + } + condlog(4,"%s: adopting all paths for path %s", mpp->alias, pp->dev); if (adopt_paths(vecs->pathvec, mpp))