Re: [PATCH] target: iscsi: fix an error message in iscsi_check_key()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx>



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux