Re: [PATCH v11 1/9] Fix race between starved list and device removal

2013-06-24 Thread James Bottomley
On Mon, 2013-06-24 at 12:24 -0500, Mike Christie wrote: > On 06/24/2013 10:38 AM, James Bottomley wrote: > > On Wed, 2013-06-12 at 14:49 +0200, Bart Van Assche wrote: > >> scsi_run_queue() examines all SCSI devices that are present on > >> the starved list. Since scsi_run_queue() unlocks the SCSI h

Re: [PATCH v11 1/9] Fix race between starved list and device removal

2013-06-24 Thread Mike Christie
On 06/24/2013 10:38 AM, James Bottomley wrote: > On Wed, 2013-06-12 at 14:49 +0200, Bart Van Assche wrote: >> scsi_run_queue() examines all SCSI devices that are present on >> the starved list. Since scsi_run_queue() unlocks the SCSI host >> lock before running a queue a SCSI device can get removed

Re: [PATCH v11 1/9] Fix race between starved list and device removal

2013-06-24 Thread James Bottomley
On Mon, 2013-06-24 at 18:16 +0200, Bart Van Assche wrote: > On 06/24/13 17:38, James Bottomley wrote: > > I really don't like this because it's shuffling potentially fragile > > lifetime rules since you now have to have the sdev deleted from the > > starved list before final put. That becomes an u

Re: [PATCH v11 1/9] Fix race between starved list and device removal

2013-06-24 Thread Bart Van Assche
On 06/24/13 17:38, James Bottomley wrote: I really don't like this because it's shuffling potentially fragile lifetime rules since you now have to have the sdev deleted from the starved list before final put. That becomes an unstated assumption within the code. The theory is that the starved li

Re: [PATCH v11 1/9] Fix race between starved list and device removal

2013-06-24 Thread James Bottomley
On Wed, 2013-06-12 at 14:49 +0200, Bart Van Assche wrote: > scsi_run_queue() examines all SCSI devices that are present on > the starved list. Since scsi_run_queue() unlocks the SCSI host > lock before running a queue a SCSI device can get removed after > it has been removed from the starved list a

[PATCH v11 1/9] Fix race between starved list and device removal

2013-06-12 Thread Bart Van Assche
scsi_run_queue() examines all SCSI devices that are present on the starved list. Since scsi_run_queue() unlocks the SCSI host lock before running a queue a SCSI device can get removed after it has been removed from the starved list and before its queue is run. Protect against that race condition by