Re: [PATCH 0/3] Unblock SCSI devices even if the LLD is being unloaded

2017-04-10 Thread Bart Van Assche
On Fri, 2017-03-17 at 05:54 -0700, James Bottomley wrote: > but if you want to pursue your approach fixing the > race with module exit is a requirement. Hello James, Sorry that it took so long but I finally found the time to implement and test an alternative. I will post the patches that implemen

Re: [PATCH 0/3] Unblock SCSI devices even if the LLD is being unloaded

2017-03-18 Thread Bart Van Assche
On Sat, 2017-03-18 at 07:44 -0500, James Bottomley wrote: > On Fri, 2017-03-17 at 16:40 +, Bart Van Assche wrote: > > Does your comment mean that you think there is a scenario in which > > scsi_target_block() or scsi_target_unblock() can be called while the > > text area of a SCSI LLD is being

Re: [PATCH 0/3] Unblock SCSI devices even if the LLD is being unloaded

2017-03-18 Thread James Bottomley
On Fri, 2017-03-17 at 16:40 +, Bart Van Assche wrote: > On Fri, 2017-03-17 at 05:54 -0700, James Bottomley wrote: > > So it's better to use the module without a reference in place and > > take the risk that it may exit and release its code area while > > we're calling it? > > Hello James, >

Re: [PATCH 0/3] Unblock SCSI devices even if the LLD is being unloaded

2017-03-17 Thread Bart Van Assche
On Fri, 2017-03-17 at 05:54 -0700, James Bottomley wrote: > So it's better to use the module without a reference in place and take > the risk that it may exit and release its code area while we're calling > it? Hello James, My understanding of scsi_device_get() / scsi_device_put() is that the rea

Re: [PATCH 0/3] Unblock SCSI devices even if the LLD is being unloaded

2017-03-17 Thread James Bottomley
On Thu, 2017-03-16 at 23:19 +, Bart Van Assche wrote: > On Thu, 2017-03-16 at 15:53 -0700, James Bottomley wrote: > > On Thu, 2017-03-16 at 13:56 -0700, Bart Van Assche wrote: > > > scsi_target_unblock() must unblock SCSI devices even if this > > > function > > > is called after unloading of th

Re: [PATCH 0/3] Unblock SCSI devices even if the LLD is being unloaded

2017-03-16 Thread Bart Van Assche
On Thu, 2017-03-16 at 15:53 -0700, James Bottomley wrote: > On Thu, 2017-03-16 at 13:56 -0700, Bart Van Assche wrote: > > scsi_target_unblock() must unblock SCSI devices even if this function > > is called after unloading of the LLD that created these devices has > > started. This is necessary to p

Re: [PATCH 0/3] Unblock SCSI devices even if the LLD is being unloaded

2017-03-16 Thread James Bottomley
On Thu, 2017-03-16 at 13:56 -0700, Bart Van Assche wrote: > scsi_target_unblock() must unblock SCSI devices even if this function > is called after unloading of the LLD that created these devices has > started. This is necessary to prevent that __scsi_remove_device() > hangs on the SYNCHRONIZE CAC

[PATCH 0/3] Unblock SCSI devices even if the LLD is being unloaded

2017-03-16 Thread Bart Van Assche
scsi_target_unblock() must unblock SCSI devices even if this function is called after unloading of the LLD that created these devices has started. This is necessary to prevent that __scsi_remove_device() hangs on the SYNCHRONIZE CACHE command issued by the sd driver during shutdown. Bart Van Assch