Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95ad5c29 authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Al Viro
Browse files

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: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 96353895
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);