From: James Bottomley Date: Thu, 27 Jan 2011 21:12:37 +0000 (-0500) Subject: [SCSI] qla2xxx: Fix race that could hang kthread_stop() X-Git-Tag: v2.6.38-rc6~32^2~14 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=563585ec4bf1319f193c2f51682985bcae400cb4;p=pandora-kernel.git [SCSI] qla2xxx: Fix race that could hang kthread_stop() There is a small race window in qla2x00_do_dpc() between checking for kthread_should_stop() and going to sleep after setting TASK_INTERRUPTIBLE. If qla2x00_free_device() is called in this window, kthread_stop will wait forever because there will be no one to wake up the process. Fix by making sure we only set TASK_INTERRUPTIBLE before checking kthread_stop(). Reported-by: Bandan Das Acked-by: Madhuranath Iyengar Signed-off-by: James Bottomley --- Reading git-diff-tree failed