Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.com>
To: smfrench@gmail.com
Cc: linux-cifs@vger.kernel.org, Paulo Alcantara <pc@manguebit.com>
Subject: [PATCH 6/9] smb: client: stop flooding dmesg on failed session setups
Date: Wed, 18 Sep 2024 02:15:39 -0300	[thread overview]
Message-ID: <20240918051542.64349-6-pc@manguebit.com> (raw)
In-Reply-To: <20240918051542.64349-1-pc@manguebit.com>

Stop flooding dmesg over failed session setups as kerberos tickets
getting expired or passwords being rotated is a very common scenario.

Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
---
 fs/smb/client/connect.c | 4 +++-
 fs/smb/client/smb2pdu.c | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index e1df9f093339..a382f532974a 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -3390,6 +3390,8 @@ int cifs_mount_get_session(struct cifs_mount_ctx *mnt_ctx)
 	ses = cifs_get_smb_ses(server, ctx);
 	if (IS_ERR(ses)) {
 		rc = PTR_ERR(ses);
+		if (rc == -ENOKEY && ctx->sectype == Kerberos)
+			cifs_dbg(VFS, "Verify user has a krb5 ticket and keyutils is installed\n");
 		ses = NULL;
 		goto out;
 	}
@@ -4008,7 +4010,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
 		rc = server->ops->sess_setup(xid, ses, server, nls_info);
 
 	if (rc) {
-		cifs_server_dbg(VFS, "Send error in SessSetup = %d\n", rc);
+		cifs_server_dbg(FYI, "Send error in SessSetup = %d\n", rc);
 		spin_lock(&ses->ses_lock);
 		if (ses->ses_status == SES_IN_SETUP)
 			ses->ses_status = SES_NEED_RECON;
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index f68746becd64..1f78b7368b00 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -1626,8 +1626,8 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data)
 	spnego_key = cifs_get_spnego_key(ses, server);
 	if (IS_ERR(spnego_key)) {
 		rc = PTR_ERR(spnego_key);
-		if (rc == -ENOKEY)
-			cifs_dbg(VFS, "Verify user has a krb5 ticket and keyutils is installed\n");
+		cifs_dbg(FYI, "%s: couldn't auth with kerberos: %d\n",
+			 __func__, rc);
 		spnego_key = NULL;
 		goto out;
 	}
-- 
2.46.0


  parent reply	other threads:[~2024-09-18  5:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18  5:15 [PATCH 1/9] smb: client: avoid unnecessary reconnects when refreshing referrals Paulo Alcantara
2024-09-18  5:15 ` [PATCH 2/9] smb: client: improve purging of cached referrals Paulo Alcantara
2024-09-18  5:15 ` [PATCH 3/9] smb: client: fix DFS interlink failover Paulo Alcantara
2024-09-18  5:15 ` [PATCH 4/9] smb: client: stop flooding dmesg in smb2_calc_signature() Paulo Alcantara
2024-09-25  2:23   ` Steve French
2024-09-25 14:30     ` Paulo Alcantara
2024-09-18  5:15 ` [PATCH 5/9] smb: client: print failed session logoffs with FYI Paulo Alcantara
2024-09-18  5:15 ` Paulo Alcantara [this message]
2024-09-18  5:15 ` [PATCH 7/9] smb: client: stop flooding dmesg with automounts Paulo Alcantara
2024-09-18  5:15 ` [PATCH 8/9] smb: client: fix DFS failover in multiuser mounts Paulo Alcantara
2024-09-18  5:15 ` [PATCH 9/9] smb: client: propagate error from cifs_construct_tcon() Paulo Alcantara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240918051542.64349-6-pc@manguebit.com \
    --to=pc@manguebit.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox