nfs_lookup_revalidate() and mount points

Claus-Justus Heine (Heine@physik.rwth-aachen.de)
06 Aug 1997 15:26:46 +0200


--pgp-sign-Multipart_Wed_Aug__6_15:26:20_1997-1
Content-Type: multipart/mixed;
boundary="Multipart_Wed_Aug__6_15:26:20_1997-1"
Content-Transfer-Encoding: 7bit

--Multipart_Wed_Aug__6_15:26:20_1997-1
Content-Type: text/plain; charset=US-ASCII

Hi!

I think I have found a bug in the nfs_lookup_revalidate() function,
introduced in 2.1.48.

The problem only occurs when mount points are located on NFS mounted
file systems (e.g. when the root file system is on NFS).

The problem:

The function lookup() in fs/namei.c first calls cached_lookup() to
find a hit in the cache. cached_lookup() calls dentry->d_revalidate()
if it is non-zero. In the case of NFS this simply means that
directory cache entries are discarded after 10 seconds.

cached_lookup() will then drop the cache entry. This causes the
lookup() function to call real_lookup().

But if the dropped entry was a mount point, then real_lookup() will
not lookup (at least in the case of NFS) the mounted file systems root
inode, but the mount point itself.

Fix:

I have fixed (?) the problem by changing nfs_lookup_revalidate() such
that it will NOT discard dentries that are mount points;

The patch below is relativ to 2.1.48.

Cheers

Claus

--Multipart_Wed_Aug__6_15:26:20_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="foo.dif"
Content-Transfer-Encoding: base64

LS0tIGxpbnV4LTIuMS9mcy9uZnMvZGlyLmMJVHVlIEF1ZyAgNSAxMzoyMjo1NCAxOTk3CisrKyBs
aW51eC0yLjEuNDctbmZzLXN3YXAvZnMvbmZzL2Rpci5jCVdlZCBBdWcgIDYgMTU6MDk6MjYgMTk5
NwpAQCAtMzQ2LDcgKzM0NiwxMyBAQAogCiAJaWYgKGRlbnRyeS0+ZF9pbm9kZSAmJiBTX0lTRElS
KGRlbnRyeS0+ZF9pbm9kZS0+aV9tb2RlKSkKIAkJbWF4ID0gMTAqSFo7Ci0JcmV0dXJuIHRpbWUg
PCBtYXg7CisKKwlpZiAoZGVudHJ5LT5kX21vdW50cyAhPSBkZW50cnkpIHsKKwkJLyogdGhpcyBp
cyBhIG1vdW50IHBvaW50LiBqdXN0IGtlZXAgaXQgKi8KKwkJcmV0dXJuIDE7CisJfSBlbHNlIHsK
KwkJcmV0dXJuIHRpbWUgPCBtYXg7CisJfQogfQogCiBzdGF0aWMgaW50IG5mc19sb29rdXAoc3Ry
dWN0IGlub2RlICpkaXIsIHN0cnVjdCBkZW50cnkgKiBkZW50cnkpCgo=

--Multipart_Wed_Aug__6_15:26:20_1997-1
Content-Type: text/plain; charset=US-ASCII

Claus-Justus Heine
claus@momo.math.rwth-aachen.de
http://samuel.math.rwth-aachen.de/~LBFM/claus

PGP Public Key:
http://samuel.math.rwth-aachen.de/~LBFM/claus/claus-public-key.asc

Ftape - the Linux Floppy Tape Project
WWW : http://samuel.math.rwth-aachen.de/~LBFM/claus/ftape
Mailing-list: linux-tape@vger.rutgers.edu

--Multipart_Wed_Aug__6_15:26:20_1997-1--

--pgp-sign-Multipart_Wed_Aug__6_15:26:20_1997-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE-----
Version: 2.6.3i
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBM+h7ldo/s1zPE7AdAQHIBAP8D+qjKvEgSUYGWJt0ZmWEkZCubEHwnGZ5
6aw3qGA0kMG/wR5XqC/1M9h7NcPDswKvyJhN18m/3jbr1q8P5o9s3Nr4vbwYYmx2
l6LShCWWcZASSsyAvPz3tVPp31hbia66D7aekiW0XKhVzXRfL5Ic4hbL0mBvbl74
VjsIiobeNSk=
=j1wn
-----END PGP MESSAGE-----

--pgp-sign-Multipart_Wed_Aug__6_15:26:20_1997-1--