linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] dget_parent() misuse in xfs_filestream_get_parent()
@ 2019-06-28  6:00 Al Viro
  2019-07-07 23:22 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2019-06-28  6:00 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-xfs, linux-fsdevel

	dget_parent() never returns NULL.  So this

        parent = dget_parent(dentry);
        if (!parent)
                goto out_dput;

        dir = igrab(d_inode(parent));
        dput(parent);

out_dput:

is obviously fishy.  What is that code trying to do?  Is that
"dentry might be a root of disconnected tree, in which case
we want xfs_filestream_get_parent() to return NULL"?  If so,
that should be

        parent = dget_parent(dentry);
        if (parent != dentry)
		dir = igrab(d_inode(parent));
        dput(parent);

If we want dentry itself, that dir = igrab(...) should be
unconditional.  I'm not familiar enough with that code,
and I'd rather not go into YAMassiveSideRTFS, so...

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

end of thread, other threads:[~2019-07-07 23:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28  6:00 [RFC] dget_parent() misuse in xfs_filestream_get_parent() Al Viro
2019-07-07 23:22 ` Dave Chinner

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).