Skip to content

Commit

Permalink
block: clear iocb->private in blkdev_bio_end_io_async()
Browse files Browse the repository at this point in the history
iocb_bio_iopoll() expects iocb->private to be cleared before
releasing the bio.

We already do this in blkdev_bio_end_io(), but we forgot in the
recently added blkdev_bio_end_io_async().

Fixes: 54a88eb ("block: add single bio async direct IO helper")
Cc: asml.silence@gmail.com
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220211090136.44471-1-sgarzare@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
stefano-garzarella authored and axboe committed Feb 22, 2022
1 parent e92bc4c commit bb49c6f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions block/fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ static void blkdev_bio_end_io_async(struct bio *bio)
struct kiocb *iocb = dio->iocb;
ssize_t ret;

WRITE_ONCE(iocb->private, NULL);

if (likely(!bio->bi_status)) {
ret = dio->size;
iocb->ki_pos += ret;
Expand Down

0 comments on commit bb49c6f

Please sign in to comment.