diff options
Diffstat (limited to 'block/blk-flush.c')
-rw-r--r-- | block/blk-flush.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c index aedd9320e605..1eec9cbe5a0a 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c | |||
@@ -214,6 +214,16 @@ static void flush_end_io(struct request *flush_rq, blk_status_t error) | |||
214 | 214 | ||
215 | /* release the tag's ownership to the req cloned from */ | 215 | /* release the tag's ownership to the req cloned from */ |
216 | spin_lock_irqsave(&fq->mq_flush_lock, flags); | 216 | spin_lock_irqsave(&fq->mq_flush_lock, flags); |
217 | |||
218 | if (!refcount_dec_and_test(&flush_rq->ref)) { | ||
219 | fq->rq_status = error; | ||
220 | spin_unlock_irqrestore(&fq->mq_flush_lock, flags); | ||
221 | return; | ||
222 | } | ||
223 | |||
224 | if (fq->rq_status != BLK_STS_OK) | ||
225 | error = fq->rq_status; | ||
226 | |||
217 | hctx = flush_rq->mq_hctx; | 227 | hctx = flush_rq->mq_hctx; |
218 | if (!q->elevator) { | 228 | if (!q->elevator) { |
219 | blk_mq_tag_set_rq(hctx, flush_rq->tag, fq->orig_rq); | 229 | blk_mq_tag_set_rq(hctx, flush_rq->tag, fq->orig_rq); |