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
db963164
Commit
db963164
authored
Jun 15, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proc_pid_readdir(): stop wanking with proc_fill_cache() for /proc/self
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
147ce699
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
fs/proc/base.c
fs/proc/base.c
+3
-3
No files found.
fs/proc/base.c
View file @
db963164
...
@@ -2882,21 +2882,21 @@ static struct tgid_iter next_tgid(struct pid_namespace *ns, struct tgid_iter ite
...
@@ -2882,21 +2882,21 @@ static struct tgid_iter next_tgid(struct pid_namespace *ns, struct tgid_iter ite
int
proc_pid_readdir
(
struct
file
*
file
,
struct
dir_context
*
ctx
)
int
proc_pid_readdir
(
struct
file
*
file
,
struct
dir_context
*
ctx
)
{
{
struct
tgid_iter
iter
;
struct
tgid_iter
iter
;
struct
pid_namespace
*
ns
;
struct
pid_namespace
*
ns
=
file
->
f_dentry
->
d_sb
->
s_fs_info
;
loff_t
pos
=
ctx
->
pos
;
loff_t
pos
=
ctx
->
pos
;
if
(
pos
>=
PID_MAX_LIMIT
+
TGID_OFFSET
)
if
(
pos
>=
PID_MAX_LIMIT
+
TGID_OFFSET
)
return
0
;
return
0
;
if
(
pos
==
TGID_OFFSET
-
1
)
{
if
(
pos
==
TGID_OFFSET
-
1
)
{
if
(
!
proc_fill_cache
(
file
,
ctx
,
"self"
,
4
,
NULL
,
NULL
,
NULL
))
struct
inode
*
inode
=
ns
->
proc_self
->
d_inode
;
if
(
!
dir_emit
(
ctx
,
"self"
,
4
,
inode
->
i_ino
,
DT_LNK
))
return
0
;
return
0
;
iter
.
tgid
=
0
;
iter
.
tgid
=
0
;
}
else
{
}
else
{
iter
.
tgid
=
pos
-
TGID_OFFSET
;
iter
.
tgid
=
pos
-
TGID_OFFSET
;
}
}
iter
.
task
=
NULL
;
iter
.
task
=
NULL
;
ns
=
file
->
f_dentry
->
d_sb
->
s_fs_info
;
for
(
iter
=
next_tgid
(
ns
,
iter
);
for
(
iter
=
next_tgid
(
ns
,
iter
);
iter
.
task
;
iter
.
task
;
iter
.
tgid
+=
1
,
iter
=
next_tgid
(
ns
,
iter
))
{
iter
.
tgid
+=
1
,
iter
=
next_tgid
(
ns
,
iter
))
{
...
...
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