Skip to contentSkip to conversation

FAILED: patch "[PATCH] CIFS: remove bad_network_name flag" failed to apply to 4.10-stable tree

PATCH New [email protected] 2 participants 4 messages Apr 18, 2017 – Apr 21, 2017 Stable branch

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From a0918f1ce6a43ac980b42b300ec443c154970979 Mon Sep 17 00:00:00 2001

From: Germano Percossi <[email protected]>
Date: Fri, 7 Apr 2017 12:29:37 +0100
Subject: [PATCH] CIFS: remove bad_network_name flag

STATUS_BAD_NETWORK_NAME can be received during node failover, causing the flag to be set and making the reconnect thread always unsuccessful, thereafter.

Once the only place where it is set is removed, the remaining bits are rendered moot.

Removing it does not prevent "mount" from failing when a non existent share is passed.

What happens when the share really ceases to exist while the share is mounted is undefined now as much as it was before.

fs/cifs/cifsglob.h +0 -1
index d07f13a63369..37f5a41cc50c 100644
@@ -948,7 +948,6 @@ struct cifs_tcon {
 	bool use_persistent:1; /* use persistent instead of durable handles */
 #ifdef CONFIG_CIFS_SMB2
 	bool print:1;		/* set if connection to printer share */
-	bool bad_network_name:1; /* set if ret status STATUS_BAD_NETWORK_NAME */
 	__le32 capabilities;
 	__u32 share_flags;
 	__u32 maximal_access;
fs/cifs/smb2pdu.c +0 -5
index d09e98bb8584..1bd5d3033fc8 100644
@@ -1171,9 +1171,6 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
 	else
 		return -EIO;
 
-	if (tcon && tcon->bad_network_name)
-		return -ENOENT;
-
 	unc_path = kmalloc(MAX_SHARENAME_LENGTH * 2, GFP_KERNEL);
 	if (unc_path == NULL)
 		return -ENOMEM;
@@ -1277,8 +1274,6 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
 tcon_error_exit:
 	if (rsp->hdr.sync_hdr.Status == STATUS_BAD_NETWORK_NAME) {
 		cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree);
-		if (tcon)
-			tcon->bad_network_name = true;
 	}
 	goto tcon_exit;
 }
#1 lore raw

This is the backport of the original patch that did not apply cleanly.

It works for 4.10-stable, 4.9-stable and 4.4-stable.

Hope I sent it in the right format

Germano

author maintainer
#2 lore raw
Quoted 5 lines · Germano Percossi

This is the backport of the original patch that did not apply cleanly.

It works for 4.10-stable, 4.9-stable and 4.4-stable.

Hope I sent it in the right format

That worked, thanks!

greg k-h

#3 lore raw

PATCH 1/1 CIFS: remove bad_network_name flag

In reply to [email protected]

commit a0918f1ce6a43ac980b42b300ec443c154970979 upstream

STATUS_BAD_NETWORK_NAME can be received during node failover, causing the flag to be set and making the reconnect thread always unsuccessful, thereafter.

Once the only place where it is set is removed, the remaining bits are rendered moot.

Removing it does not prevent "mount" from failing when a non existent share is passed.

What happens when the share really ceases to exist while the share is mounted is undefined now as much as it was before.

---
 fs/cifs/cifsglob.h | 1 -
 fs/cifs/smb2pdu.c  | 5 -----
 2 files changed, 6 deletions(-)
fs/cifs/cifsglob.h +0 -1
index 7ea8a33..54a7d07 100644
@@ -933,7 +933,6 @@ struct cifs_tcon {
 	bool use_persistent:1; /* use persistent instead of durable handles */
 #ifdef CONFIG_CIFS_SMB2
 	bool print:1;		/* set if connection to printer share */
-	bool bad_network_name:1; /* set if ret status STATUS_BAD_NETWORK_NAME */
 	__le32 capabilities;
 	__u32 share_flags;
 	__u32 maximal_access;
fs/cifs/smb2pdu.c +0 -5
index bdd3292..2f9bcb0 100644
@@ -1084,9 +1084,6 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
 	else
 		return -EIO;
 
-	if (tcon && tcon->bad_network_name)
-		return -ENOENT;
-
 	if ((tcon && tcon->seal) &&
 	    ((ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION) == 0)) {
 		cifs_dbg(VFS, "encryption requested but no server support");
@@ -1188,8 +1185,6 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
 tcon_error_exit:
 	if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) {
 		cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree);
-		if (tcon)
-			tcon->bad_network_name = true;
 	}
 	goto tcon_exit;
 }
Signature · 1 line
2.7.4