diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/vfs.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 7e2fdd50113f..eaf2f0dca12a 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -166,6 +166,19 @@ static int nfsd_lookup_parent(struct svc_rqst *rqstp, struct dentry *dparent, st | |||
166 | return 0; | 166 | return 0; |
167 | } | 167 | } |
168 | 168 | ||
169 | /* | ||
170 | * For nfsd purposes, we treat V4ROOT exports as though there was an | ||
171 | * export at *every* directory. | ||
172 | */ | ||
173 | static int nfsd_mountpoint(struct dentry *dentry, struct svc_export *exp) | ||
174 | { | ||
175 | if (d_mountpoint(dentry)) | ||
176 | return 1; | ||
177 | if (!(exp->ex_flags & NFSEXP_V4ROOT)) | ||
178 | return 0; | ||
179 | return dentry->d_inode != NULL; | ||
180 | } | ||
181 | |||
169 | __be32 | 182 | __be32 |
170 | nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp, | 183 | nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp, |
171 | const char *name, unsigned int len, | 184 | const char *name, unsigned int len, |
@@ -211,7 +224,7 @@ nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
211 | /* | 224 | /* |
212 | * check if we have crossed a mount point ... | 225 | * check if we have crossed a mount point ... |
213 | */ | 226 | */ |
214 | if (d_mountpoint(dentry)) { | 227 | if (nfsd_mountpoint(dentry, exp)) { |
215 | if ((host_err = nfsd_cross_mnt(rqstp, &dentry, &exp))) { | 228 | if ((host_err = nfsd_cross_mnt(rqstp, &dentry, &exp))) { |
216 | dput(dentry); | 229 | dput(dentry); |
217 | goto out_nfserr; | 230 | goto out_nfserr; |