Skip to contentSkip to conversation

Fix cifs breakage when CONFIG_CIFS_EXPERIMENTAL=n

PATCH In review Jean Delvare 2 participants 2 messages Apr 24, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix cifs breakage when CONFIG_CIFS_EXPERIMENTAL=n

Hi Steve,

Cifs is currently broken when CONFIG_CIFS_EXPERIMENTAL=n:

fs/cifs/connect.c: In function `cifs_setup_session':
fs/cifs/connect.c:3451: warning: implicit declaration of function `CIFS_SessSetup' (...)
WARNING: "CIFS_SessSetup" [fs/cifs/cifs.ko] undefined!

The following patch attempts to fix that. Untested beyond compilation.

---
 fs/cifs/cifsproto.h |    2 --
 fs/cifs/cifssmb.c   |    2 --
 fs/cifs/ntlmssp.c   |    2 --
 3 files changed, 6 deletions(-)
fs/cifs/cifsproto.h +0 -2
@@ -64,14 +64,12 @@
 extern void header_assemble(struct smb_hdr *, char /* command */ ,
 			    const struct cifsTconInfo *, int /* length of
 			    fixed section (word count) in two byte units */);
-#ifdef CONFIG_CIFS_EXPERIMENTAL
 extern int small_smb_init_no_tc(const int smb_cmd, const int wct,
 				struct cifsSesInfo *ses,
 				void ** request_buf);
 extern int CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses,
 			     const int stage, int * pNTLMv2_flg,
 			     const struct nls_table *nls_cp);
-#endif
 extern __u16 GetNextMid(struct TCP_Server_Info *server);
 extern struct oplock_q_entry * AllocOplockQEntry(struct inode *, u16, 
 						 struct cifsTconInfo *);
fs/cifs/ntlmssp.c +0 -2
@@ -27,7 +27,6 @@
 #include "ntlmssp.h"
 #include "nterr.h"
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL
 static __u32 cifs_ssetup_hdr(struct cifsSesInfo *ses, SESSION_SETUP_ANDX *pSMB)
 {
 	__u32 capabilities = 0;
@@ -140,4 +139,3 @@
 
 	return rc;
 }
-#endif /* CONFIG_CIFS_EXPERIMENTAL */
fs/cifs/cifssmb.c +0 -2
@@ -188,7 +188,6 @@
 	return rc;
 }
 
-#ifdef CONFIG_CIFS_EXPERIMENTAL  
 int
 small_smb_init_no_tc(const int smb_command, const int wct, 
 		     struct cifsSesInfo *ses, void **request_buf)
@@ -214,7 +213,6 @@
 
 	return rc;
 }
-#endif  /* CONFIG_CIFS_EXPERIMENTAL */
 
 /* If the return code is zero, this function must fill in request_buf pointer */
 static int
Signature · 1 line
Jean Delvare
#1 lore raw
Quoted 5 lines · Jean Delvare

Hi Steve,

Cifs is currently broken when CONFIG_CIFS_EXPERIMENTAL=n:

The following patch attempts to fix that. Untested beyond compilation.

I fixed it with a smaller equally untested patch:

fs/cifs/connect.c: In function 'cifs_setup_session':
fs/cifs/connect.c:3451: error: implicit declaration of function 'CIFS_SessSetup'

fs/cifs/connect.c renamed from fs/cifs/connect.c~ +5 -2
@@ -3447,10 +3447,13 @@ int cifs_setup_session(unsigned int xid,
 			pSesInfo->server->secMode,
 			pSesInfo->server->capabilities,
 			pSesInfo->server->timeZone));
+#ifdef CONFIG_CIFS_EXPERIMENTAL
 		if(experimEnabled > 1)
 			rc = CIFS_SessSetup(xid, pSesInfo, CIFS_NTLM /* type */,
-					    &ntlmv2_flag, nls_info);	
-		else if (extended_security
+					    &ntlmv2_flag, nls_info);
+		else
+#endif
+			if (extended_security
 				&& (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)
 				&& (pSesInfo->server->secType == NTLMSSP)) {
 			cFYI(1, ("New style sesssetup"));
Signature · 1 line
http://www.codemonkey.org.uk