summaryrefslogtreecommitdiffstats
path: root/fs/nfs/namespace.c
diff options
context:
space:
mode:
authorManoj Naik <manoj@almaden.ibm.com>2006-06-09 09:34:29 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-09 09:34:29 -0400
commit6b97fd3da1eab2cc490cfe884c7d4956522eaf8b (patch)
tree055f5f603101a15f783ae52081e4714ddc3edc96 /fs/nfs/namespace.c
parent9cdb3883c38f883436a84c2353a4cf964ff890a2 (diff)
downloadlinux-6b97fd3da1eab2cc490cfe884c7d4956522eaf8b.tar.bz2
NFSv4: Follow a referral
Respond to a moved error on NFS lookup by setting up the referral. Note: We don't actually follow the referral during lookup/getattr, but later when we detect fsid mismatch in inode revalidation (similar to the processing done for cloning submounts). Referrals will have fake attributes until they are actually followed or traversed. Signed-off-by: Manoj Naik <manoj@almaden.ibm.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/namespace.c')
-rw-r--r--fs/nfs/namespace.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index e426516c1116..8ca44b7b25c3 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -58,7 +58,10 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
if (err != 0)
goto out_err;
- mnt = nfs_do_submount(nd->mnt, nd->dentry, &fh, &fattr);
+ if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL)
+ mnt = nfs_do_refmount(nd->mnt, nd->dentry);
+ else
+ mnt = nfs_do_submount(nd->mnt, nd->dentry, &fh, &fattr);
err = PTR_ERR(mnt);
if (IS_ERR(mnt))
goto out_err;
@@ -94,6 +97,10 @@ struct inode_operations nfs_mountpoint_inode_operations = {
.getattr = nfs_getattr,
};
+struct inode_operations nfs_referral_inode_operations = {
+ .follow_link = nfs_follow_mountpoint,
+};
+
static void nfs_expire_automounts(void *data)
{
struct list_head *list = (struct list_head *)data;