cifs: fix build by selecting CONFIG_KEYS
diff mbox series

Message ID 20190701030325.18188-1-sergey.senozhatsky@gmail.com
State New
Headers show
Series
  • cifs: fix build by selecting CONFIG_KEYS
Related show

Commit Message

Sergey Senozhatsky July 1, 2019, 3:03 a.m. UTC
CONFIG_CIFS_ACL had a dependency "depends on KEYS" which was
dropped with the removal of CONFIG_CIFS_ACL. This breaks the
build on systems which don't have CONFIG_KEYS in .config:

cifsacl.c:37:15: error: variable ‘cifs_idmap_key_acl’ has
                 initializer but incomplete type
   37 | static struct key_acl cifs_idmap_key_acl = {
      |               ^~~~~~~
cifsacl.c:38:3: error: ‘struct key_acl’ has no member
                named ‘usage’
   38 |  .usage = REFCOUNT_INIT(1),
      |   ^~~~~
[..]

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 fs/cifs/Kconfig   | 1 +
 fs/cifs/cifsacl.c | 1 +
 2 files changed, 2 insertions(+)

Comments

Steve French July 1, 2019, 9:04 p.m. UTC | #1
I had already merged the attached (similar) fix into cifs-2.6.git for-next


On Sun, Jun 30, 2019 at 10:24 PM Sergey Senozhatsky
<sergey.senozhatsky.work@gmail.com> wrote:
>
> CONFIG_CIFS_ACL had a dependency "depends on KEYS" which was
> dropped with the removal of CONFIG_CIFS_ACL. This breaks the
> build on systems which don't have CONFIG_KEYS in .config:
>
> cifsacl.c:37:15: error: variable ‘cifs_idmap_key_acl’ has
>                  initializer but incomplete type
>    37 | static struct key_acl cifs_idmap_key_acl = {
>       |               ^~~~~~~
> cifsacl.c:38:3: error: ‘struct key_acl’ has no member
>                 named ‘usage’
>    38 |  .usage = REFCOUNT_INIT(1),
>       |   ^~~~~
> [..]
>
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> ---
>  fs/cifs/Kconfig   | 1 +
>  fs/cifs/cifsacl.c | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/fs/cifs/Kconfig b/fs/cifs/Kconfig
> index 3eee73449bdd..5912751e6f09 100644
> --- a/fs/cifs/Kconfig
> +++ b/fs/cifs/Kconfig
> @@ -17,6 +17,7 @@ config CIFS
>         select CRYPTO_ECB
>         select CRYPTO_AES
>         select CRYPTO_DES
> +       select KEYS
>         help
>           This is the client VFS module for the SMB3 family of NAS protocols,
>           (including support for the most recent, most secure dialect SMB3.1.1)
> diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
> index 78eed72f3af0..8ca479caf902 100644
> --- a/fs/cifs/cifsacl.c
> +++ b/fs/cifs/cifsacl.c
> @@ -24,6 +24,7 @@
>  #include <linux/fs.h>
>  #include <linux/slab.h>
>  #include <linux/string.h>
> +#include <linux/key.h>
>  #include <linux/keyctl.h>
>  #include <linux/key-type.h>
>  #include <keys/user-type.h>
> --
> 2.22.0
>
Sergey Senozhatsky July 2, 2019, 1:29 a.m. UTC | #2
On (07/01/19 16:04), Steve French wrote:
> 
> I had already merged the attached (similar) fix into cifs-2.6.git for-next

Yup, just got it with linux-next 20190701.

	-ss

Patch
diff mbox series

diff --git a/fs/cifs/Kconfig b/fs/cifs/Kconfig
index 3eee73449bdd..5912751e6f09 100644
--- a/fs/cifs/Kconfig
+++ b/fs/cifs/Kconfig
@@ -17,6 +17,7 @@  config CIFS
 	select CRYPTO_ECB
 	select CRYPTO_AES
 	select CRYPTO_DES
+	select KEYS
 	help
 	  This is the client VFS module for the SMB3 family of NAS protocols,
 	  (including support for the most recent, most secure dialect SMB3.1.1)
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index 78eed72f3af0..8ca479caf902 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -24,6 +24,7 @@ 
 #include <linux/fs.h>
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/key.h>
 #include <linux/keyctl.h>
 #include <linux/key-type.h>
 #include <keys/user-type.h>