Skip to content

blk-mq: fix race between completion and BLK_EH_RESET_TIMER

Ming Lei linux-block stable 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 8 repliesIn review
  2. v31 patch 3 repliesSuperseded
  3. v21 patch 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch8 repliesSuperseded

Changes in v4 from the cover letter

- run synchronize_rcu() once for handling all timed out request between .timeout() and the following handling
- address tj's concern about reorder between blk_add_timer() and
blk_mq_rq_update_aborted_gstate(req, 0)

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2blk-mq: set RQF_MQ_TIMEOUT_EXPIRED when the rq's timeout isn't handledblock/blk-mq.c block/blk-timeout.c+2 -30 replies
2/2blk-mq: fix race between complete and BLK_EH_RESET_TIMERblock/blk-mq.c block/blk-mq.h include/linux/blkdev.h+102 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH V4 0/2] blk-mq: fix race between completion and BLK_EH_RESET_TIMER

Hi Jens,

This two patches fixes the recently discussed race between completion and BLK_EH_RESET_TIMER.

Israel & Martin, this one is a simpler fix on this issue and can cover the potencial hang of MQ_RQ_COMPLETE_IN_TIMEOUT request, could you test V4 and see if your issue can be fixed?

Thanks,

V4:
- run synchronize_rcu() once for handling all timed out request between .timeout() and the following handling
- address tj's concern about reorder between blk_add_timer() and
blk_mq_rq_update_aborted_gstate(req, 0)

V3:
- before completing rq for BLK_EH_HANDLED, sync with normal completion path
- make sure rq's state updated as MQ_RQ_IN_FLIGHT before completing
V2:
- rename the new flag as MQ_RQ_COMPLETE_IN_TIMEOUT
- fix lock uses in blk_mq_rq_timed_out
- document re-order between blk_add_timer() and blk_mq_rq_update_aborted_gstate(req, 0)

Ming Lei (2):
blk-mq: set RQF_MQ_TIMEOUT_EXPIRED when the rq's timeout isn't handled
blk-mq: fix race between complete and BLK_EH_RESET_TIMER

 block/blk-mq.c         | 120 +++++++++++++++++++++++++++++++++++++++----------
 block/blk-mq.h         |   1 +
 block/blk-timeout.c    |   1 -
 include/linux/blkdev.h |   6 +++
 4 files changed, 104 insertions(+), 24 deletions(-)
Signature · 1 line
2.9.5