summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-14 20:07:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-14 20:07:04 -0500
commit34241af77b8696120a9735bb2579ec7044199a8b (patch)
tree79f83b31abcd58b49521136a937d39aba45739b7 /drivers/block
parentf0ad17712b9f71c24e2b8b9725230ef57232377f (diff)
parentbef13315e990fd3d3fb4c39013aefd53f06c3657 (diff)
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: - the virtio_blk stack DMA corruption fix from Christoph, fixing and issue with VMAP stacks. - O_DIRECT blkbits calculation fix from Chandan. - discard regression fix from Christoph. - queue init error handling fixes for nbd and virtio_blk, from Omar and Jeff. - two small nvme fixes, from Christoph and Guilherme. - rename of blk_queue_zone_size and bdev_zone_size to _sectors instead, to more closely follow what we do in other places in the block layer. This interface is new for this series, so let's get the naming right before releasing a kernel with this feature. From Damien. * 'for-linus' of git://git.kernel.dk/linux-block: block: don't try to discard from __blkdev_issue_zeroout sd: remove __data_len hack for WRITE SAME nvme: use blk_rq_payload_bytes scsi: use blk_rq_payload_bytes block: add blk_rq_payload_bytes block: Rename blk_queue_zone_size and bdev_zone_size nvme: apply DELAY_BEFORE_CHK_RDY quirk at probe time too nvme-rdma: fix nvme_rdma_queue_is_ready virtio_blk: fix panic in initialization error path nbd: blk_mq_init_queue returns an error code on failure, not NULL virtio_blk: avoid DMA to stack for the sense buffer do_direct_IO: Use inode->i_blkbits to compute block count to be cleaned
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nbd.c6
-rw-r--r--drivers/block/virtio_blk.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 38c576f76d36..50a2020b5b72 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1042,6 +1042,7 @@ static int __init nbd_init(void)
1042 return -ENOMEM; 1042 return -ENOMEM;
1043 1043
1044 for (i = 0; i < nbds_max; i++) { 1044 for (i = 0; i < nbds_max; i++) {
1045 struct request_queue *q;
1045 struct gendisk *disk = alloc_disk(1 << part_shift); 1046 struct gendisk *disk = alloc_disk(1 << part_shift);
1046 if (!disk) 1047 if (!disk)
1047 goto out; 1048 goto out;
@@ -1067,12 +1068,13 @@ static int __init nbd_init(void)
1067 * every gendisk to have its very own request_queue struct. 1068 * every gendisk to have its very own request_queue struct.
1068 * These structs are big so we dynamically allocate them. 1069 * These structs are big so we dynamically allocate them.
1069 */ 1070 */
1070 disk->queue = blk_mq_init_queue(&nbd_dev[i].tag_set); 1071 q = blk_mq_init_queue(&nbd_dev[i].tag_set);
1071 if (!disk->queue) { 1072 if (IS_ERR(q)) {
1072 blk_mq_free_tag_set(&nbd_dev[i].tag_set); 1073 blk_mq_free_tag_set(&nbd_dev[i].tag_set);
1073 put_disk(disk); 1074 put_disk(disk);
1074 goto out; 1075 goto out;
1075 } 1076 }
1077 disk->queue = q;
1076 1078
1077 /* 1079 /*
1078 * Tell the block layer that we are not a rotational device 1080 * Tell the block layer that we are not a rotational device
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 5545a679abd8..10332c24f961 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -56,6 +56,7 @@ struct virtblk_req {
56 struct virtio_blk_outhdr out_hdr; 56 struct virtio_blk_outhdr out_hdr;
57 struct virtio_scsi_inhdr in_hdr; 57 struct virtio_scsi_inhdr in_hdr;
58 u8 status; 58 u8 status;
59 u8 sense[SCSI_SENSE_BUFFERSIZE];
59 struct scatterlist sg[]; 60 struct scatterlist sg[];
60}; 61};
61 62
@@ -102,7 +103,8 @@ static int __virtblk_add_req(struct virtqueue *vq,
102 } 103 }
103 104
104 if (type == cpu_to_virtio32(vq->vdev, VIRTIO_BLK_T_SCSI_CMD)) { 105 if (type == cpu_to_virtio32(vq->vdev, VIRTIO_BLK_T_SCSI_CMD)) {
105 sg_init_one(&sense, vbr->req->sense, SCSI_SENSE_BUFFERSIZE); 106 memcpy(vbr->sense, vbr->req->sense, SCSI_SENSE_BUFFERSIZE);
107 sg_init_one(&sense, vbr->sense, SCSI_SENSE_BUFFERSIZE);
106 sgs[num_out + num_in++] = &sense; 108 sgs[num_out + num_in++] = &sense;
107 sg_init_one(&inhdr, &vbr->in_hdr, sizeof(vbr->in_hdr)); 109 sg_init_one(&inhdr, &vbr->in_hdr, sizeof(vbr->in_hdr));
108 sgs[num_out + num_in++] = &inhdr; 110 sgs[num_out + num_in++] = &inhdr;
@@ -628,11 +630,12 @@ static int virtblk_probe(struct virtio_device *vdev)
628 if (err) 630 if (err)
629 goto out_put_disk; 631 goto out_put_disk;
630 632
631 q = vblk->disk->queue = blk_mq_init_queue(&vblk->tag_set); 633 q = blk_mq_init_queue(&vblk->tag_set);
632 if (IS_ERR(q)) { 634 if (IS_ERR(q)) {
633 err = -ENOMEM; 635 err = -ENOMEM;
634 goto out_free_tags; 636 goto out_free_tags;
635 } 637 }
638 vblk->disk->queue = q;
636 639
637 q->queuedata = vblk; 640 q->queuedata = vblk;
638 641