From: Jens Axboe Date: Thu, 24 Apr 2014 14:51:47 +0000 (-0600) Subject: blk-mq: fix race with timeouts and requeue events X-Git-Tag: omap-for-v3.16/fixes-against-rc1~39^2~49^2~58 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87ee7b112193bd081ba1a171fa5f6f39c429ef56;p=pandora-kernel.git blk-mq: fix race with timeouts and requeue events If a requeue event races with a timeout, we can get into the situation where we attempt to complete a request from the timeout handler when it's not start anymore. This causes a crash. So have the timeout handler check that REQ_ATOM_STARTED is still set on the request - if not, we ignore the event. If this happens, the request has now been marked as complete. As a consequence, we need to ensure to clear REQ_ATOM_COMPLETE in blk_mq_start_request(), as to maintain proper request state. Signed-off-by: Jens Axboe --- Reading git-diff-tree failed