All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: linux-nvme@lists.infradead.org
Cc: hch@lst.de, Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
	sagi@grimberg.me
Subject: [PATCH V3 07/11] nvmet: use invalid cmd opcode helper
Date: Tue,  9 Feb 2021 21:47:58 -0800	[thread overview]
Message-ID: <20210210054802.34269-8-chaitanya.kulkarni@wdc.com> (raw)
In-Reply-To: <20210210054802.34269-1-chaitanya.kulkarni@wdc.com>

In the NVMeOF block device backend, file backend, and passthru backend
we reject and report the commands if opcode is not handled.

Use the previously introduced helper in the passthru backend to make the
error message uniform.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/nvme/target/passthru.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c
index cbc88acdd233..3b22f4a868f4 100644
--- a/drivers/nvme/target/passthru.c
+++ b/drivers/nvme/target/passthru.c
@@ -494,7 +494,7 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req)
 		return nvmet_setup_passthru_command(req);
 	default:
 		/* Reject commands not in the allowlist above */
-		return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
+		return nvmet_report_invalid_opcode(req);
 	}
 }
 
-- 
2.22.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2021-02-10  5:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10  5:47 [PATCH V3 00/11] nvmet: fixes and some cleanups Chaitanya Kulkarni
2021-02-10  5:47 ` [PATCH V3 01/11] nvmet: set status to 0 in case for invalid nsid Chaitanya Kulkarni
2021-02-10  5:47 ` [PATCH V3 02/11] nvmet: return uniform error for invalid ns Chaitanya Kulkarni
2021-02-10  5:47 ` [PATCH V3 03/11] nvmet: make nvmet_find_namespace() req based Chaitanya Kulkarni
2021-02-10  5:47 ` [PATCH V3 04/11] nvmet: remove extra variable in id-ns handler Chaitanya Kulkarni
2021-02-10  5:47 ` [PATCH V3 05/11] nvmet: add helper to report invalid opcode Chaitanya Kulkarni
2021-02-10  8:12   ` Christoph Hellwig
2021-02-10  5:47 ` [PATCH V3 06/11] nvmet: use invalid cmd opcode helper Chaitanya Kulkarni
2021-02-10  5:47 ` Chaitanya Kulkarni [this message]
2021-02-10  5:47 ` [PATCH V3 08/11] nvmet: use min of device_path and disk len Chaitanya Kulkarni
2021-02-10  8:13   ` Christoph Hellwig
2021-02-10  5:48 ` [PATCH V3 09/11] nvme-loop: rename variable to get rid of the warn Chaitanya Kulkarni
2021-02-10  8:13   ` Christoph Hellwig
2021-02-10  8:18     ` Chaitanya Kulkarni
2021-02-10  8:23       ` Christoph Hellwig
2021-02-10  5:48 ` [PATCH V3 10/11] nvmet: add nvmet_req_subsys() helper Chaitanya Kulkarni
2021-02-10  5:48 ` [PATCH V3 11/11] nvmet: remove else at the end of the function Chaitanya Kulkarni
2021-02-10  8:11 ` [PATCH V3 00/11] nvmet: fixes and some cleanups Christoph Hellwig
2021-02-10  8:52   ` Chaitanya Kulkarni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210210054802.34269-8-chaitanya.kulkarni@wdc.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=hch@lst.de \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.