[PATCH, resend2] nvme-rdma: reject non-connect commands before the queue is live
Sagi Grimberg
sagi at grimberg.me
Tue Nov 1 07:32:57 PDT 2016
> @@ -1394,10 +1398,18 @@ static int nvme_rdma_queue_rq(struct blk_mq_hw_ctx *hctx,
>
> WARN_ON_ONCE(rq->tag < 0);
>
> + c = (struct nvme_command *)rq->cmd;
> + if (!test_bit(NVME_RDMA_Q_LIVE, &queue->flags) &&
> + rq->cmd_type != REQ_TYPE_DRV_PRIV &&
> + (c->common.opcode != nvme_fabrics_command ||
> + c->fabrics.fctype != nvme_fabrics_type_connect))
> + return BLK_MQ_RQ_QUEUE_BUSY;
> +
Can we hide this mess in a static inline nvme_rdma_chk_ready()?
More information about the Linux-nvme
mailing list