diff options
Diffstat (limited to 'fs/nfs/namespace.c')
-rw-r--r-- | fs/nfs/namespace.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index be4ce1c3a3d8..3b6d83dc98a7 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c | |||
@@ -107,38 +107,40 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) | |||
107 | 107 | ||
108 | BUG_ON(IS_ROOT(dentry)); | 108 | BUG_ON(IS_ROOT(dentry)); |
109 | dprintk("%s: enter\n", __FUNCTION__); | 109 | dprintk("%s: enter\n", __FUNCTION__); |
110 | dput(nd->dentry); | 110 | dput(nd->path.dentry); |
111 | nd->dentry = dget(dentry); | 111 | nd->path.dentry = dget(dentry); |
112 | 112 | ||
113 | /* Look it up again */ | 113 | /* Look it up again */ |
114 | parent = dget_parent(nd->dentry); | 114 | parent = dget_parent(nd->path.dentry); |
115 | err = server->nfs_client->rpc_ops->lookup(parent->d_inode, | 115 | err = server->nfs_client->rpc_ops->lookup(parent->d_inode, |
116 | &nd->dentry->d_name, | 116 | &nd->path.dentry->d_name, |
117 | &fh, &fattr); | 117 | &fh, &fattr); |
118 | dput(parent); | 118 | dput(parent); |
119 | if (err != 0) | 119 | if (err != 0) |
120 | goto out_err; | 120 | goto out_err; |
121 | 121 | ||
122 | if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL) | 122 | if (fattr.valid & NFS_ATTR_FATTR_V4_REFERRAL) |
123 | mnt = nfs_do_refmount(nd->mnt, nd->dentry); | 123 | mnt = nfs_do_refmount(nd->path.mnt, nd->path.dentry); |
124 | else | 124 | else |
125 | mnt = nfs_do_submount(nd->mnt, nd->dentry, &fh, &fattr); | 125 | mnt = nfs_do_submount(nd->path.mnt, nd->path.dentry, &fh, |
126 | &fattr); | ||
126 | err = PTR_ERR(mnt); | 127 | err = PTR_ERR(mnt); |
127 | if (IS_ERR(mnt)) | 128 | if (IS_ERR(mnt)) |
128 | goto out_err; | 129 | goto out_err; |
129 | 130 | ||
130 | mntget(mnt); | 131 | mntget(mnt); |
131 | err = do_add_mount(mnt, nd, nd->mnt->mnt_flags|MNT_SHRINKABLE, &nfs_automount_list); | 132 | err = do_add_mount(mnt, nd, nd->path.mnt->mnt_flags|MNT_SHRINKABLE, |
133 | &nfs_automount_list); | ||
132 | if (err < 0) { | 134 | if (err < 0) { |
133 | mntput(mnt); | 135 | mntput(mnt); |
134 | if (err == -EBUSY) | 136 | if (err == -EBUSY) |
135 | goto out_follow; | 137 | goto out_follow; |
136 | goto out_err; | 138 | goto out_err; |
137 | } | 139 | } |
138 | mntput(nd->mnt); | 140 | mntput(nd->path.mnt); |
139 | dput(nd->dentry); | 141 | dput(nd->path.dentry); |
140 | nd->mnt = mnt; | 142 | nd->path.mnt = mnt; |
141 | nd->dentry = dget(mnt->mnt_root); | 143 | nd->path.dentry = dget(mnt->mnt_root); |
142 | schedule_delayed_work(&nfs_automount_task, nfs_mountpoint_expiry_timeout); | 144 | schedule_delayed_work(&nfs_automount_task, nfs_mountpoint_expiry_timeout); |
143 | out: | 145 | out: |
144 | dprintk("%s: done, returned %d\n", __FUNCTION__, err); | 146 | dprintk("%s: done, returned %d\n", __FUNCTION__, err); |
@@ -149,7 +151,8 @@ out_err: | |||
149 | path_release(nd); | 151 | path_release(nd); |
150 | goto out; | 152 | goto out; |
151 | out_follow: | 153 | out_follow: |
152 | while(d_mountpoint(nd->dentry) && follow_down(&nd->mnt, &nd->dentry)) | 154 | while (d_mountpoint(nd->path.dentry) && |
155 | follow_down(&nd->path.mnt, &nd->path.dentry)) | ||
153 | ; | 156 | ; |
154 | err = 0; | 157 | err = 0; |
155 | goto out; | 158 | goto out; |