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
4455ca62
Commit
4455ca62
authored
Mar 04, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear RCU on all failure exits from link_path_walk()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
9856fa1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
fs/namei.c
fs/namei.c
+16
-14
No files found.
fs/namei.c
View file @
4455ca62
...
@@ -1405,8 +1405,9 @@ static int link_path_walk(const char *name, struct nameidata *nd)
...
@@ -1405,8 +1405,9 @@ static int link_path_walk(const char *name, struct nameidata *nd)
* parent relationships.
* parent relationships.
*/
*/
if
(
unlikely
(
type
!=
LAST_NORM
))
{
if
(
unlikely
(
type
!=
LAST_NORM
))
{
if
(
handle_dots
(
nd
,
type
))
err
=
handle_dots
(
nd
,
type
);
return
-
ECHILD
;
if
(
err
)
goto
return_err
;
continue
;
continue
;
}
}
...
@@ -1441,8 +1442,9 @@ static int link_path_walk(const char *name, struct nameidata *nd)
...
@@ -1441,8 +1442,9 @@ static int link_path_walk(const char *name, struct nameidata *nd)
if
(
lookup_flags
&
LOOKUP_PARENT
)
if
(
lookup_flags
&
LOOKUP_PARENT
)
goto
lookup_parent
;
goto
lookup_parent
;
if
(
unlikely
(
type
!=
LAST_NORM
))
{
if
(
unlikely
(
type
!=
LAST_NORM
))
{
if
(
handle_dots
(
nd
,
type
))
err
=
handle_dots
(
nd
,
type
);
return
-
ECHILD
;
if
(
err
)
goto
return_err
;
return
0
;
return
0
;
}
}
err
=
do_lookup
(
nd
,
&
this
,
&
next
,
&
inode
);
err
=
do_lookup
(
nd
,
&
this
,
&
next
,
&
inode
);
...
@@ -1475,6 +1477,12 @@ static int link_path_walk(const char *name, struct nameidata *nd)
...
@@ -1475,6 +1477,12 @@ static int link_path_walk(const char *name, struct nameidata *nd)
if
(
!
(
nd
->
flags
&
LOOKUP_RCU
))
if
(
!
(
nd
->
flags
&
LOOKUP_RCU
))
path_put
(
&
nd
->
path
);
path_put
(
&
nd
->
path
);
return_err:
return_err:
if
(
nd
->
flags
&
LOOKUP_RCU
)
{
nd
->
flags
&=
~
LOOKUP_RCU
;
nd
->
root
.
mnt
=
NULL
;
rcu_read_unlock
();
br_read_unlock
(
vfsmount_lock
);
}
return
err
;
return
err
;
}
}
...
@@ -1585,16 +1593,10 @@ static int path_lookupat(int dfd, const char *name,
...
@@ -1585,16 +1593,10 @@ static int path_lookupat(int dfd, const char *name,
retval
=
link_path_walk
(
name
,
nd
);
retval
=
link_path_walk
(
name
,
nd
);
if
(
nd
->
flags
&
LOOKUP_RCU
)
{
if
(
nd
->
flags
&
LOOKUP_RCU
)
{
/* RCU dangling. Cancel it. */
/* went all way through without dropping RCU */
if
(
!
retval
)
{
BUG_ON
(
retval
);
if
(
nameidata_drop_rcu_last
(
nd
))
if
(
nameidata_drop_rcu_last
(
nd
))
retval
=
-
ECHILD
;
retval
=
-
ECHILD
;
}
else
{
nd
->
flags
&=
~
LOOKUP_RCU
;
nd
->
root
.
mnt
=
NULL
;
rcu_read_unlock
();
br_read_unlock
(
vfsmount_lock
);
}
}
}
if
(
!
retval
)
if
(
!
retval
)
...
...
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