[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bmnmrai9.fsf@notabene.neil.brown.name>
Date: Fri, 11 Aug 2017 14:31:10 +1000
From: NeilBrown <neilb@...e.com>
To: Jeff Layton <jlayton@...hat.com>, Al Viro <viro@...iv.linux.org.uk>
cc: Linux NFS Mailing List <linux-nfs@...r.kernel.org>,
linux-fsdevel@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>
Subject: Do we really need d_weak_revalidate???
Funny story. 4.5 years ago we discarded the FS_REVAL_DOT superblock
flag and introduced the d_weak_revalidate dentry operation instead.
We duly removed the flag from NFS superblocks and NFSv4 superblocks,
and added the new dentry operation to NFS dentries .... but not to NFSv4
dentries.
And nobody noticed.
Until today.
A customer reports a situation where mount(....,MS_REMOUNT,..) on an NFS
filesystem hangs because the network has been deconfigured. This makes
perfect sense and I suggested a code change to fix the problem.
However when a colleague was trying to reproduce the problem to validate
the fix, he couldn't. Then nor could I.
The problem is trivially reproducible with NFSv3, and not at all with
NFSv4. The reason is the missing d_weak_revalidate.
We could simply add d_weak_revalidate for NFSv4, but given that it
has been missing for 4.5 years, and the only time anyone noticed was
when the ommission resulted in a better user experience, I do wonder if
we need to. Can we just discard d_weak_revalidate? What purpose does
it serve? I couldn't find one.
Thanks,
NeilBrown
For reference, see
Commit: ecf3d1f1aa74 ("vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op")
To reproduce the problem at home, on a system that uses systemd:
1/ place (or find) a filesystem image in a file on an NFS filesystem.
2/ mount the nfs filesystem with "noac" - choose v3 or v4
3/ loop-mount the filesystem image read-only somewhere
4/ reboot
If you choose v4, the reboot will succeed, possibly after a 90second timeout.
If you choose v3, the reboot will hang indefinitely in systemd-shutdown while
remounting the nfs filesystem read-only.
If you don't use "noac" it can still hang, but only if something slows
down the reboot enough that attributes have timed out by the time that
systemd-shutdown runs. This happens for our customer.
If the loop-mounted filesystem is not read-only, you get other problems.
We really want systemd to figure out that the loop-mount needs to be
unmounted first. I have ideas concerning that, but it is messy. But
that isn't the only bug here.
Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)
Powered by blists - more mailing lists