]> git.baikalelectronics.ru Git - kernel.git/commitdiff
block: clear iocb->private in blkdev_bio_end_io_async()
authorStefano Garzarella <sgarzare@redhat.com>
Fri, 11 Feb 2022 09:01:36 +0000 (10:01 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 22 Feb 2022 13:59:49 +0000 (06:59 -0700)
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: 4f9ac294704a ("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>
block/fops.c

index 4f59e0f5bf30966214064260c9a4119773b2bff7..a18e7fbd97b8bf19ed26d85533782ac58bf6e5a8 100644 (file)
@@ -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;