Re: [RFC] How to fix an async scan - rmmod race?

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

 



On 04/06/2012 04:38 PM, Bart Van Assche wrote:
> On 04/06/12 13:13, Tomas Henzl wrote:
>
>> This means that after scsi_remove_host is left and the driver rmmoded
>> we call scsi_host_put which in the end calls scsi_host_dev_release
>> and this function tries to use the now invalid host_template
>> functions again.
> There are already several other ways in which the host template can be
> accessed after scsi_remove_host() finished:
> * Via the scsi_proc_hostdir_rm() call in scsi_host_dev_release().
This ^ is actually the case i wrote about in my previous mail.

> * From the SCSI error handler thread.
> * From inside scsi_dispatch_cmd().
>
> Why isn't the SCSI error handler thread stopped from inside
> scsi_remove_host() ? And why isn't scsi_proc_hostdir_rm() invoked from
> inside scsi_remove_host() ? Am I missing something ?
I'm not the right person to answer this, but it might be really so bad
that the only reason is that module unload of a scsi driver is not used often.

Going back to my initial case, resetting the host template to zero in 
scsi_remove_host and using a locking mechanism to protect host template
would also solve the scan problem (and maybe some other too), what do you think?

tomash

>
> Thanks,
>
> Bart.
> --
> To unsubscribe from this list: 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

--
To unsubscribe from this list: 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