linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] nvmet-auth: fix some minor bugs
@ 2024-04-10  9:48 Maurizio Lombardi
  2024-04-10  9:48 ` [PATCH 1/2] nvmet-auth: return the error code to the nvmet_auth_host_hash() callers Maurizio Lombardi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Maurizio Lombardi @ 2024-04-10  9:48 UTC (permalink / raw)
  To: kbusch; +Cc: sagi, hare, dwagner, linux-nvme

First patch modifies nvmet_auth_host_hash() so it correctly returns
the error code to its caller.

The second patch replaces a pr_debug() with pr_err().

Maurizio Lombardi (2):
  nvmet-auth: return the error code to the nvmet_auth_host_hash()
    callers
  nvmet-auth: replace pr_debug() with pr_err() to report an error.

 drivers/nvme/target/auth.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.39.3



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] nvmet-auth: return the error code to the nvmet_auth_host_hash() callers
  2024-04-10  9:48 [PATCH 0/2] nvmet-auth: fix some minor bugs Maurizio Lombardi
@ 2024-04-10  9:48 ` Maurizio Lombardi
  2024-04-10 13:57   ` Sagi Grimberg
  2024-04-16  2:51   ` Chaitanya Kulkarni
  2024-04-10  9:48 ` [PATCH 2/2] nvmet-auth: replace pr_debug() with pr_err() to report an error Maurizio Lombardi
  2024-04-16 16:44 ` [PATCH 0/2] nvmet-auth: fix some minor bugs Keith Busch
  2 siblings, 2 replies; 8+ messages in thread
From: Maurizio Lombardi @ 2024-04-10  9:48 UTC (permalink / raw)
  To: kbusch; +Cc: sagi, hare, dwagner, linux-nvme

If the nvmet_auth_host_hash() function fails, the error code should
be returned to its callers.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 drivers/nvme/target/auth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/auth.c b/drivers/nvme/target/auth.c
index 3ddbc3880cac..9e51c064b072 100644
--- a/drivers/nvme/target/auth.c
+++ b/drivers/nvme/target/auth.c
@@ -370,7 +370,7 @@ int nvmet_auth_host_hash(struct nvmet_req *req, u8 *response,
 	nvme_auth_free_key(transformed_key);
 out_free_tfm:
 	crypto_free_shash(shash_tfm);
-	return 0;
+	return ret;
 }
 
 int nvmet_auth_ctrl_hash(struct nvmet_req *req, u8 *response,
-- 
2.39.3



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] nvmet-auth: replace pr_debug() with pr_err() to report an error.
  2024-04-10  9:48 [PATCH 0/2] nvmet-auth: fix some minor bugs Maurizio Lombardi
  2024-04-10  9:48 ` [PATCH 1/2] nvmet-auth: return the error code to the nvmet_auth_host_hash() callers Maurizio Lombardi
@ 2024-04-10  9:48 ` Maurizio Lombardi
  2024-04-10 13:57   ` Sagi Grimberg
  2024-04-16  2:51   ` Chaitanya Kulkarni
  2024-04-16 16:44 ` [PATCH 0/2] nvmet-auth: fix some minor bugs Keith Busch
  2 siblings, 2 replies; 8+ messages in thread
From: Maurizio Lombardi @ 2024-04-10  9:48 UTC (permalink / raw)
  To: kbusch; +Cc: sagi, hare, dwagner, linux-nvme

In nvmet_auth_host_hash(), if a mismatch is detected in the hash length
the kernel should print an error.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 drivers/nvme/target/auth.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/target/auth.c b/drivers/nvme/target/auth.c
index 9e51c064b072..fb518b00f71f 100644
--- a/drivers/nvme/target/auth.c
+++ b/drivers/nvme/target/auth.c
@@ -285,9 +285,9 @@ int nvmet_auth_host_hash(struct nvmet_req *req, u8 *response,
 	}
 
 	if (shash_len != crypto_shash_digestsize(shash_tfm)) {
-		pr_debug("%s: hash len mismatch (len %d digest %d)\n",
-			 __func__, shash_len,
-			 crypto_shash_digestsize(shash_tfm));
+		pr_err("%s: hash len mismatch (len %d digest %d)\n",
+			__func__, shash_len,
+			crypto_shash_digestsize(shash_tfm));
 		ret = -EINVAL;
 		goto out_free_tfm;
 	}
-- 
2.39.3



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] nvmet-auth: return the error code to the nvmet_auth_host_hash() callers
  2024-04-10  9:48 ` [PATCH 1/2] nvmet-auth: return the error code to the nvmet_auth_host_hash() callers Maurizio Lombardi
