From mboxrd@z Thu Jan 1 00:00:00 1970 From: NeilBrown Subject: Re: [PATCH 10/13] VFS/namei: handle LOOKUP_RCU in page_follow_link_light. Date: Fri, 20 Mar 2015 09:38:33 +1100 Message-ID: <20150320093833.25603da2@notabene.brown> References: <20150316043602.23648.52734.stgit@notabene.brown> <20150316044320.23648.90827.stgit@notabene.brown> <20150316225040.GG29656@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/_0KxYhjuYh_OO61U0tuQrD="; protocol="application/pgp-signature" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Al Viro Return-path: In-Reply-To: <20150316225040.GG29656@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org --Sig_/_0KxYhjuYh_OO61U0tuQrD= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 16 Mar 2015 22:50:40 +0000 Al Viro wrote: > On Mon, Mar 16, 2015 at 03:43:20PM +1100, NeilBrown wrote: > > + char *kaddr; > > + struct page *page; > > + struct address_space *mapping =3D dentry->d_inode->i_mapping; >=20 > Who said that dentry->d_inode hasn't gone NULL by that point? >=20 > > + nd_terminate_link(kaddr, dentry->d_inode->i_size, PAGE_SIZE - 1); >=20 > ... or changed here. Again, dentry->d_inode is stable only if you are > holding a reference to dentry. That's why we have those dances around > nd->inode, for example. Doing unlazy_walk() is enough to stabilize the > damn thing, so currently ->follow_link() doesn't have to worry about it. > With your changes, though... Ahhh - that's what nd->inode is for. I wondered. Am I correct in thinking that dentry->d_inode can only become NULL - it can= not then become some other inode? In that case the various follow_link methods that are sufficiently atomic f= or rcu-walk just need something like: struct inode *inode =3D dentry->d_inode; if (!inode) return -ECHILD; If ->d_inode can become another inode, then I suspect we need to pass the inode as well as the dentry to ->follow_link. Thanks, NeilBrown --Sig_/_0KxYhjuYh_OO61U0tuQrD= Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIVAwUBVQtP6jnsnt1WYoG5AQKDqw/9HBQbUelbY+H3qW1TWWNJbbkTHPeh0+hQ 3SF1F5WQHzYxsZUjvtTWy3W9fucUKyvWATkJMP7ALoDo6hOh9pLfTHRhfVZJQUlR vzriXLC1Vj/yUblR52DFDcpwE/vqfhiCC5YSy8hh9zu022phS0BJkzz2LiBEAHTq 96Ayvj8aNVrmycIhafkyCEAMtIySRy4UvjyzCF+m4g1d7CYnGCplf7n9DQE62RIS 3HW5K/RX6PP8QogCp63Kx9KqTHTotSQ1BEikezG++zVRQRLx5pFTPaBGKLB/XrHb KyiaJcw4dg3nmW9smJYk8rahPOlVQlwtTEF0CxuukEaUBj1LtuZ4miBs5E8q11g5 lm0BsM598OLmZoFObb1AuFut/p+I7zlre0nA6rNLFtPeApxwWXLCpePegZWHFEWL Hw8bkJpXDp5taXWBe47nm83pV+8+e+3gg/FGGvl1Cu3Kgg4FpWyQvoPuBZKxsmCj 4PCqmcqio06FHy8v7kBRwkyR4JMTdXp99D6oBL5Lmj+N2bsXTw1ndq0zb2qle998 9pzXdvDS5Y4R2q3M9zywtJBdLM9PCaz6OjZHcfwFxcQoNl4AKGA8n6B/BKF94AP+ PMqvJNAWwGeOULG+8J41QUTZsEgCALVEbmiGDRN99MDHIM2P/SMdl3eI+XAyuNQ4 Fo8oyzHOhnY= =H0Y9 -----END PGP SIGNATURE----- --Sig_/_0KxYhjuYh_OO61U0tuQrD=--