From: Al Viro <viro@ZenIV.linux.org.uk>
To: Richard Yao <ryao@gentoo.org>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] [readdir] Return correct inode number of .. directory
Date: Thu, 8 Aug 2013 20:08:01 +0100 [thread overview]
Message-ID: <20130808190801.GC27005@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1375987342-47197-1-git-send-email-ryao@gentoo.org>
On Thu, Aug 08, 2013 at 02:42:22PM -0400, Richard Yao wrote:
> dir_emit_dotdot() currently passes parent_ino(file->f_path.dentry) to
> dir_emit(). Passing a dentry to parent_ino() is wrong. This should have
> been parent_ino(file->f_path.dentry->i_ino).
What the hell? For the benefit of people who can't be arsed to learn
how to use grep, parent_ino() is defined in include/linux/fs.h and
that definition is
static inline ino_t parent_ino(struct dentry *dentry)
{
ino_t res;
/*
* Don't strictly need d_lock here? If the parent ino could change
* then surely we'd have a deeper race in the caller?
*/
spin_lock(&dentry->d_lock);
res = dentry->d_parent->d_inode->i_ino;
spin_unlock(&dentry->d_lock);
return res;
}
Mind explaining your "passing dentry to parent_ino() is wrong"? What else
to pass there? Incidentally, struct dentry has no field called 'i_ino',
so with that patch the whole thing won't compile, period.
Consider the patch NAKed.
next prev parent reply other threads:[~2013-08-08 19:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-08 18:42 [PATCH] [readdir] Return correct inode number of .. directory Richard Yao
2013-08-08 18:45 ` Richard Yao
2013-08-08 19:08 ` Al Viro [this message]
2013-08-08 21:10 ` Richard Yao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130808190801.GC27005@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=ryao@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.