Skip to contentSkip to conversation

cifs: Better dependencies

PATCH New Jean Delvare 1 participant 4 messages Jan 22, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover cifs: Better dependencies

Hi all,

This is my attempt to fix and improve the dependencies of cifs.

[PATCH 1/3] cifs: Simplify SMB2 and SMB311 dependencies [PATCH 2/3] cifs: Only select the required crypto modules [PATCH 3/3] cifs: Add soft dependencies

Signature · 2 lines
Jean Delvare
SUSE L3 Support

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 1/3 cifs: Simplify SMB2 and SMB311 dependencies

* CIFS_SMB2 depends on CIFS, which depends on INET and selects NLS. So these dependencies do not need to be repeated for CIFS_SMB2.
* CIFS_SMB311 depends on CIFS_SMB2, which depends on INET. So this dependency doesn't need to be repeated for CIFS_SMB311.

---
 fs/cifs/Kconfig |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/cifs/Kconfig +2 -3
@@ -169,8 +169,7 @@ config CIFS_NFSD_EXPORT
 
 config CIFS_SMB2
 	bool "SMB2 and SMB3 network file system support"
-	depends on CIFS && INET
-	select NLS
+	depends on CIFS
 	select KEYS
 	select FSCACHE
 	select DNS_RESOLVER
@@ -194,7 +193,7 @@ config CIFS_SMB2
 
 config CIFS_SMB311
 	bool "SMB3.1.1 network file system support (Experimental)"
-	depends on CIFS_SMB2 && INET
+	depends on CIFS_SMB2
 
 	help
 	  This enables experimental support for the newest, SMB3.1.1, dialect.
Signature · 2 lines
Jean Delvare
SUSE L3 Support
#3 lore raw

PATCH 2/3 cifs: Only select the required crypto modules

In reply to a message not in the archive

The sha256 and cmac crypto modules are only needed for SMB2+, so move the select statements to config CIFS_SMB2. Also select CRYPTO_AES there as SMB2+ needs it.

---
 fs/cifs/Kconfig |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/cifs/Kconfig +3 -2
@@ -9,8 +9,6 @@ config CIFS
 	select CRYPTO_ARC4
 	select CRYPTO_ECB
 	select CRYPTO_DES
-	select CRYPTO_SHA256
-	select CRYPTO_CMAC
 	help
 	  This is the client VFS module for the Common Internet File System
 	  (CIFS) protocol which is the successor to the Server Message Block
@@ -173,6 +171,9 @@ config CIFS_SMB2
 	select KEYS
 	select FSCACHE
 	select DNS_RESOLVER
+	select CRYPTO_AES
+	select CRYPTO_SHA256
+	select CRYPTO_CMAC
 
 	help
 	  This enables support for the Server Message Block version 2
Signature · 2 lines
Jean Delvare
SUSE L3 Support
#4 lore raw

PATCH 3/3 cifs: Add soft dependencies

In reply to a message not in the archive

List soft dependencies of cifs so that mkinitrd and dracut can include the required helper modules.

---
 fs/cifs/cifsfs.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
fs/cifs/cifsfs.c +12 -0
@@ -1359,5 +1359,17 @@ MODULE_DESCRIPTION
     ("VFS to access servers complying with the SNIA CIFS Specification "
      "e.g. Samba and Windows");
 MODULE_VERSION(CIFS_VERSION);
+MODULE_SOFTDEP("pre: arc4");
+MODULE_SOFTDEP("pre: des");
+MODULE_SOFTDEP("pre: ecb");
+MODULE_SOFTDEP("pre: hmac");
+MODULE_SOFTDEP("pre: md4");
+MODULE_SOFTDEP("pre: md5");
+MODULE_SOFTDEP("pre: nls");
+#ifdef CONFIG_CIFS_SMB2
+MODULE_SOFTDEP("pre: aes");
+MODULE_SOFTDEP("pre: cmac");
+MODULE_SOFTDEP("pre: sha256");
+#endif /* CONFIG_CIFS_SMB2 */
 module_init(init_cifs)
 module_exit(exit_cifs)
Signature · 2 lines
Jean Delvare
SUSE L3 Support