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
6f88049c
Commit
6f88049c
authored
Mar 02, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minix: i_nlink races in rename()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
37750cdd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
fs/minix/namei.c
fs/minix/namei.c
+2
-6
No files found.
fs/minix/namei.c
View file @
6f88049c
...
@@ -213,7 +213,6 @@ static int minix_rename(struct inode * old_dir, struct dentry *old_dentry,
...
@@ -213,7 +213,6 @@ static int minix_rename(struct inode * old_dir, struct dentry *old_dentry,
new_de
=
minix_find_entry
(
new_dentry
,
&
new_page
);
new_de
=
minix_find_entry
(
new_dentry
,
&
new_page
);
if
(
!
new_de
)
if
(
!
new_de
)
goto
out_dir
;
goto
out_dir
;
inode_inc_link_count
(
old_inode
);
minix_set_link
(
new_de
,
new_page
,
old_inode
);
minix_set_link
(
new_de
,
new_page
,
old_inode
);
new_inode
->
i_ctime
=
CURRENT_TIME_SEC
;
new_inode
->
i_ctime
=
CURRENT_TIME_SEC
;
if
(
dir_de
)
if
(
dir_de
)
...
@@ -225,18 +224,15 @@ static int minix_rename(struct inode * old_dir, struct dentry *old_dentry,
...
@@ -225,18 +224,15 @@ static int minix_rename(struct inode * old_dir, struct dentry *old_dentry,
if
(
new_dir
->
i_nlink
>=
info
->
s_link_max
)
if
(
new_dir
->
i_nlink
>=
info
->
s_link_max
)
goto
out_dir
;
goto
out_dir
;
}
}
inode_inc_link_count
(
old_inode
);
err
=
minix_add_link
(
new_dentry
,
old_inode
);
err
=
minix_add_link
(
new_dentry
,
old_inode
);
if
(
err
)
{
if
(
err
)
inode_dec_link_count
(
old_inode
);
goto
out_dir
;
goto
out_dir
;
}
if
(
dir_de
)
if
(
dir_de
)
inode_inc_link_count
(
new_dir
);
inode_inc_link_count
(
new_dir
);
}
}
minix_delete_entry
(
old_de
,
old_page
);
minix_delete_entry
(
old_de
,
old_page
);
inode_dec_link_count
(
old_inode
);
mark_inode_dirty
(
old_inode
);
if
(
dir_de
)
{
if
(
dir_de
)
{
minix_set_link
(
dir_de
,
dir_page
,
new_dir
);
minix_set_link
(
dir_de
,
dir_page
,
new_dir
);
...
...
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