Re: sr: get/drop reference to device in revalidate and check_events

2018-04-12 Thread Martin K. Petersen
Jens, > We can't just use scsi_cd() to get the scsi_cd structure, we have > to grab a live reference to the device. For both callbacks, we're > not inside an open where we already hold a reference to the device. Applied to 4.17/scsi-fixes, thanks! -- Martin K. Petersen Oracle Linux

Re: sr: get/drop reference to device in revalidate and check_events

2018-04-11 Thread Jan Kara
On Wed 11-04-18 10:23:30, Jens Axboe wrote: > We can't just use scsi_cd() to get the scsi_cd structure, we have > to grab a live reference to the device. For both callbacks, we're > not inside an open where we already hold a reference to the device. > > This fixes device removal/addition under

Re: sr: get/drop reference to device in revalidate and check_events

2018-04-11 Thread Lee Duncan
On 04/11/2018 09:23 AM, Jens Axboe wrote: > We can't just use scsi_cd() to get the scsi_cd structure, we have > to grab a live reference to the device. For both callbacks, we're > not inside an open where we already hold a reference to the device. > > This fixes device removal/addition under

sr: get/drop reference to device in revalidate and check_events

2018-04-11 Thread Jens Axboe
We can't just use scsi_cd() to get the scsi_cd structure, we have to grab a live reference to the device. For both callbacks, we're not inside an open where we already hold a reference to the device. This fixes device removal/addition under concurrent device access, which otherwise could result