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
b1a81972
Commit
b1a81972
authored
Jan 19, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pick_link(): check for WALK_TRAILING, not LOOKUP_PARENT
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
8c4efe22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
fs/namei.c
fs/namei.c
+5
-5
No files found.
fs/namei.c
View file @
b1a81972
...
@@ -1723,8 +1723,10 @@ static inline int handle_dots(struct nameidata *nd, int type)
...
@@ -1723,8 +1723,10 @@ static inline int handle_dots(struct nameidata *nd, int type)
return
0
;
return
0
;
}
}
enum
{
WALK_TRAILING
=
1
,
WALK_MORE
=
2
,
WALK_NOFOLLOW
=
4
};
static
const
char
*
pick_link
(
struct
nameidata
*
nd
,
struct
path
*
link
,
static
const
char
*
pick_link
(
struct
nameidata
*
nd
,
struct
path
*
link
,
struct
inode
*
inode
,
unsigned
seq
)
struct
inode
*
inode
,
unsigned
seq
,
int
flags
)
{
{
struct
saved
*
last
;
struct
saved
*
last
;
const
char
*
res
;
const
char
*
res
;
...
@@ -1762,7 +1764,7 @@ static const char *pick_link(struct nameidata *nd, struct path *link,
...
@@ -1762,7 +1764,7 @@ static const char *pick_link(struct nameidata *nd, struct path *link,
clear_delayed_call
(
&
last
->
done
);
clear_delayed_call
(
&
last
->
done
);
last
->
seq
=
seq
;
last
->
seq
=
seq
;
if
(
!
(
nd
->
flags
&
LOOKUP_PARENT
)
)
{
if
(
flags
&
WALK_TRAILING
)
{
error
=
may_follow_link
(
nd
,
inode
);
error
=
may_follow_link
(
nd
,
inode
);
if
(
unlikely
(
error
))
if
(
unlikely
(
error
))
return
ERR_PTR
(
error
);
return
ERR_PTR
(
error
);
...
@@ -1819,8 +1821,6 @@ static const char *pick_link(struct nameidata *nd, struct path *link,
...
@@ -1819,8 +1821,6 @@ static const char *pick_link(struct nameidata *nd, struct path *link,
return
NULL
;
return
NULL
;
}
}
enum
{
WALK_TRAILING
=
1
,
WALK_MORE
=
2
,
WALK_NOFOLLOW
=
4
};
/*
/*
* Do we need to follow links? We _really_ want to be able
* Do we need to follow links? We _really_ want to be able
* to do this check without having to look at inode->i_op,
* to do this check without having to look at inode->i_op,
...
@@ -1849,7 +1849,7 @@ static const char *step_into(struct nameidata *nd, int flags,
...
@@ -1849,7 +1849,7 @@ static const char *step_into(struct nameidata *nd, int flags,
if
(
read_seqcount_retry
(
&
path
.
dentry
->
d_seq
,
seq
))
if
(
read_seqcount_retry
(
&
path
.
dentry
->
d_seq
,
seq
))
return
ERR_PTR
(
-
ECHILD
);
return
ERR_PTR
(
-
ECHILD
);
}
}
return
pick_link
(
nd
,
&
path
,
inode
,
seq
);
return
pick_link
(
nd
,
&
path
,
inode
,
seq
,
flags
);
}
}
static
const
char
*
walk_component
(
struct
nameidata
*
nd
,
int
flags
)
static
const
char
*
walk_component
(
struct
nameidata
*
nd
,
int
flags
)
...
...
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