@ 2024-04-10 13:57   ` Sagi Grimberg
  2024-04-16  2:51   ` Chaitanya Kulkarni
  1 sibling, 0 replies; 8+ messages in thread
From: Sagi Grimberg @ 2024-04-10 13:57 UTC (permalink / raw)
  To: Maurizio Lombardi, kbusch; +Cc: hare, dwagner, linux-nvme

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] nvmet-auth: replace pr_debug() with pr_err() to report an error.
  2024-04-10  9:48 ` [PATCH 2/2] nvmet-auth: replace pr_debug() with pr_err() to report an error Maurizio Lombardi
@ 2024-04-10 13:57   ` Sagi Grimberg
  2024-04-16  2:51   ` Chaitanya Kulkarni
  1 sibling, 0 replies; 8+ messages in thread
From: Sagi Grimberg @ 2024-04-10 13:57 UTC (permalink / raw)
  To: Maurizio Lombardi, kbusch; +Cc: hare, dwagner, linux-nvme

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] nvmet-auth: return the error code to the nvmet_auth_host_hash() callers
  2024-04-10  9:48 ` [PATCH 1/2] nvmet-auth: return the error code to the nvmet_auth_host_hash() callers Maurizio Lombardi
  2024-04-10 13:57   ` Sagi Grimberg
@ 2024-04-16  2:51   ` Chaitanya Kulkarni
  1 sibling, 0 replies; 8+ messages in thread
From: Chaitanya Kulkarni @ 2024-04-16  2:51 UTC (permalink / raw)
  To: linux-nvme

On 4/10/24 02:48, Maurizio Lombardi wrote:
> If the nvmet_auth_host_hash() function fails, the error code should
> be returned to its callers.
>
> Signed-off-by: Maurizio Lombardi<mlombard@redhat.com>
> ---

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] nvmet-auth: replace pr_debug() with pr_err() to report an error.
  2024-04-10  9:48 ` [PATCH 2/2] nvmet-auth: replace pr_debug() with pr_err() to report an error Maurizio Lombardi
  2024-04-10 13:57   ` Sagi Grimberg
@ 2024-04-16  2:51   ` Chaitanya Kulkarni
  1 sibling, 0 replies; 8+ messages in thread
From: Chaitanya Kulkarni @ 2024-04-16  2:51 UTC (permalink / raw)
  To: Maurizio Lombardi, kbusch; +Cc: sagi, hare, dwagner, linux-nvme

On 4/10/24 02:48, Maurizio Lombardi wrote:
> In nvmet_auth_host_hash(), if a mismatch is detected in the hash length
> the kernel should print an error.
>
> Signed-off-by: Maurizio Lombardi<mlombard@redhat.com>
> ---
>   drivers/nvme/target/auth.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] nvmet-auth: fix some minor bugs
  2024-04-10  9:48 [PATCH 0/2] nvmet-auth: fix some minor bugs Maurizio Lombardi
  2024-04-10  9:48 ` [PATCH 1/2] nvmet-auth: return the error code to the nvmet_auth_host_hash() callers Maurizio Lombardi
  2024-04-10  9:48 ` [PATCH 2/2] nvmet-auth: replace pr_debug() with pr_err() to report an error Maurizio Lombardi
@ 2024-04-16 16:44 ` Keith Busch
  2 siblings, 0 replies; 8+ messages in thread
From: Keith Busch @ 2024-04-16 16:44 UTC (permalink / raw)
  To: Maurizio Lombardi; +Cc: sagi, hare, dwagner, linux-nvme

On Wed, Apr 10, 2024 at 11:48:40AM +0200, Maurizio Lombardi wrote:
> First patch modifies nvmet_auth_host_hash() so it correctly returns
> the error code to its caller.
> 
> The second patch replaces a pr_debug() with pr_err().

Thanks, applied to nvme-6.9.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-04-16 16:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-10  9:48 [PATCH 0/2] nvmet-auth: fix some minor bugs Maurizio Lombardi
2024-04-10  9:48 ` [PATCH 1/2] nvmet-auth: return the error code to the nvmet_auth_host_hash() callers Maurizio Lombardi
2024-04-10 13:57   ` Sagi Grimberg
2024-04-16  2:51   ` Chaitanya Kulkarni
2024-04-10  9:48 ` [PATCH 2/2] nvmet-auth: replace pr_debug() with pr_err() to report an error Maurizio Lombardi
2024-04-10 13:57   ` Sagi Grimberg
2024-04-16  2:51   ` Chaitanya Kulkarni
2024-04-16 16:44 ` [PATCH 0/2] nvmet-auth: fix some minor bugs Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).