From patchwork Wed Aug 8 16:10:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 1296661 Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by patchwork2.kernel.org (Postfix) with ESMTP id C912FDF223 for ; Wed, 8 Aug 2012 16:14:13 +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 q78GAIjU023207; Wed, 8 Aug 2012 12:10:20 -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 q78GAGmZ021857 for ; Wed, 8 Aug 2012 12:10:16 -0400 Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.20]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q78GABaY022787; Wed, 8 Aug 2012 12:10:11 -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 q78GA92F005687; Wed, 8 Aug 2012 12:10:10 -0400 X-IronPort-AV: E=Sophos;i="4.77,733,1336374000"; d="scan'208";a="674658252" Received: from smtp2.corp.netapp.com ([10.57.159.114]) by mx2-out.netapp.com with ESMTP; 08 Aug 2012 09:10:09 -0700 Received: from vmwexceht05-prd.hq.netapp.com (vmwexceht05-prd.hq.netapp.com [10.106.77.35]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id q78GA997013302; Wed, 8 Aug 2012 09:10:09 -0700 (PDT) Received: from SACEXCMBX02-PRD.hq.netapp.com ([169.254.1.34]) by vmwexceht05-prd.hq.netapp.com ([10.106.77.35]) with mapi id 14.02.0309.002; Wed, 8 Aug 2012 09:09:59 -0700 From: "Moger, Babu" To: linux-scsi Thread-Topic: [PATCH] scsi_dh_rdac: Add empty set_params function to scsi_dh_rdac Thread-Index: Ac11f8dDfCMpBka6QZmKkL/kbg7TKw== Date: Wed, 8 Aug 2012 16:10:07 +0000 Message-ID: <77471C95FAFD844C8CA02DD4F4C5FE2B0BCA09F1@SACEXCMBX02-PRD.hq.netapp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.106.53.53] MIME-Version: 1.0 X-RedHat-Spam-Score: -6.912 (BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.20 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id q78GAGmZ021857 X-loop: dm-devel@redhat.com Cc: "device-mapper development \(dm-devel@redhat.com\)" , "Mike Snitzer \(snitzer@redhat.com\)" Subject: [dm-devel] [PATCH] scsi_dh_rdac: Add empty set_params function to scsi_dh_rdac 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 This patch adds empty set_params function to scsi_dh_rdac. This patch is required for the following features to work properly. 1. add retain_attached_hw_handler feature http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=a58a935d5a1b2ad267017a68c3a1bca26226cc76 2. add scsi_dh_attached_handler_name http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=7e8a74b177f17d100916b6ad415450f7c9508691 DM layer detaches the handler if the set_params is not implemented or fails. For example if we pass following parameters from multipath: features "1 retain_attached_hw_handler" (consider rdac as attached_hw_handler) hardware_handler "2 alua 1" If the attached_hw_handler is rdac, then DM anyway tries to call set_params on rdac. Because rdac does not implement set_params, scsi_dh_set_params fails and DM detaches the handler. This patch fixes this problem. Signed-off-by: Babu Moger --- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- linux-3.5-rc7/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2012-08-08 10:38:54.000000000 -0500 +++ linux-3.5-rc7/drivers/scsi/device_handler/scsi_dh_rdac.c 2012-08-08 11:02:10.000000000 -0500 @@ -816,6 +816,17 @@ static const struct scsi_dh_devlist rdac {NULL, NULL}, }; +/* + * params - parameters in the following format + * "no_of_params\0param1\0param2\0param3\0...\0" + * for example, string for 2 parameters with value 10 and 21 + * is specified as "2\010\021\0". + */ +static int rdac_set_params(struct scsi_device *sdev, const char *params) +{ + return 0; +} + static bool rdac_match(struct scsi_device *sdev) { int i; @@ -846,6 +857,7 @@ static struct scsi_device_handler rdac_d .attach = rdac_bus_attach, .detach = rdac_bus_detach, .activate = rdac_activate, + .set_params = rdac_set_params, .match = rdac_match, };