From patchwork Fri May 27 14:30:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 825562 Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4RLnH7k027973 for ; Fri, 27 May 2011 21:49:38 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 p4RLkXu5014368; Fri, 27 May 2011 17:46:47 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4REUjjx027084 for ; Fri, 27 May 2011 10:30:45 -0400 Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.17]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4REUeZv010002 for ; Fri, 27 May 2011 10:30:40 -0400 Received: from mx2.netapp.com (mx2.netapp.com [216.240.18.37]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4REUehH030779 for ; Fri, 27 May 2011 10:30:40 -0400 X-IronPort-AV: E=Sophos;i="4.65,280,1304319600"; d="scan'208";a="551247125" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 27 May 2011 07:30:25 -0700 Received: from sacrsexc2-prd.hq.netapp.com (sacrsexc2-prd.hq.netapp.com [10.99.115.28]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id p4REUNPE017032 for ; Fri, 27 May 2011 07:30:25 -0700 (PDT) Received: from rtprsexc2-prd.hq.netapp.com ([10.100.161.115]) by sacrsexc2-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 27 May 2011 07:30:23 -0700 Received: from RTPMVEXC1-PRD.hq.netapp.com ([10.100.161.112]) by rtprsexc2-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 27 May 2011 10:30:22 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Fri, 27 May 2011 10:30:19 -0400 Message-ID: <47D23AD8469A2B448F33C24BD7A39BD90DBE8600@RTPMVEXC1-PRD.hq.netapp.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] multipath-tools: Manual failback fix when priority changes Thread-Index: AcwcepqNTWDlphRAT4mxhzAAhsckpA== From: "Moger, Babu" To: X-OriginalArrivalTime: 27 May 2011 14:30:22.0412 (UTC) FILETIME=[9C7FF0C0:01CC1C7A] X-RedHat-Spam-Score: -5.01 (RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.17 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id p4REUjjx027084 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Fri, 27 May 2011 17:46:31 -0400 Subject: [dm-devel] [PATCH] multipath-tools: Manual failback fix when priority changes 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]); Fri, 27 May 2011 21:49:38 +0000 (UTC) Current code switches the path-group when there is a change in priority. However, this is not the right thing to do when failback is set to manual. This patch fixes this problem. Call update_path_groups only if failback is immediate. Signed-off-by: Babu Moger --- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- multipath-tools/multipathd/main.c.orig 2011-05-26 08:06:08.000000000 -0500 +++ multipath-tools/multipathd/main.c 2011-05-26 08:21:39.000000000 -0500 @@ -1189,7 +1189,8 @@ check_path (struct vectors * vecs, struc condlog(4, "path prio refresh"); if (update_prio(pp, new_path_up) && - pp->mpp->pgpolicyfn == (pgpolicyfn *)group_by_prio) + (pp->mpp->pgpolicyfn == (pgpolicyfn *)group_by_prio) && + pp->mpp->pgfailback == -FAILBACK_IMMEDIATE) update_path_groups(pp->mpp, vecs, !new_path_up); else if (need_switch_pathgroup(pp->mpp, 0)) { if (pp->mpp->pgfailback > 0 &&