Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
linux-seco-imx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Clea OS
bsp
nxp
linux-seco-imx
Commits
ee3efa91
Commit
ee3efa91
authored
Jun 8, 2012
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
__d_unalias() should refuse to move mountpoints
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
e77fb7ce
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
fs/dcache.c
+5
-4
5 additions, 4 deletions
fs/dcache.c
with
5 additions
and
4 deletions
fs/dcache.c
+
5
−
4
View file @
ee3efa91
...
@@ -2387,14 +2387,13 @@ static struct dentry *__d_unalias(struct inode *inode,
...
@@ -2387,14 +2387,13 @@ static struct dentry *__d_unalias(struct inode *inode,
struct
dentry
*
dentry
,
struct
dentry
*
alias
)
struct
dentry
*
dentry
,
struct
dentry
*
alias
)
{
{
struct
mutex
*
m1
=
NULL
,
*
m2
=
NULL
;
struct
mutex
*
m1
=
NULL
,
*
m2
=
NULL
;
struct
dentry
*
ret
;
struct
dentry
*
ret
=
ERR_PTR
(
-
EBUSY
)
;
/* If alias and dentry share a parent, then no extra locks required */
/* If alias and dentry share a parent, then no extra locks required */
if
(
alias
->
d_parent
==
dentry
->
d_parent
)
if
(
alias
->
d_parent
==
dentry
->
d_parent
)
goto
out_unalias
;
goto
out_unalias
;
/* See lock_rename() */
/* See lock_rename() */
ret
=
ERR_PTR
(
-
EBUSY
);
if
(
!
mutex_trylock
(
&
dentry
->
d_sb
->
s_vfs_rename_mutex
))
if
(
!
mutex_trylock
(
&
dentry
->
d_sb
->
s_vfs_rename_mutex
))
goto
out_err
;
goto
out_err
;
m1
=
&
dentry
->
d_sb
->
s_vfs_rename_mutex
;
m1
=
&
dentry
->
d_sb
->
s_vfs_rename_mutex
;
...
@@ -2402,8 +2401,10 @@ static struct dentry *__d_unalias(struct inode *inode,
...
@@ -2402,8 +2401,10 @@ static struct dentry *__d_unalias(struct inode *inode,
goto
out_err
;
goto
out_err
;
m2
=
&
alias
->
d_parent
->
d_inode
->
i_mutex
;
m2
=
&
alias
->
d_parent
->
d_inode
->
i_mutex
;
out_unalias:
out_unalias:
if
(
likely
(
!
d_mountpoint
(
alias
)))
{
__d_move
(
alias
,
dentry
);
__d_move
(
alias
,
dentry
);
ret
=
alias
;
ret
=
alias
;
}
out_err:
out_err:
spin_unlock
(
&
inode
->
i_lock
);
spin_unlock
(
&
inode
->
i_lock
);
if
(
m2
)
if
(
m2
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment