Message ID | 7C3EBB6F-54AC-4744-BEC1-33EA82216F85@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Mar 09, 2016 at 12:53:20AM +0000, Drokin, Oleg wrote: > I have not tried this exact one yet (will try in a moment). > But it appears we do need ll_d_init() call if we got a hit > in d_exact_alias(). > A particular test case fails due to lack of the d_fsdata being null. Very interesting. I'd suggest checking if we hit that d_instantiate() in your namei.c with NULL ->d_fsdata. That really shouldn't happen, AFAICS... > @@ -374,9 +368,9 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de) > } > } > rc = ll_d_init(de); > + d_add(de, inode); > if (rc < 0) > return ERR_PTR(rc); > - d_add(de, inode); Uhh... Why would you reorder them like that? > Also any particular reason to prefer d_splice_alias over d_add? Did not we already determine there > were no other aliases. No unhashed aliases with the same name and parent. Seriously, d_splice_alias() will do exactly the same thing as d_add() except for the situations where d_add() would've created multiple dentries over the same directory inode. And it's not more costly outside of that case... -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -358,14 +358,8 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de) int rc; if (inode) { - new = ll_find_alias(inode, de); + new = d_exact_alias(de, inode); if (new) { - rc = ll_d_init(new); - if (rc < 0) { - dput(new); - return ERR_PTR(rc); - } - d_move(new, de); iput(inode); CDEBUG(D_DENTRY, "Reuse dentry %p inode %p refc %d flags %#x\n", @@ -374,9 +368,9 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de) } } rc = ll_d_init(de); + d_add(de, inode); if (rc < 0) return ERR_PTR(rc); - d_add(de, inode); CDEBUG(D_DENTRY, "Add dentry %p inode %p refc %d flags %#x\n", de, d_inode(de), d_count(de), de->d_flags);