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
c85f50f0
Commit
c85f50f0
authored
Mar 10, 2005
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Fix refcount leakage in nfs4_proc_create()
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
b79c3f26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+18
-15
No files found.
fs/nfs/nfs4proc.c
View file @
c85f50f0
...
...
@@ -1320,27 +1320,30 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
int
flags
)
{
struct
inode
*
inode
;
struct
nfs4_state
*
state
=
NULL
;
struct
nfs4_state
*
state
;
struct
rpc_cred
*
cred
;
cred
=
rpcauth_lookupcred
(
NFS_SERVER
(
dir
)
->
client
->
cl_auth
,
0
);
state
=
nfs4_do_open
(
dir
,
dentry
,
flags
,
sattr
,
cred
);
put_rpccred
(
cred
);
if
(
!
IS_ERR
(
state
))
{
inode
=
state
->
inode
;
if
(
flags
&
O_EXCL
)
{
struct
nfs_fattr
fattr
;
int
status
;
status
=
nfs4_do_setattr
(
NFS_SERVER
(
dir
),
&
fattr
,
NFS_FH
(
inode
),
sattr
,
state
);
if
(
status
!=
0
)
{
nfs4_close_state
(
state
,
flags
);
iput
(
inode
);
inode
=
ERR_PTR
(
status
);
}
}
}
else
if
(
IS_ERR
(
state
))
{
inode
=
(
struct
inode
*
)
state
;
goto
out
;
}
inode
=
state
->
inode
;
if
(
flags
&
O_EXCL
)
{
struct
nfs_fattr
fattr
;
int
status
;
status
=
nfs4_do_setattr
(
NFS_SERVER
(
dir
),
&
fattr
,
NFS_FH
(
inode
),
sattr
,
state
);
if
(
status
==
0
)
goto
out
;
iput
(
inode
);
inode
=
ERR_PTR
(
status
);
}
else
if
(
flags
!=
0
)
goto
out
;
nfs4_close_state
(
state
,
flags
);
out:
return
inode
;
}
...
...
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