Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
5d8d9a4d
Commit
5d8d9a4d
authored
Jul 31, 2010
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Ensure the AUTH_UNIX credcache is allocated dynamically
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
d05dd4e9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
28 deletions
+40
-28
include/linux/sunrpc/auth.h
include/linux/sunrpc/auth.h
+4
-3
net/sunrpc/auth.c
net/sunrpc/auth.c
+16
-3
net/sunrpc/auth_generic.c
net/sunrpc/auth_generic.c
+3
-9
net/sunrpc/auth_unix.c
net/sunrpc/auth_unix.c
+7
-8
net/sunrpc/sunrpc_syms.c
net/sunrpc/sunrpc_syms.c
+10
-5
No files found.
include/linux/sunrpc/auth.h
View file @
5d8d9a4d
...
@@ -125,11 +125,12 @@ struct rpc_credops {
...
@@ -125,11 +125,12 @@ struct rpc_credops {
extern
const
struct
rpc_authops
authunix_ops
;
extern
const
struct
rpc_authops
authunix_ops
;
extern
const
struct
rpc_authops
authnull_ops
;
extern
const
struct
rpc_authops
authnull_ops
;
void
__init
rpc_init_authunix
(
void
);
int
__init
rpc_init_authunix
(
void
);
void
__init
rpc_init_generic_auth
(
void
);
int
__init
rpc_init_generic_auth
(
void
);
void
__init
rpcauth_init_module
(
void
);
int
__init
rpcauth_init_module
(
void
);
void
__exit
rpcauth_remove_module
(
void
);
void
__exit
rpcauth_remove_module
(
void
);
void
__exit
rpc_destroy_generic_auth
(
void
);
void
__exit
rpc_destroy_generic_auth
(
void
);
void
rpc_destroy_authunix
(
void
);
struct
rpc_cred
*
rpc_lookup_cred
(
void
);
struct
rpc_cred
*
rpc_lookup_cred
(
void
);
struct
rpc_cred
*
rpc_lookup_machine_cred
(
void
);
struct
rpc_cred
*
rpc_lookup_machine_cred
(
void
);
...
...
net/sunrpc/auth.c
View file @
5d8d9a4d
...
@@ -587,14 +587,27 @@ static struct shrinker rpc_cred_shrinker = {
...
@@ -587,14 +587,27 @@ static struct shrinker rpc_cred_shrinker = {
.
seeks
=
DEFAULT_SEEKS
,
.
seeks
=
DEFAULT_SEEKS
,
};
};
void
__init
rpcauth_init_module
(
void
)
int
__init
rpcauth_init_module
(
void
)
{
{
rpc_init_authunix
();
int
err
;
rpc_init_generic_auth
();
err
=
rpc_init_authunix
();
if
(
err
<
0
)
goto
out1
;
err
=
rpc_init_generic_auth
();
if
(
err
<
0
)
goto
out2
;
register_shrinker
(
&
rpc_cred_shrinker
);
register_shrinker
(
&
rpc_cred_shrinker
);
return
0
;
out2:
rpc_destroy_authunix
();
out1:
return
err
;
}
}
void
__exit
rpcauth_remove_module
(
void
)
void
__exit
rpcauth_remove_module
(
void
)
{
{
rpc_destroy_authunix
();
rpc_destroy_generic_auth
();
unregister_shrinker
(
&
rpc_cred_shrinker
);
unregister_shrinker
(
&
rpc_cred_shrinker
);
}
}
net/sunrpc/auth_generic.c
View file @
5d8d9a4d
...
@@ -27,7 +27,6 @@ struct generic_cred {
...
@@ -27,7 +27,6 @@ struct generic_cred {
};
};
static
struct
rpc_auth
generic_auth
;
static
struct
rpc_auth
generic_auth
;
static
struct
rpc_cred_cache
generic_cred_cache
;
static
const
struct
rpc_credops
generic_credops
;
static
const
struct
rpc_credops
generic_credops
;
/*
/*
...
@@ -159,20 +158,16 @@ generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags)
...
@@ -159,20 +158,16 @@ generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags)
return
0
;
return
0
;
}
}
void
__init
rpc_init_generic_auth
(
void
)
int
__init
rpc_init_generic_auth
(
void
)
{
{
spin_lock_init
(
&
generic_cred_cache
.
lock
);
return
rpcauth_init_credcache
(
&
generic_auth
);
}
}
void
__exit
rpc_destroy_generic_auth
(
void
)
void
__exit
rpc_destroy_generic_auth
(
void
)
{
{
rpcauth_
clear_credcache
(
&
generic_cred_cache
);
rpcauth_
destroy_credcache
(
&
generic_auth
);
}
}
static
struct
rpc_cred_cache
generic_cred_cache
=
{
{{
NULL
,
},},
};
static
const
struct
rpc_authops
generic_auth_ops
=
{
static
const
struct
rpc_authops
generic_auth_ops
=
{
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
.
au_name
=
"Generic"
,
.
au_name
=
"Generic"
,
...
@@ -183,7 +178,6 @@ static const struct rpc_authops generic_auth_ops = {
...
@@ -183,7 +178,6 @@ static const struct rpc_authops generic_auth_ops = {
static
struct
rpc_auth
generic_auth
=
{
static
struct
rpc_auth
generic_auth
=
{
.
au_ops
=
&
generic_auth_ops
,
.
au_ops
=
&
generic_auth_ops
,
.
au_count
=
ATOMIC_INIT
(
0
),
.
au_count
=
ATOMIC_INIT
(
0
),
.
au_credcache
=
&
generic_cred_cache
,
};
};
static
const
struct
rpc_credops
generic_credops
=
{
static
const
struct
rpc_credops
generic_credops
=
{
...
...
net/sunrpc/auth_unix.c
View file @
5d8d9a4d
...
@@ -29,7 +29,6 @@ struct unx_cred {
...
@@ -29,7 +29,6 @@ struct unx_cred {
#endif
#endif
static
struct
rpc_auth
unix_auth
;
static
struct
rpc_auth
unix_auth
;
static
struct
rpc_cred_cache
unix_cred_cache
;
static
const
struct
rpc_credops
unix_credops
;
static
const
struct
rpc_credops
unix_credops
;
static
struct
rpc_auth
*
static
struct
rpc_auth
*
...
@@ -203,9 +202,14 @@ unx_validate(struct rpc_task *task, __be32 *p)
...
@@ -203,9 +202,14 @@ unx_validate(struct rpc_task *task, __be32 *p)
return
p
;
return
p
;
}
}
void
__init
rpc_init_authunix
(
void
)
int
__init
rpc_init_authunix
(
void
)
{
{
spin_lock_init
(
&
unix_cred_cache
.
lock
);
return
rpcauth_init_credcache
(
&
unix_auth
);
}
void
rpc_destroy_authunix
(
void
)
{
rpcauth_destroy_credcache
(
&
unix_auth
);
}
}
const
struct
rpc_authops
authunix_ops
=
{
const
struct
rpc_authops
authunix_ops
=
{
...
@@ -218,10 +222,6 @@ const struct rpc_authops authunix_ops = {
...
@@ -218,10 +222,6 @@ const struct rpc_authops authunix_ops = {
.
crcreate
=
unx_create_cred
,
.
crcreate
=
unx_create_cred
,
};
};
static
struct
rpc_cred_cache
unix_cred_cache
=
{
};
static
static
struct
rpc_auth
unix_auth
=
{
struct
rpc_auth
unix_auth
=
{
.
au_cslack
=
UNX_WRITESLACK
,
.
au_cslack
=
UNX_WRITESLACK
,
...
@@ -229,7 +229,6 @@ struct rpc_auth unix_auth = {
...
@@ -229,7 +229,6 @@ struct rpc_auth unix_auth = {
.
au_ops
=
&
authunix_ops
,
.
au_ops
=
&
authunix_ops
,
.
au_flavor
=
RPC_AUTH_UNIX
,
.
au_flavor
=
RPC_AUTH_UNIX
,
.
au_count
=
ATOMIC_INIT
(
0
),
.
au_count
=
ATOMIC_INIT
(
0
),
.
au_credcache
=
&
unix_cred_cache
,
};
};
static
static
...
...
net/sunrpc/sunrpc_syms.c
View file @
5d8d9a4d
...
@@ -33,10 +33,11 @@ init_sunrpc(void)
...
@@ -33,10 +33,11 @@ init_sunrpc(void)
if
(
err
)
if
(
err
)
goto
out
;
goto
out
;
err
=
rpc_init_mempool
();
err
=
rpc_init_mempool
();
if
(
err
)
{
if
(
err
)
unregister_rpc_pipefs
();
goto
out2
;
goto
out
;
err
=
rpcauth_init_module
();
}
if
(
err
)
goto
out3
;
#ifdef RPC_DEBUG
#ifdef RPC_DEBUG
rpc_register_sysctl
();
rpc_register_sysctl
();
#endif
#endif
...
@@ -47,7 +48,11 @@ init_sunrpc(void)
...
@@ -47,7 +48,11 @@ init_sunrpc(void)
cache_register
(
&
unix_gid_cache
);
cache_register
(
&
unix_gid_cache
);
svc_init_xprt_sock
();
/* svc sock transport */
svc_init_xprt_sock
();
/* svc sock transport */
init_socket_xprt
();
/* clnt sock transport */
init_socket_xprt
();
/* clnt sock transport */
rpcauth_init_module
();
return
0
;
out3:
rpc_destroy_mempool
();
out2:
unregister_rpc_pipefs
();
out:
out:
return
err
;
return
err
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment