aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-08-16 15:19:08 +0200
committerJens Axboe <axboe@kernel.dk>2021-08-23 12:54:30 -0600
commit4a1fa41d304c7129328d4d5c7f31715b95e23b29 (patch)
treed4dc44ad63f2f1421feb50c15c2b616150af27e9 /drivers/scsi/sd.c
parenta58bd7683fcb60ae24c8572f932b48bc65719b7c (diff)
downloadlinux-4a1fa41d304c7129328d4d5c7f31715b95e23b29.tar.gz
block: pass a request_queue to __blk_alloc_disk
Pass in a request_queue and assign disk->queue in __blk_alloc_disk to ensure struct gendisk always has a valid ->queue pointer. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20210816131910.615153-8-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r--drivers/scsi/sd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 1c6b8f0122198..610ebba0d66e4 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3409,7 +3409,8 @@ static int sd_probe(struct device *dev)
if (!sdkp)
goto out;
- gd = __alloc_disk_node(NUMA_NO_NODE, &sd_bio_compl_lkclass);
+ gd = __alloc_disk_node(sdp->request_queue, NUMA_NO_NODE,
+ &sd_bio_compl_lkclass);
if (!gd)
goto out_free;
@@ -3459,7 +3460,6 @@ static int sd_probe(struct device *dev)
gd->fops = &sd_fops;
gd->private_data = &sdkp->driver;
- gd->queue = sdkp->device->request_queue;
/* defaults, until the device tells us otherwise */
sdp->sector_size = 512;