From: FUJITA Tomonori Date: Fri, 3 Apr 2009 10:28:06 +0000 (+0900) Subject: [SCSI] sg: fix q->queue_lock on scsi_error_handler path X-Git-Tag: v2.6.30-rc1~185^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=015640edb1f346e0b2eda703587c4cd1c310ec1d;p=pandora-kernel.git [SCSI] sg: fix q->queue_lock on scsi_error_handler path sg_rq_end_io() is called via rq->end_io. In some rare cases, sg_rq_end_io calls blk_put_request/blk_rq_unmap_user (when a program issuing a command has gone before the command completion; e.g. by interrupting a program issuing a command before the command completes). We can't call blk_put_request/blk_rq_unmap_user in interrupt so the commit c96952ed7031e7c576ecf90cf95b8ec099d5295a uses execute_in_process_context(). The problem is that scsi_error_handler() calls rq->end_io too. We can't call blk_put_request/blk_rq_unmap_user too in this path (we hold q->queue_lock). To avoid the above problem, in these rare cases, this patch always uses schedule_work() instead of execute_in_process_context(). Signed-off-by: FUJITA Tomonori Acked-by: Douglas Gilbert Cc: Stable Tree Signed-off-by: James Bottomley --- Reading git-diff-tree failed