summaryrefslogtreecommitdiff
path: root/drivers/cdrom
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2017-07-26 18:49:19 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-30 17:18:27 +0300
commit8b52291a0743fc4db4a7495c846a6f31ee84d282 (patch)
tree2e05e2175a5d5d1597ccaf17f1f4344dc680e865 /drivers/cdrom
parent89f23d51defcb94a5026d4b5da13faf4e1150a6f (diff)
downloadlinux-8b52291a0743fc4db4a7495c846a6f31ee84d282.tar.xz
usb-storage: fix deadlock involving host lock and scsi_done
Christoph Hellwig says that since version 4.12, the kernel switched to using blk-mq by default. The old code used a softirq for handling request completions, but blk-mq can handle completions in the caller's context. This may cause a problem for usb-storage, because it invokes the ->scsi_done callback while holding the host lock, and the completion routine sometimes tries to acquire the same lock (when running the error handler, for example). The consequence is that the existing code will sometimes deadlock upon error completion of a SCSI command (with a lockdep warning). This is easy enough to fix, since usb-storage doesn't really need to hold the host lock while the callback runs. It was simpler to write it that way, but moving the call outside the locked region is pretty easy and there's no downside. That's what this patch does. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-and-tested-by: Arthur Marsh <arthur.marsh@internode.on.net> CC: Christoph Hellwig <hch@lst.de> CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/cdrom')
0 files changed, 0 insertions, 0 deletions