Skip to contentSkip to conversation

nvme: submit internal commands through the block layer

DISCUSSION Christoph Hellwig 2 participants 2 messages May 27, 2015 1 message not in the archive NVMe

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20150526090815.GA32137@mwanda

Christoph Hellwig

author maintainer
#1 lore raw
Quoted 5 lines · Dan Carpenter

drivers/block/nvme-core.c
853 */

   854		if (ns && ns->ms && !blk_integrity_rq(req)) {
                    ^^

Patch adds a new check.

Correctly so ..

Quoted 11 lines
   912		nvme_set_info(cmd, iod, req_completion);
   913		spin_lock_irq(&nvmeq->q_lock);
   914		if (req->cmd_type == REQ_TYPE_DRV_PRIV)
   915			nvme_submit_priv(nvmeq, req, iod);
   916		else if (req->cmd_flags & REQ_DISCARD)
   917			nvme_submit_discard(nvmeq, ns, req, iod);
                                                   ^^

Dereferenced inside function.

   918		else if (req->cmd_flags & REQ_FLUSH)
   919			nvme_submit_flush(nvmeq, ns, req->tag);

We'll only get REQ_TYPE_DRV_PRIV requests through the passthrough interface, so this is unrechable.

#2 lore raw
Quoted 18 lines · Christoph Hellwig
Quoted 5 lines · Dan Carpenter

drivers/block/nvme-core.c
853 */

   854		if (ns && ns->ms && !blk_integrity_rq(req)) {
                    ^^

Patch adds a new check.

Correctly so ..

Quoted 9 lines
   912		nvme_set_info(cmd, iod, req_completion);
   913		spin_lock_irq(&nvmeq->q_lock);
   914		if (req->cmd_type == REQ_TYPE_DRV_PRIV)
   915			nvme_submit_priv(nvmeq, req, iod);
   916		else if (req->cmd_flags & REQ_DISCARD)
   917			nvme_submit_discard(nvmeq, ns, req, iod);
                                                   ^^

Dereferenced inside function.

Quoted 5 lines
Quoted 2 lines
   918		else if (req->cmd_flags & REQ_FLUSH)
   919			nvme_submit_flush(nvmeq, ns, req->tag);

We'll only get REQ_TYPE_DRV_PRIV requests through the passthrough interface, so this is unrechable.

Thanks for looking into this, Christoph.

regards,
dan carpenter