target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target: iscsi: fix an error message in iscsi_check_key()
@ 2023-02-14 14:15 Maurizio Lombardi
  2023-02-23  1:48 ` Mike Christie
  2023-03-07  2:57 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Maurizio Lombardi @ 2023-02-14 14:15 UTC (permalink / raw)
  To: martin.petersen; +Cc: target-devel, michael.christie

The first half of the error message is printed by pr_err(), the second
half is printed by pr_debug().
The user will therefore see only the first part of the message
and will miss some useful information.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 drivers/target/iscsi/iscsi_target_parameters.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c
index 2317fb077db0..557516c642c3 100644
--- a/drivers/target/iscsi/iscsi_target_parameters.c
+++ b/drivers/target/iscsi/iscsi_target_parameters.c
@@ -1262,18 +1262,20 @@ static struct iscsi_param *iscsi_check_key(
 		return param;
 
 	if (!(param->phase & phase)) {
-		pr_err("Key \"%s\" may not be negotiated during ",
-				param->name);
+		char *phase_name;
+
 		switch (phase) {
 		case PHASE_SECURITY:
-			pr_debug("Security phase.\n");
+			phase_name = "Security";
 			break;
 		case PHASE_OPERATIONAL:
-			pr_debug("Operational phase.\n");
+			phase_name = "Operational";
 			break;
 		default:
-			pr_debug("Unknown phase.\n");
+			phase_name = "Unknown";
 		}
+		pr_err("Key \"%s\" may not be negotiated during %s phase.\n",
+				param->name, phase_name);
 		return NULL;
 	}
 
-- 
2.31.1


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

* Re: [PATCH] target: iscsi: fix an error message in iscsi_check_key()
  2023-02-14 14:15 [PATCH] target: iscsi: fix an error message in iscsi_check_key() Maurizio Lombardi
@ 2023-02-23  1:48 ` Mike Christie
  2023-03-07  2:57 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Christie @ 2023-02-23  1:48 UTC (permalink / raw)
  To: Maurizio Lombardi, martin.petersen; +Cc: target-devel

On 2/14/23 8:15 AM, Maurizio Lombardi wrote:
> The first half of the error message is printed by pr_err(), the second
> half is printed by pr_debug().
> The user will therefore see only the first part of the message
> and will miss some useful information.
> 
> Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
> ---
>  drivers/target/iscsi/iscsi_target_parameters.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c
> index 2317fb077db0..557516c642c3 100644
> --- a/drivers/target/iscsi/iscsi_target_parameters.c
> +++ b/drivers/target/iscsi/iscsi_target_parameters.c
> @@ -1262,18 +1262,20 @@ static struct iscsi_param *iscsi_check_key(
>  		return param;
>  
>  	if (!(param->phase & phase)) {
> -		pr_err("Key \"%s\" may not be negotiated during ",
> -				param->name);
> +		char *phase_name;
> +
>  		switch (phase) {
>  		case PHASE_SECURITY:
> -			pr_debug("Security phase.\n");
> +			phase_name = "Security";
>  			break;
>  		case PHASE_OPERATIONAL:
> -			pr_debug("Operational phase.\n");
> +			phase_name = "Operational";
>  			break;
>  		default:
> -			pr_debug("Unknown phase.\n");
> +			phase_name = "Unknown";
>  		}
> +		pr_err("Key \"%s\" may not be negotiated during %s phase.\n",
> +				param->name, phase_name);
>  		return NULL;
>  	}
>  

Reviewed-by: Mike Christie <michael.christie@oracle.com>

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

* Re: [PATCH] target: iscsi: fix an error message in iscsi_check_key()
  2023-02-14 14:15 [PATCH] target: iscsi: fix an error message in iscsi_check_key() Maurizio Lombardi
  2023-02-23  1:48 ` Mike Christie
@ 2023-03-07  2:57 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2023-03-07  2:57 UTC (permalink / raw)
  To: Maurizio Lombardi; +Cc: Martin K . Petersen, target-devel, michael.christie

On Tue, 14 Feb 2023 15:15:56 +0100, Maurizio Lombardi wrote:

> The first half of the error message is printed by pr_err(), the second
> half is printed by pr_debug().
> The user will therefore see only the first part of the message
> and will miss some useful information.
> 
> 

Applied to 6.3/scsi-fixes, thanks!

[1/1] target: iscsi: fix an error message in iscsi_check_key()
      https://git.kernel.org/mkp/scsi/c/6cc55c969b7c

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2023-03-07  2:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-14 14:15 [PATCH] target: iscsi: fix an error message in iscsi_check_key() Maurizio Lombardi
2023-02-23  1:48 ` Mike Christie
2023-03-07  2:57 ` Martin K. Petersen

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).