From patchwork Fri Sep 11 17:20:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandra Seetharaman X-Patchwork-Id: 46891 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 n8BHKsKq016054 for ; Fri, 11 Sep 2009 17:20:54 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 CE987619C4D; Fri, 11 Sep 2009 13:20:52 -0400 (EDT) Received: from int-mx08.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 n8BHKogt003884 for ; Fri, 11 Sep 2009 13:20:50 -0400 Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.14]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8BHKnL6030098 for ; Fri, 11 Sep 2009 13:20:49 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8BHKa9d009054 for ; Fri, 11 Sep 2009 13:20:36 -0400 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e32.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id n8BHG4km027216 for ; Fri, 11 Sep 2009 11:16:04 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n8BHKRCQ159754 for ; Fri, 11 Sep 2009 11:20:28 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n8BHKQ8n032209 for ; Fri, 11 Sep 2009 11:20:26 -0600 Received: from [9.47.17.98] (chandra-ubuntu.beaverton.ibm.com [9.47.17.98]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n8BHKOKe031965; Fri, 11 Sep 2009 11:20:24 -0600 From: Chandra Seetharaman To: James Bottomley In-Reply-To: <1246069888.14164.53.camel@chandra-ubuntu> References: <1246069888.14164.53.camel@chandra-ubuntu> Organization: IBM Date: Fri, 11 Sep 2009 10:20:35 -0700 Message-Id: <1252689635.2541.4.camel@chandra-ubuntu> Mime-Version: 1.0 X-RedHat-Spam-Score: -4 (RCVD_IN_DNSWL_MED) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.14 X-loop: dm-devel@redhat.com Cc: Mario Mech , dm-devel , linux-scsi Subject: [dm-devel] [RESEND] [PATCH]: scsi_dh: create sysfs file, dh_state for SCSI devices even if they are not in the internal lists X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: sekharan@linux.vnet.ibm.com, 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 Hi James, This patch was sent to the list long back and was Acked by Hannes on Aug 11. Please consider for inclusion. Let me know if you see any issues with the patch. regards, chandra ------------------------- Create the sysfs file, dh_state even if the new SCSI device is not in the any of the device handler's internal lists. Signed-Off-by: Chandra Seetharaman Acked-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: linux-2.6.31/drivers/scsi/device_handler/scsi_dh.c =================================================================== --- linux-2.6.31.orig/drivers/scsi/device_handler/scsi_dh.c +++ linux-2.6.31/drivers/scsi/device_handler/scsi_dh.c @@ -292,18 +292,15 @@ static int scsi_dh_notifier(struct notif sdev = to_scsi_device(dev); if (action == BUS_NOTIFY_ADD_DEVICE) { + err = device_create_file(dev, &scsi_dh_state_attr); + /* don't care about err */ devinfo = device_handler_match(NULL, sdev); - if (!devinfo) - goto out; - - err = scsi_dh_handler_attach(sdev, devinfo); - if (!err) - err = device_create_file(dev, &scsi_dh_state_attr); + if (devinfo) + err = scsi_dh_handler_attach(sdev, devinfo); } else if (action == BUS_NOTIFY_DEL_DEVICE) { device_remove_file(dev, &scsi_dh_state_attr); scsi_dh_handler_detach(sdev, NULL); } -out: return err; }