Message ID | 1448921420-12035-1-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
On 11/30/2015 02:10 PM, Kamal Mostafa wrote: > This is a note to let you know that I have just added a patch titled > > scsi: Fix a bdi reregistration race > > to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree > which can be found at: > > http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue > > This patch is scheduled to be released in version 3.19.8-ckt11. > > If you, or anyone else, feels it should not be added to this tree, please > reply to this email. Hello Kamal, This patch fixes a race but introduces a new bug. So it's probably better to drop this patch. More information is available in the e-mail thread that is available at http://thread.gmane.org/gmane.linux.scsi/107519. Thanks, Bart.
On Mon, 2015-11-30 at 14:14 -0800, Bart Van Assche wrote: > On 11/30/2015 02:10 PM, Kamal Mostafa wrote: > > This is a note to let you know that I have just added a patch titled > > > > scsi: Fix a bdi reregistration race > > > > to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree > > which can be found at: > > > > http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue > > > > This patch is scheduled to be released in version 3.19.8-ckt11. > > > > If you, or anyone else, feels it should not be added to this tree, please > > reply to this email. > > Hello Kamal, > > This patch fixes a race but introduces a new bug. So it's probably > better to drop this patch. More information is available in the e-mail > thread that is available at http://thread.gmane.org/gmane.linux.scsi/107519. > > Thanks, > > Bart. > Got it -- dropping this patch from 3.19-stable. Thanks very much for the heads-up, Bart. -Kamal
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index e71eb8e..f582cc1 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -1074,9 +1074,7 @@ void __scsi_remove_device(struct scsi_device *sdev) bsg_unregister_queue(sdev->request_queue); device_unregister(&sdev->sdev_dev); transport_remove_device(dev); - device_del(dev); - } else - put_device(&sdev->sdev_dev); + } /* * Stop accepting new requests and wait until all queuecommand() and @@ -1087,6 +1085,16 @@ void __scsi_remove_device(struct scsi_device *sdev) blk_cleanup_queue(sdev->request_queue); cancel_work_sync(&sdev->requeue_work); + /* + * Remove the device after blk_cleanup_queue() has been called such + * a possible bdi_register() call with the same name occurs after + * blk_cleanup_queue() has called bdi_destroy(). + */ + if (sdev->is_visible) + device_del(dev); + else + put_device(&sdev->sdev_dev); + if (sdev->host->hostt->slave_destroy) sdev->host->hostt->slave_destroy(sdev); transport_destroy_device(dev);