So I added a printk to the commit revert:
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index 9280e253bf09..6f831bcb87a8 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -2202,6 +2202,8 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr;
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr;
+ printk(KERN_ERR "cifs_get_smb_ses being called 123abc penguin\n");
+
xid = get_xid();
ses = cifs_find_smb_ses(server, ctx);
@@ -2210,20 +2212,21 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
ses->ses_status);
spin_lock(&ses->chan_lock);
+
+ mutex_lock(&ses->session_mutex);
+ rc = cifs_negotiate_protocol(xid, ses, server);
+ if (rc) {
+ mutex_unlock(&ses->session_mutex);
+ /* problem -- put our ses reference */
+ cifs_put_smb_ses(ses);
+ free_xid(xid);
+ return ERR_PTR(rc);
+ }
+
if (cifs_chan_needs_reconnect(ses, server)) {
spin_unlock(&ses->chan_lock);
cifs_dbg(FYI, "Session needs reconnect\n");
- mutex_lock(&ses->session_mutex);
- rc = cifs_negotiate_protocol(xid, ses, server);
- if (rc) {
- mutex_unlock(&ses->session_mutex);
- /* problem -- put our ses reference */
- cifs_put_smb_ses(ses);
- free_xid(xid);
- return ERR_PTR(rc);
- }
-
rc = cifs_setup_session(xid, ses, server,
ctx->local_nls);
if (rc) {
But it never appears in dmesg or syslog, even after switching to a tty and freezing - or not. So it looks like this section of code is not used. I don't use any samba things and also did -Rs samba caja-share to remove the samba package and related items, which has not changed the situation either. Kernel internals sometimes defy ordinary logic.
Update:
I installed Gnome desktop (which uses wayland) and gdm, starting the Mate desktop with gdm still has the problem, so it isn't xinitrc, but Gnome using Wayland is not affected, while Gnome using Xorg is, so it is an Xorg bug it seems.