From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Yao Subject: Re: [PATCH] [readdir] Return correct inode number of .. directory Date: Thu, 08 Aug 2013 17:10:54 -0400 Message-ID: <5204095E.2040709@gentoo.org> References: <1375987342-47197-1-git-send-email-ryao@gentoo.org> <20130808190801.GC27005@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2OSFICEPLFQAMJIRWOSAQ" Cc: linux-fsdevel@vger.kernel.org To: Al Viro Return-path: Received: from smtp.gentoo.org ([140.211.166.183]:57503 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966575Ab3HHVLW (ORCPT ); Thu, 8 Aug 2013 17:11:22 -0400 In-Reply-To: <20130808190801.GC27005@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OSFICEPLFQAMJIRWOSAQ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I did not sleep last night while I hacked on certain things. I should have just stepped away from my keyboard for a break a few hours before I wrote that, but regrettably, I did not. I sent an email retracting it almost immediately after I sent it. My apologies for the noise. On 08/08/2013 03:08 PM, Al Viro wrote: > 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 hav= e >> been parent_ino(file->f_path.dentry->i_ino). >=20 > 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 >=20 > static inline ino_t parent_ino(struct dentry *dentry) > { > ino_t res; >=20 > /* > * 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 =3D dentry->d_parent->d_inode->i_ino; > spin_unlock(&dentry->d_lock); > return res; > } >=20 > Mind explaining your "passing dentry to parent_ino() is wrong"? What e= lse > to pass there? Incidentally, struct dentry has no field called 'i_ino'= , > so with that patch the whole thing won't compile, period. >=20 > Consider the patch NAKed. >=20 ------enig2OSFICEPLFQAMJIRWOSAQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSBAllAAoJECDuEZm+6Exka8IP+wQYGdw9p1wS3sYTJPj3z/DE 3+19j0XR5PaoK+dUaGJH7cqiRpeT6LYtKWzknIPCYAU+LhSRNruRZ/XPgCuOLKwm yFKdFL4MY+gfUPNC7SHeVPP1QjHz91XutpqMJ1Wyyvk5vLj1sQXH2asXHj8g100w tyEVLe6DukYF/SSjR7PzBclny9GLA5+w9yugl3sOCB7tLkUawCtya2xegDmsYERR HrNzXFYT/uvPQRbNCW0+GVmEXMQywG679HmMJ2mKQ61j7SLRGHXVlnYmNEaJgsBM KEHdYMgNnxiajJMG1kT2ZYNoAV50UD23xPrqwfaNEhVLKqoNdTkpLFIdtfLEdC/3 Aixcqf0YBkqrgPt/uEEEwrckiclu9olk72N+os4VPagdvqmlz9abRHjul79C9voT LAnR8mForGa+InqsIVbgoR9dM94pE27+ObAuNGdIhnED6irG1vWw8FBFjx22zgtz 2Ul5tlTbGEMlJ8MpFefN11T+xnfwc1BfQl2C6yaatRbNQp+6nw/ve164bjlF8XWz uXCeGcN3cu2qLIZVTWGelH5Nmn6//fWzeexRnWw3n8PK6+4UQmFbXwT6r+kQBtq2 gKZndkUyrB9+I4hpm773MZvDaEgyj97lalZkWPNEQ6OeA/vpW15TEcTb6DgvjCK5 MNyl7rw6Bg+/G+4ZWNwp =umnS -----END PGP SIGNATURE----- ------enig2OSFICEPLFQAMJIRWOSAQ--