mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-23 07:23:12 +02:00
block: handle bio_split_to_limits() NULL return
commit 613b14884b
upstream.
This can't happen right now, but in preparation for allowing
bio_split_to_limits() returning NULL if it ended the bio, check for it
in all the callers.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ba86db02d4
commit
7ec9a45fc4
|
@ -348,11 +348,13 @@ void __blk_queue_split(struct bio **bio, unsigned int *nr_segs)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
split = blk_bio_segment_split(q, *bio, &q->bio_split, nr_segs);
|
split = blk_bio_segment_split(q, *bio, &q->bio_split, nr_segs);
|
||||||
|
if (IS_ERR(split))
|
||||||
|
*bio = split = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (split) {
|
if (split) {
|
||||||
/* there isn't chance to merge the splitted bio */
|
/* there isn't chance to merge the split bio */
|
||||||
split->bi_opf |= REQ_NOMERGE;
|
split->bi_opf |= REQ_NOMERGE;
|
||||||
|
|
||||||
bio_chain(split, *bio);
|
bio_chain(split, *bio);
|
||||||
|
|
|
@ -2193,6 +2193,8 @@ blk_qc_t blk_mq_submit_bio(struct bio *bio)
|
||||||
|
|
||||||
blk_queue_bounce(q, &bio);
|
blk_queue_bounce(q, &bio);
|
||||||
__blk_queue_split(&bio, &nr_segs);
|
__blk_queue_split(&bio, &nr_segs);
|
||||||
|
if (!bio)
|
||||||
|
goto queue_exit;
|
||||||
|
|
||||||
if (!bio_integrity_prep(bio))
|
if (!bio_integrity_prep(bio))
|
||||||
goto queue_exit;
|
goto queue_exit;
|
||||||
|
|
|
@ -1602,6 +1602,8 @@ blk_qc_t drbd_submit_bio(struct bio *bio)
|
||||||
struct drbd_device *device = bio->bi_bdev->bd_disk->private_data;
|
struct drbd_device *device = bio->bi_bdev->bd_disk->private_data;
|
||||||
|
|
||||||
blk_queue_split(&bio);
|
blk_queue_split(&bio);
|
||||||
|
if (!bio)
|
||||||
|
return BLK_QC_T_NONE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* what we "blindly" assume:
|
* what we "blindly" assume:
|
||||||
|
|
|
@ -2407,6 +2407,8 @@ static blk_qc_t pkt_submit_bio(struct bio *bio)
|
||||||
struct bio *split;
|
struct bio *split;
|
||||||
|
|
||||||
blk_queue_split(&bio);
|
blk_queue_split(&bio);
|
||||||
|
if (!bio)
|
||||||
|
return BLK_QC_T_NONE;
|
||||||
|
|
||||||
pd = bio->bi_bdev->bd_disk->queue->queuedata;
|
pd = bio->bi_bdev->bd_disk->queue->queuedata;
|
||||||
if (!pd) {
|
if (!pd) {
|
||||||
|
|
|
@ -587,6 +587,8 @@ static blk_qc_t ps3vram_submit_bio(struct bio *bio)
|
||||||
dev_dbg(&dev->core, "%s\n", __func__);
|
dev_dbg(&dev->core, "%s\n", __func__);
|
||||||
|
|
||||||
blk_queue_split(&bio);
|
blk_queue_split(&bio);
|
||||||
|
if (!bio)
|
||||||
|
return BLK_QC_T_NONE;
|
||||||
|
|
||||||
spin_lock_irq(&priv->lock);
|
spin_lock_irq(&priv->lock);
|
||||||
busy = !bio_list_empty(&priv->list);
|
busy = !bio_list_empty(&priv->list);
|
||||||
|
|
|
@ -127,6 +127,8 @@ static blk_qc_t rsxx_submit_bio(struct bio *bio)
|
||||||
blk_status_t st = BLK_STS_IOERR;
|
blk_status_t st = BLK_STS_IOERR;
|
||||||
|
|
||||||
blk_queue_split(&bio);
|
blk_queue_split(&bio);
|
||||||
|
if (!bio)
|
||||||
|
return BLK_QC_T_NONE;
|
||||||
|
|
||||||
might_sleep();
|
might_sleep();
|
||||||
|
|
||||||
|
|
|
@ -458,6 +458,8 @@ static blk_qc_t md_submit_bio(struct bio *bio)
|
||||||
}
|
}
|
||||||
|
|
||||||
blk_queue_split(&bio);
|
blk_queue_split(&bio);
|
||||||
|
if (!bio)
|
||||||
|
return BLK_QC_T_NONE;
|
||||||
|
|
||||||
if (mddev->ro == 1 && unlikely(rw == WRITE)) {
|
if (mddev->ro == 1 && unlikely(rw == WRITE)) {
|
||||||
if (bio_sectors(bio) != 0)
|
if (bio_sectors(bio) != 0)
|
||||||
|
|
|
@ -329,6 +329,8 @@ static blk_qc_t nvme_ns_head_submit_bio(struct bio *bio)
|
||||||
* pool from the original queue to allocate the bvecs from.
|
* pool from the original queue to allocate the bvecs from.
|
||||||
*/
|
*/
|
||||||
blk_queue_split(&bio);
|
blk_queue_split(&bio);
|
||||||
|
if (!bio)
|
||||||
|
return BLK_QC_T_NONE;
|
||||||
|
|
||||||
srcu_idx = srcu_read_lock(&head->srcu);
|
srcu_idx = srcu_read_lock(&head->srcu);
|
||||||
ns = nvme_find_path(head);
|
ns = nvme_find_path(head);
|
||||||
|
|
|
@ -866,6 +866,8 @@ dcssblk_submit_bio(struct bio *bio)
|
||||||
unsigned long bytes_done;
|
unsigned long bytes_done;
|
||||||
|
|
||||||
blk_queue_split(&bio);
|
blk_queue_split(&bio);
|
||||||
|
if (!bio)
|
||||||
|
return BLK_QC_T_NONE;
|
||||||
|
|
||||||
bytes_done = 0;
|
bytes_done = 0;
|
||||||
dev_info = bio->bi_bdev->bd_disk->private_data;
|
dev_info = bio->bi_bdev->bd_disk->private_data;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user