1
linux/fs
Jeff Layton ecf3d1f1aa vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op
The following set of operations on a NFS client and server will cause

    server# mkdir a
    client# cd a
    server# mv a a.bak
    client# sleep 30  # (or whatever the dir attrcache timeout is)
    client# stat .
    stat: cannot stat `.': Stale NFS file handle

Obviously, we should not be getting an ESTALE error back there since the
inode still exists on the server. The problem is that the lookup code
will call d_revalidate on the dentry that "." refers to, because NFS has
FS_REVAL_DOT set.

nfs_lookup_revalidate will see that the parent directory has changed and
will try to reverify the dentry by redoing a LOOKUP. That of course
fails, so the lookup code returns ESTALE.

The problem here is that d_revalidate is really a bad fit for this case.
What we really want to know at this point is whether the inode is still
good or not, but we don't really care what name it goes by or whether
the dcache is still valid.

Add a new d_op->d_weak_revalidate operation and have complete_walk call
that instead of d_revalidate. The intent there is to allow for a
"weaker" d_revalidate that just checks to see whether the inode is still
good. This is also gives us an opportunity to kill off the FS_REVAL_DOT
special casing.

[AV: changed method name, added note in porting, fixed confusion re
having it possibly called from RCU mode (it won't be)]

Cc: NeilBrown <neilb@suse.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-02-26 02:46:09 -05:00
..
9p vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op 2013-02-26 02:46:09 -05:00
adfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
affs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
afs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
autofs4 new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
befs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
bfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
btrfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
cachefiles FS-Cache: Mark cancellation of in-progress operation 2012-12-20 22:34:00 +00:00
ceph ceph: prepopulate inodes only when request is aborted 2013-02-26 02:46:08 -05:00
cifs d_hash_and_lookup(): export, switch open-coded instances 2013-02-26 02:46:07 -05:00
coda new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
configfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
cramfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
debugfs debugfs: convert gid= argument from decimal, not octal 2013-01-11 05:56:01 -08:00
devpts
dlm
ecryptfs switch vfs_getattr() to struct path 2013-02-26 02:46:08 -05:00
efs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
exofs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
exportfs Merge branch 'for-3.8' of git://linux-nfs.org/~bfields/linux 2012-12-20 14:04:11 -08:00
ext2 new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ext3 new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ext4 new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
f2fs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
fat new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
freevxfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
fscache FS-Cache: Clear remaining page count on retrieval cancellation 2012-12-20 22:35:15 +00:00
fuse new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
gfs2 new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
hfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
hfsplus new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
hostfs hostfs: directory methods have no business in non-directory inode_operations 2013-02-22 23:31:37 -05:00
hpfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
hppfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
hugetlbfs hugetlb_file_setup(): use d_alloc_pseudo() 2013-02-26 02:45:52 -05:00
isofs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
jbd jbd: don't wake kjournald unnecessarily 2013-01-14 22:50:45 +01:00
jbd2 Various bug fixes for ext4. Perhaps the most serious bug fixed is one 2013-01-02 09:57:34 -08:00
jffs2 new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
jfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
lockd new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
logfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
minix new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ncpfs d_hash_and_lookup(): export, switch open-coded instances 2013-02-26 02:46:07 -05:00
nfs vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op 2013-02-26 02:46:09 -05:00
nfs_common
nfsd nfsd: handle vfs_getattr errors in acl protocol 2013-02-26 02:46:09 -05:00
nilfs2 new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
nls
notify new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ntfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ocfs2 new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
omfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
openpromfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
proc d_hash_and_lookup(): export, switch open-coded instances 2013-02-26 02:46:07 -05:00
pstore pstore: remove __dev* attributes. 2013-01-03 15:57:14 -08:00
qnx4 new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
qnx6 new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
quota quota: Use the pre-processor to compile out quotactl_cmd_write when !CONFIG_BLOCK 2012-12-13 16:33:24 +01:00
ramfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
reiserfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
romfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
squashfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
sysfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
sysv new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ubifs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
udf new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ufs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
xfs new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
aio.c
anon_inodes.c fs: Preserve error code in get_empty_filp(), part 2 2013-02-22 23:31:32 -05:00
attr.c
bad_inode.c lseek: the "whence" argument is called "whence" 2012-12-17 17:15:12 -08:00
binfmt_aout.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
binfmt_elf_fdpic.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
binfmt_elf.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
binfmt_em86.c exec: use -ELOOP for max recursion depth 2012-12-17 17:15:23 -08:00
binfmt_flat.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
binfmt_misc.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
binfmt_script.c exec: do not leave bprm->interp on stack 2012-12-20 17:40:19 -08:00
binfmt_som.c
bio-integrity.c
bio.c
block_dev.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
buffer.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
char_dev.c
compat_binfmt_elf.c
compat_ioctl.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
compat.c
coredump.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
coredump.h
dcache.c vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op 2013-02-26 02:46:09 -05:00
dcookies.c
direct-io.c fs: Fix possible use-after-free with AIO 2013-02-22 23:31:36 -05:00
drop_caches.c
eventfd.c fs, eventfd: add procfs fdinfo helper 2012-12-17 17:15:27 -08:00
eventpoll.c epoll: prevent missed events on EPOLL_CTL_MOD 2013-01-02 09:16:43 -08:00
exec.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
fcntl.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
fhandle.c Merge branch 'for-3.8' of git://linux-nfs.org/~bfields/linux 2012-12-20 14:04:11 -08:00
fifo.c
file_table.c fs: Preserve error code in get_empty_filp(), part 2 2013-02-22 23:31:32 -05:00
file.c misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
filesystems.c
fs_struct.c
fs-writeback.c writeback: fix a typo in comment 2012-12-12 17:38:34 -08:00
generic_acl.c
inode.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
internal.h
ioctl.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ioprio.c
Kconfig Introduce a new file system, Flash-Friendly File System (F2FS), to Linux 3.8. 2012-12-20 13:54:52 -08:00
Kconfig.binfmt
libfs.c vfs: drop vmtruncate 2012-12-20 18:46:29 -05:00
locks.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
Makefile
mbcache.c
mount.h
mpage.c
namei.c vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op 2013-02-26 02:46:09 -05:00
namespace.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
no-block.c
open.c propagate error from get_empty_filp() to its callers 2013-02-22 23:31:32 -05:00
pipe.c fs: Preserve error code in get_empty_filp(), part 2 2013-02-22 23:31:32 -05:00
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
read_write.h
readdir.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
select.c
seq_file.c seq_file: fix new kernel-doc warnings 2013-01-10 14:35:24 -08:00
signalfd.c fs, epoll: add procfs fdinfo helper 2012-12-17 17:15:27 -08:00
splice.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
stack.c
stat.c switch vfs_getattr() to struct path 2013-02-26 02:46:08 -05:00
statfs.c vfs: fix user_statfs to retry once on ESTALE errors 2012-12-20 18:50:07 -05:00
super.c
sync.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
timerfd.c
utimes.c vfs: allow utimensat() calls to retry once on an ESTALE error 2012-12-20 18:50:08 -05:00
xattr_acl.c
xattr.c vfs: make lremovexattr retry once on ESTALE error 2012-12-20 18:50:11 -05:00