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
nexedi
linux
Commits
23bf85ba
Commit
23bf85ba
authored
Nov 21, 2006
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SUNRPC: Handle the cases where rpc_alloc_iostats() fails
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
e8e058e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
net/sunrpc/clnt.c
net/sunrpc/clnt.c
+10
-1
No files found.
net/sunrpc/clnt.c
View file @
23bf85ba
...
@@ -141,6 +141,9 @@ static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, s
...
@@ -141,6 +141,9 @@ static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, s
clnt
->
cl_vers
=
version
->
number
;
clnt
->
cl_vers
=
version
->
number
;
clnt
->
cl_stats
=
program
->
stats
;
clnt
->
cl_stats
=
program
->
stats
;
clnt
->
cl_metrics
=
rpc_alloc_iostats
(
clnt
);
clnt
->
cl_metrics
=
rpc_alloc_iostats
(
clnt
);
err
=
-
ENOMEM
;
if
(
clnt
->
cl_metrics
==
NULL
)
goto
out_no_stats
;
if
(
!
xprt_bound
(
clnt
->
cl_xprt
))
if
(
!
xprt_bound
(
clnt
->
cl_xprt
))
clnt
->
cl_autobind
=
1
;
clnt
->
cl_autobind
=
1
;
...
@@ -173,6 +176,8 @@ static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, s
...
@@ -173,6 +176,8 @@ static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, s
rpc_put_mount
();
rpc_put_mount
();
}
}
out_no_path:
out_no_path:
rpc_free_iostats
(
clnt
->
cl_metrics
);
out_no_stats:
if
(
clnt
->
cl_server
!=
clnt
->
cl_inline_name
)
if
(
clnt
->
cl_server
!=
clnt
->
cl_inline_name
)
kfree
(
clnt
->
cl_server
);
kfree
(
clnt
->
cl_server
);
kfree
(
clnt
);
kfree
(
clnt
);
...
@@ -258,6 +263,9 @@ rpc_clone_client(struct rpc_clnt *clnt)
...
@@ -258,6 +263,9 @@ rpc_clone_client(struct rpc_clnt *clnt)
goto
out_no_clnt
;
goto
out_no_clnt
;
atomic_set
(
&
new
->
cl_count
,
1
);
atomic_set
(
&
new
->
cl_count
,
1
);
atomic_set
(
&
new
->
cl_users
,
0
);
atomic_set
(
&
new
->
cl_users
,
0
);
new
->
cl_metrics
=
rpc_alloc_iostats
(
clnt
);
if
(
new
->
cl_metrics
==
NULL
)
goto
out_no_stats
;
new
->
cl_parent
=
clnt
;
new
->
cl_parent
=
clnt
;
atomic_inc
(
&
clnt
->
cl_count
);
atomic_inc
(
&
clnt
->
cl_count
);
new
->
cl_xprt
=
xprt_get
(
clnt
->
cl_xprt
);
new
->
cl_xprt
=
xprt_get
(
clnt
->
cl_xprt
);
...
@@ -270,8 +278,9 @@ rpc_clone_client(struct rpc_clnt *clnt)
...
@@ -270,8 +278,9 @@ rpc_clone_client(struct rpc_clnt *clnt)
rpc_init_rtt
(
&
new
->
cl_rtt_default
,
clnt
->
cl_xprt
->
timeout
.
to_initval
);
rpc_init_rtt
(
&
new
->
cl_rtt_default
,
clnt
->
cl_xprt
->
timeout
.
to_initval
);
if
(
new
->
cl_auth
)
if
(
new
->
cl_auth
)
atomic_inc
(
&
new
->
cl_auth
->
au_count
);
atomic_inc
(
&
new
->
cl_auth
->
au_count
);
new
->
cl_metrics
=
rpc_alloc_iostats
(
clnt
);
return
new
;
return
new
;
out_no_stats:
kfree
(
new
);
out_no_clnt:
out_no_clnt:
printk
(
KERN_INFO
"RPC: out of memory in %s
\n
"
,
__FUNCTION__
);
printk
(
KERN_INFO
"RPC: out of memory in %s
\n
"
,
__FUNCTION__
);
return
ERR_PTR
(
-
ENOMEM
);
return
ERR_PTR
(
-
ENOMEM
);
...
...
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