Miklos Szeredi 0ef97dcfce 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 <mszeredi@suse.cz>
CC: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-06-01 12:12:02 -04:00
..
2012-05-04 14:59:51 -04:00
2012-05-26 14:17:30 -04:00
2012-06-01 12:12:02 -04:00
2012-06-01 12:12:02 -04:00
2012-05-14 17:30:26 -07:00
2012-05-29 10:43:51 -07:00
2012-05-14 17:42:22 -07:00
2012-05-14 17:42:22 -07:00
2012-03-11 15:14:16 -04:00
2012-05-29 10:43:51 -07:00
2012-05-29 10:43:51 -07:00
2012-05-22 16:45:42 -04:00
2012-05-29 10:43:51 -07:00