mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 01:49:36 +00:00
pktcdvd: Check queue type before attaching to a queue
Since the pktcdvd driver only supports request queues for which
struct scsi_request is the first member of their private request
data, refuse to register block layer queues for which struct
scsi_request is not the first member of the private data.
References: commit 82ed4db499
("block: split scsi_request out of struct request")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
parent
d9f9726446
commit
ec2be6a98e
1 changed files with 5 additions and 0 deletions
|
@ -2583,6 +2583,11 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev)
|
||||||
bdev = bdget(dev);
|
bdev = bdget(dev);
|
||||||
if (!bdev)
|
if (!bdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
if (!blk_queue_scsi_passthrough(bdev_get_queue(bdev))) {
|
||||||
|
WARN_ONCE(true, "Attempt to register a non-SCSI queue\n");
|
||||||
|
bdput(bdev);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
ret = blkdev_get(bdev, FMODE_READ | FMODE_NDELAY, NULL);
|
ret = blkdev_get(bdev, FMODE_READ | FMODE_NDELAY, NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue