From: Miklos Szeredi Date: Mon, 21 May 2012 15:30:20 +0000 (+0200) Subject: nfs: don't open in ->d_revalidate X-Git-Tag: v3.5-rc1~15^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ef97dcfce4179a2eba046b855ee2f91d6f1b414;p=pandora-kernel.git nfs: don't open in ->d_revalidate NFSv4 can't do reliable opens in d_revalidate, since it cannot know whether a mount needs to be followed or not. It does check d_mountpoint() on the dentry, which can result in a weird error if the VFS found that the mount does not in fact need to be followed, e.g.: # mount --bind /mnt/nfs /mnt/nfs-clone # echo something > /mnt/nfs/tmp/bar # echo x > /tmp/file # mount --bind /tmp/file /mnt/nfs-clone/tmp/bar # cat /mnt/nfs/tmp/bar cat: /mnt/nfs/tmp/bar: Not a directory Which should, by any sane filesystem, result in "something" being printed. So instead do the open in f_op->open() and in the unlikely case that the cached dentry turned out to be invalid, drop the dentry and return EOPENSTALE to let the VFS retry. Signed-off-by: Miklos Szeredi CC: Trond Myklebust Signed-off-by: Al Viro --- Reading git-diff-tree failed