From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263622AbTLSUXx (ORCPT ); Fri, 19 Dec 2003 15:23:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263609AbTLSUXx (ORCPT ); Fri, 19 Dec 2003 15:23:53 -0500 Received: from stat1.steeleye.com ([65.114.3.130]:5795 "EHLO hancock.sc.steeleye.com") by vger.kernel.org with ESMTP id S263607AbTLSUXu (ORCPT ); Fri, 19 Dec 2003 15:23:50 -0500 Subject: Re: [RFC] 2.6.0 EDD enhancements From: James Bottomley To: Matt Domsch Cc: Linux Kernel , SCSI Mailing List In-Reply-To: <20031219130129.B6530@lists.us.dell.com> References: <20031219130129.B6530@lists.us.dell.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 (1.0.8-9) Date: 19 Dec 2003 15:23:21 -0500 Message-Id: <1071865401.1943.31.camel@mulgrave> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2003-12-19 at 14:01, Matt Domsch wrote: > @@ -639,11 +629,11 @@ > pci_dev = edd_get_pci_dev(edev); > if (pci_dev) { > struct scsi_device * sdev = edd_find_matching_scsi_device(edev); > - if (sdev && get_device(&sdev->sdev_driverfs_dev)) { > + if (sdev && get_device(&sdev->sdev_gendev)) { > rc = sysfs_create_link(&edev->kobj, > - &sdev->sdev_driverfs_dev.kobj, > + &sdev->sdev_gendev.kobj, > "disc"); > - put_device(&sdev->sdev_driverfs_dev); > + put_device(&sdev->sdev_gendev); This is a bit nasty...you're assuming a lot of hidden knowledge about the layout of sysfs objects in scsi_device in this code. The current(*) way you should be doing this is to use scsi_device_get() in your edd_match_scsi_dev() and do a scsi_device_put() after creating the link...that should be hotplug robust. (*) since SCSI hotplug is a work in progress, this may change... James