linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* WTF is d_add_ci() doing with negative dentries?
@ 2014-10-12 22:18 Al Viro
  2014-10-12 23:56 ` Anton Altaparmakov
  0 siblings, 1 reply; 4+ messages in thread
From: Al Viro @ 2014-10-12 22:18 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-kernel, linux-fsdevel

	AFAICS, if d_add_ci() ever finds a negative hashed dentry for
exact name, it's already buggered.  Because right *before* that
d_add_ci() lookup for exact name would've turned valid negative.
IOW, the whole thing ought to be
        found = d_hash_and_lookup(dentry->d_parent, name);
	if (found) {
		iput(inode);
		return found;
	}
	new = d_alloc(dentry->d_parent, name);
	if (!new) {
		iput(inode);
		return ERR_PTR(-ENOMEM);
	}
	found = d_splice_alias(inode, new);
	if (found) {
		dput(new);
		return found;
	}
	return new;
Moreover, it might very well be better to pass dentry->d_parent instead
of dentry...  Objections?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-13  9:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-12 22:18 WTF is d_add_ci() doing with negative dentries? Al Viro
2014-10-12 23:56 ` Anton Altaparmakov
2014-10-13  2:14   ` Al Viro
2014-10-13  9:16     ` Anton Altaparmakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).