OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-4139-g997f7fc
Gerrit Code Review
gerrit@openafs.org
Wed, 5 Feb 2014 06:39:07 -0800 (PST)
The following commit has been merged in the master branch:
commit 997f7fce437787a45ae0584beaae43affbd37cce
Author: Marc Dionne <marc.dionne@your-file-system.com>
Date: Thu Jan 30 13:50:37 2014 -0500
Linux: When revalidating, don't drop in-use dentries
The Linux client can get into a state where the current working
directory is seen as "deleted" by some tools, while it is still
there and accessible to "ls" and other tools. This has been
reported by several users and sites.
One scenario that has been observed while debugging:
- A process does a chdir() into a directory
- This stores a pointer to the dir's dentry in the task structure
- The server hosting the volume goes offline temporarily
- The dentry for the directory is passed to afs_linux_dentry_revalidate
- afs_linux_dentry_revalidate calls afs_lookup which returns an
error (110 - ETIMEDOUT)
- It then considers the dentry not valid, and calls d_drop()
- d_drop unhashes the dentry unconditionally
- Server comes back up, but dentry is still unhashed
- getcwd() fetches the task structure pointer to the current dir
dentry. If unhashed, it returns ENOENT, and the vfs layer is
not involved at all.
At that point, many things won't work and there is no obvious way
for the user to get the directory rehashed.
Instead of calling d_drop directly, call d_invalidate instead, as
it will only drop (unhash) the dentry if we're the only one holding
a reference. Since d_invalidate will also call shrink_dcache_parent,
also remove that call from our code so it doesn't get called twice.
Change-Id: I03e9872f6f9aebd28cdf6b833e14955edaa2527c
Reviewed-on: http://gerrit.openafs.org/10774
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
src/afs/LINUX/osi_vnodeops.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
--
OpenAFS Master Repository