mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
dcache: d_splice_alias should detect loops
I believe this can only happen in the case of a corrupted filesystem. So -EIO looks like the appropriate error. Signed-off-by: J. Bruce Fields <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
9635389534
commit
95ad5c2913
1 changed files with 5 additions and 0 deletions
|
|
@ -2706,6 +2706,11 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
|
|||
dput(new);
|
||||
return ERR_PTR(-EIO);
|
||||
}
|
||||
if (d_ancestor(new, dentry)) {
|
||||
spin_unlock(&inode->i_lock);
|
||||
dput(new);
|
||||
return ERR_PTR(-EIO);
|
||||
}
|
||||
write_seqlock(&rename_lock);
|
||||
__d_materialise_dentry(dentry, new);
|
||||
write_sequnlock(&rename_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue