Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93F8AC6FD1F for ; Mon, 20 Mar 2023 00:54:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbjCTAyf (ORCPT ); Sun, 19 Mar 2023 20:54:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229987AbjCTAyI (ORCPT ); Sun, 19 Mar 2023 20:54:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A6491F4AB; Sun, 19 Mar 2023 17:53:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F57961151; Mon, 20 Mar 2023 00:53:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9874C433EF; Mon, 20 Mar 2023 00:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679273606; bh=dedyIN+QCvBkCBfVWpXsX2Tzfh/6ufEr3d4L7AHy/PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K93jTR6bWb2SOueZxsSKSdlrajS7zfvx4yvpx/hz9GQTWdpVQnOtxnqUM3FZq2tXh hpvZiCdr6zqyFx3HuY1mj/KdzEx508cYupHdUvkev8xkMuUi8+qBjOpiD6FqMBTM5A y4m59tld9wLk808b4yG1AJ8sszM4RsSWXEG/5BkYMekJY9ed6flRKsP1fvyZI0wrXn 7zhhMCFpHg+Bayu8LGSTt2LjkcQ2kKFE/Erv+Mv5HIqzSp+fg7Nc9/QQpR3aEpKQXb Y3M6jqPI9O6zOs42C7dRGq9Zb0fYVM0km+kgiMMhZEX8UxbLvuQKQe3Uv9w6+Dxg8v HKzF/PIEobYMQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Maurizio Lombardi , Mike Christie , "Martin K . Petersen" , Sasha Levin , mgurtovoy@nvidia.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Subject: [PATCH AUTOSEL 6.2 10/30] scsi: target: iscsi: Fix an error message in iscsi_check_key() Date: Sun, 19 Mar 2023 20:52:35 -0400 Message-Id: <20230320005258.1428043-10-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230320005258.1428043-1-sashal@kernel.org> References: <20230320005258.1428043-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maurizio Lombardi [ Upstream commit 6cc55c969b7ce8d85e09a636693d4126c3676c11 ] 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 Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- 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 2317fb077db0e..557516c642c3b 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.39.2