diff options
author | Christoph Hellwig <hch@lst.de> | 2021-08-16 16:19:08 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-23 21:54:30 +0300 |
commit | 4a1fa41d304c7129328d4d5c7f31715b95e23b29 (patch) | |
tree | d4dc44ad63f2f1421feb50c15c2b616150af27e9 /drivers/scsi/sd.c | |
parent | a58bd7683fcb60ae24c8572f932b48bc65719b7c (diff) | |
download | linux-4a1fa41d304c7129328d4d5c7f31715b95e23b29.tar.xz |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 1c6b8f012219..610ebba0d66e 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; |