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
52094c8a
Commit
52094c8a
authored
Feb 21, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
take RCU-dependent stuff around exec_permission() into a new helper
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
c9c6cac0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
fs/namei.c
fs/namei.c
+14
-11
No files found.
fs/namei.c
View file @
52094c8a
...
@@ -1322,6 +1322,18 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
...
@@ -1322,6 +1322,18 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
return
PTR_ERR
(
dentry
);
return
PTR_ERR
(
dentry
);
}
}
static
inline
int
may_lookup
(
struct
nameidata
*
nd
)
{
if
(
nd
->
flags
&
LOOKUP_RCU
)
{
int
err
=
exec_permission
(
nd
->
inode
,
IPERM_FLAG_RCU
);
if
(
err
!=
-
ECHILD
)
return
err
;
if
(
nameidata_drop_rcu
(
nd
))
return
-
ECHILD
;
}
return
exec_permission
(
nd
->
inode
,
0
);
}
/*
/*
* Name resolution.
* Name resolution.
* This is the basic name resolution function, turning a pathname into
* This is the basic name resolution function, turning a pathname into
...
@@ -1352,17 +1364,8 @@ static int link_path_walk(const char *name, struct nameidata *nd)
...
@@ -1352,17 +1364,8 @@ static int link_path_walk(const char *name, struct nameidata *nd)
unsigned
int
c
;
unsigned
int
c
;
nd
->
flags
|=
LOOKUP_CONTINUE
;
nd
->
flags
|=
LOOKUP_CONTINUE
;
if
(
nd
->
flags
&
LOOKUP_RCU
)
{
err
=
exec_permission
(
nd
->
inode
,
IPERM_FLAG_RCU
);
err
=
may_lookup
(
nd
);
if
(
err
==
-
ECHILD
)
{
if
(
nameidata_drop_rcu
(
nd
))
return
-
ECHILD
;
goto
exec_again
;
}
}
else
{
exec_again:
err
=
exec_permission
(
nd
->
inode
,
0
);
}
if
(
err
)
if
(
err
)
break
;
break
;
...
...
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