Skip to content

Commit

Permalink
scsi: target: iscsi: Fix an error message in iscsi_check_key()
Browse files Browse the repository at this point in the history
[ Upstream commit 6cc55c9 ]

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.

Link: https://lore.kernel.org/r/20230214141556.762047-1-mlombard@redhat.com
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Maurizio Lombardi authored and Greg Kroah-Hartman committed Mar 30, 2023
1 parent 40c216e commit 83e7b1d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/target/iscsi/iscsi_target_parameters.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 83e7b1d

Please sign in to comment.