mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-04 02:26:56 +07:00
Fix ->d_lock locking order in unlazy_walk()
Make sure that child is still a child of parent before nested locking of child->d_lock in unlazy_walk(); otherwise we are risking a violation of locking order and deadlocks. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
258e43fdb0
commit
94c0d4ecbe
@ -433,6 +433,8 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
|
|||||||
goto err_parent;
|
goto err_parent;
|
||||||
BUG_ON(nd->inode != parent->d_inode);
|
BUG_ON(nd->inode != parent->d_inode);
|
||||||
} else {
|
} else {
|
||||||
|
if (dentry->d_parent != parent)
|
||||||
|
goto err_parent;
|
||||||
spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
|
spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
|
||||||
if (!__d_rcu_to_refcount(dentry, nd->seq))
|
if (!__d_rcu_to_refcount(dentry, nd->seq))
|
||||||
goto err_child;
|
goto err_child;
|
||||||
|
Loading…
Reference in New Issue
Block a user