Re: [PATCH 12/31] bsg: Check queue type before attaching to a queue

Martin K. Petersen
2017-05-25T02:01:21Z

Bart,

> Since BSG 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 their private data.

> +
> + if (!blk_queue_scsi_sup(rq)) {

If you are renaming the flag, how about blk_queue_scsi_pdu()?

> + WARN_ONCE(true, "Attempt to register a non-SCSI queue\n");
> + return ERR_PTR(-EINVAL);
> + }
> +
> if (!blk_get_queue(rq))
> return ERR_PTR(-ENXIO);

--
Martin K. Petersen Oracle Linux Engineering