Re: Synchronizing scsi_remove_host and the error handler

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

 



On Sun, 2005-08-07 at 14:43 -0400, Alan Stern wrote:
> What host device release method?  scsi_host_template->release is marked 
> OBSOLETE and for use only with old-style drivers.  scsi_host_dev_release 
                                                     ^^^^^
This is the one I was thinking of adding to.

> is the only release method for hosts, and it doesn't notify the LLD in any 
> way.
> 
> Anyhow, I'm not so concerned about releasing resources associated with the
> host.  The LLD can handle that easily enough by first flagging the HBA
> as not accessible, then waiting for current I/O to terminate, then
> calling scsi_remove_host.  The resources can be released any time after
> the current I/O is finished; it doesn't matter whether the host is removed
> before or after.
> 
> The only resource that matters for this discussion is associated with the
> LLD itself, not with any of its hosts: the host template.  Once the SCSI
> core has released all references to the template, it can't call the LLD
> any more.  The problem is that the LLD has no way to know when all the
> references have been dropped.  This suggests that the entire problem could
> be solved by adding a kref to struct scsi_host_template.
> 
> Would you agree to a patch adding such a kref?

Well, not really.  The host template usually exists as a variable in the
module, so its lifetime is tied to the lifetime of the module.  Adding a
kref wouldn't help because it will still be freed when the module is
removed.  If there's a case where the template is being freed
prematurely because the module is being removed, then we have the module
refcounting wrong somewhere.  Have you run across such a case?

James


-
: 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