X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=fs%2Fdcache.c;h=d30ce699ae4b6ea4ac3ad1b8ec955fa271bdcb16;hb=9d0b1f345e91acd458592d47430142073362b8cc;hp=85a2aad3dcb32a87579c3d043a0308a71ec07d17;hpb=8d80d7dabe9668965574669afbd31733f7b0fe9b;p=cascardo%2Flinux.git diff --git a/fs/dcache.c b/fs/dcache.c index 85a2aad3dcb3..d30ce699ae4b 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1775,7 +1775,7 @@ struct dentry *d_find_any_alias(struct inode *inode) } EXPORT_SYMBOL(d_find_any_alias); -struct dentry *__d_obtain_alias(struct inode *inode, int disconnected) +static struct dentry *__d_obtain_alias(struct inode *inode, int disconnected) { static const struct qstr anonstring = QSTR_INIT("/", 1); struct dentry *tmp; @@ -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);