Re: [PATCH] Fix reference counting for failed SCSI devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



James Bottomley wrote:
> On Wed, 2005-05-25 at 08:50 +0200, Hannes Reinecke wrote:
>>>>+	class_device_put(&sdev->sdev_classdev);
>>>This is unnecessary since the class device is simply occupying a private
>>>area in the scsi_device.  As long as its never made visible to the
>>>system, its refcount is irrelevant
>>>
>>It's not. Whenever you try to rmmod the adapter it becomes highly
>>relevant. If it doesn't crash you've at least generated a memleak as the
>>class device is never freed.
>>(And these are quite a few for Wide-SCSI Double-channel adapters ...)
> 
> ?  Look at the code; you're not doing a put on a pointer to the
> sdev_classdev, you're doing a put on a reference to it.
> 
> It's defined in scsi_device.h:
> 
> struct scsi_device {
> 	...
> 	struct class_device sdev_classdev;
> 	...
> };
> 
> so it's contained within the scsi_device.  Freeing the scsi_device frees
> the classdev (and the gendev).
> 
But does not call the ->release function.

Put it the other way round: does 'rmmod aic7xxx' work for you?
It certainly did _not_ work for aic79xx, hence the fix.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@xxxxxxx
SuSE Linux AG				S390 & zSeries
MaxfeldstraÃe 5				+49 911 74053 688
90409 NÃrnberg				http://www.suse.de
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux