Skip to content

Commit 40a3cb0

Browse files
author
Al Viro
committed
d_add_ci(): make sure we don't miss d_lookup_done()
All callers of d_alloc_parallel() must make sure that resulting in-lookup dentry (if any) will encounter __d_lookup_done() before the final dput(). d_add_ci() might end up creating in-lookup dentries; they are fed to d_splice_alias(), which will normally make sure they meet __d_lookup_done(). However, it is possible to end up with d_splice_alias() failing with ERR_PTR(-ELOOP) without having done so. It takes a corrupted ntfs or case-insensitive xfs image, but neither should end up with memory corruption... Signed-off-by: Al Viro <[email protected]>
1 parent b13bacc commit 40a3cb0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/dcache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,6 +2240,7 @@ struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode,
22402240
}
22412241
res = d_splice_alias(inode, found);
22422242
if (res) {
2243+
d_lookup_done(found);
22432244
dput(found);
22442245
return res;
22452246
}

0 commit comments

Comments
 (0)