]> git.baikalelectronics.ru Git - kernel.git/commit
block: mark flush request as IDLE when it is really finished
authorMing Lei <ming.lei@redhat.com>
Fri, 13 Nov 2020 13:44:48 +0000 (21:44 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Nov 2020 21:24:16 +0000 (14:24 -0700)
commitb5568f9ddf99ac87b6317fe7cea32e06fc6cb8c2
tree227d28d4d7eeb88c4bc882c185a014eeab67c9ee
parentfc7a57ec15eeab29bcb3603a7340af300829ab03
block: mark flush request as IDLE when it is really finished

For avoiding use-after-free on flush request, we call its .end_io() from
both timeout code path and __blk_mq_end_request().

When flush request's ref doesn't drop to zero, it is still used, we
can't mark it as IDLE, so fix it by marking IDLE when its refcount drops
to zero really.

Fixes: 53c65538ab25 ("blk-mq: mark flush request as IDLE in flush_end_io()")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Cc: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-flush.c