diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2009-02-04 11:36:27 +0900 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-03-12 12:58:12 -0500 |
commit | c96952ed7031e7c576ecf90cf95b8ec099d5295a (patch) | |
tree | 4217498cf82131f6c870b0f92fea7039596fa0e7 /drivers/scsi/osd | |
parent | a3b7aeaba29e3dd995ece05ba50db9e0650c16b6 (diff) | |
download | linux-3.10-c96952ed7031e7c576ecf90cf95b8ec099d5295a.tar.gz linux-3.10-c96952ed7031e7c576ecf90cf95b8ec099d5295a.tar.bz2 linux-3.10-c96952ed7031e7c576ecf90cf95b8ec099d5295a.zip |
[SCSI] sg: avoid blk_put_request/blk_rq_unmap_user in interrupt
This fixes the following oops:
http://marc.info/?l=linux-kernel&m=123316111415677&w=2
You can reproduce this bug by interrupting a program before a sg
response completes. This leads to the special sg state (the orphan
state), then sg calls blk_put_request in interrupt (rq->end_io).
The above bug report shows the recursive lock problem because sg calls
blk_put_request in interrupt. We could call __blk_put_request here
instead however we also need to handle blk_rq_unmap_user here, which
can't be called in interrupt too.
In the orphan state, we don't need to care about the data transfer
(the program revoked the command) so adding 'just free the resource'
mode to blk_rq_unmap_user is a possible option.
I prefer to avoid complicating the blk mapping API when possible. I
change the orphan state to call sg_finish_rem_req via
execute_in_process_context. We hold sg_fd->kref so sg_fd doesn't go
away until keventd_wq finishes our work. copy_from_user/to_user fails
so blk_rq_unmap_user just frees the resource without the data
transfer.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/osd')
0 files changed, 0 insertions, 0 deletions