public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	Keith Busch <kbusch@kernel.org>
Cc: Damien Le Moal <dlemoal@kernel.org>, linux-nvme@lists.infradead.org
Subject: [PATCH 2/2] nvmet: add a missing endianess conversion in nvmet_execute_admin_connect
Date: Tue, 28 Jan 2025 08:55:34 +0100	[thread overview]
Message-ID: <20250128075539.693870-3-hch@lst.de> (raw)
In-Reply-To: <20250128075539.693870-1-hch@lst.de>

The kato field is little endian on the wire, but native endian in
the in-core structure, add the missing byte swap.

Fixes: 6202783184bf ("nvmet: Improve nvmet_alloc_ctrl() interface and implementation")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvme/target/fabrics-cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c
index a7ff05b3be29..eb406c90c167 100644
--- a/drivers/nvme/target/fabrics-cmd.c
+++ b/drivers/nvme/target/fabrics-cmd.c
@@ -287,7 +287,7 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req)
 	args.subsysnqn = d->subsysnqn;
 	args.hostnqn = d->hostnqn;
 	args.hostid = &d->hostid;
-	args.kato = c->kato;
+	args.kato = le32_to_cpu(c->kato);
 
 	ctrl = nvmet_alloc_ctrl(&args);
 	if (!ctrl)
-- 
2.45.2



  parent reply	other threads:[~2025-01-28  7:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28  7:55 endian fixes for nvmet Christoph Hellwig
2025-01-28  7:55 ` [PATCH 1/2] nvmet: the result field in nvmet_alloc_ctrl_args is little endian Christoph Hellwig
2025-01-28  8:02   ` Sagi Grimberg
2025-01-28  7:55 ` Christoph Hellwig [this message]
2025-01-28  8:03   ` [PATCH 2/2] nvmet: add a missing endianess conversion in nvmet_execute_admin_connect Sagi Grimberg
2025-01-28 15:07 ` endian fixes for nvmet Keith Busch

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=20250128075539.693870-3-hch@lst.de \
    --to=hch@lst.de \
    --cc=dlemoal@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox