Re: [PATCH] [readdir] Return correct inode number of .. directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux