diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c index 8f06c411758f..1686ddfce77d 100644 --- a/module/zfs/vdev_disk.c +++ b/module/zfs/vdev_disk.c @@ -621,7 +621,6 @@ __vdev_disk_physio(struct block_device *bdev, zio_t *zio, bio_offset = io_offset; bio_size = io_size; for (i = 0; i <= dr->dr_bio_count; i++) { - unsigned int nr_iovecs; /* Finished constructing bio's for given buffer */ if (bio_size <= 0) @@ -639,11 +638,10 @@ __vdev_disk_physio(struct block_device *bdev, zio_t *zio, } /* bio_alloc() with __GFP_WAIT never returns NULL */ - nr_iovecs = MIN(abd_nr_pages_off(zio->io_abd, bio_size, - abd_offset), BIO_MAX_PAGES); - dr->dr_bio[i] = bio_alloc(GFP_NOIO, nr_iovecs); - if (unlikely(dr->dr_bio[i] == NULL || - (unsigned int)dr->dr_bio[i]->bi_max_vecs != nr_iovecs)) { + dr->dr_bio[i] = bio_alloc(GFP_NOIO, + MIN(abd_nr_pages_off(zio->io_abd, bio_size, abd_offset), + BIO_MAX_PAGES)); + if (unlikely(dr->dr_bio[i] == NULL)) { vdev_disk_dio_free(dr); return (SET_ERROR(ENOMEM)); }