From 75c5d1cb5ab6b45ed9b3d718d8c284bcb86f80de Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Sun, 25 Oct 2009 21:33:15 -0400 Subject: [PATCH] --- yaml --- r: 177204 b: refs/heads/master c: 82ead7fe41da960ed80652d13d5a1072f85f5aca h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/nfsd/vfs.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 795da3ff661b..9a69348dfed4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3b6cee7bc4b2f7858e9202293104acda8826bb68 +refs/heads/master: 82ead7fe41da960ed80652d13d5a1072f85f5aca diff --git a/trunk/fs/nfsd/vfs.c b/trunk/fs/nfsd/vfs.c index 7e2fdd50113f..eaf2f0dca12a 100644 --- a/trunk/fs/nfsd/vfs.c +++ b/trunk/fs/nfsd/vfs.c @@ -166,6 +166,19 @@ static int nfsd_lookup_parent(struct svc_rqst *rqstp, struct dentry *dparent, st return 0; } +/* + * For nfsd purposes, we treat V4ROOT exports as though there was an + * export at *every* directory. + */ +static int nfsd_mountpoint(struct dentry *dentry, struct svc_export *exp) +{ + if (d_mountpoint(dentry)) + return 1; + if (!(exp->ex_flags & NFSEXP_V4ROOT)) + return 0; + return dentry->d_inode != NULL; +} + __be32 nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name, unsigned int len, @@ -211,7 +224,7 @@ nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp, /* * check if we have crossed a mount point ... */ - if (d_mountpoint(dentry)) { + if (nfsd_mountpoint(dentry, exp)) { if ((host_err = nfsd_cross_mnt(rqstp, &dentry, &exp))) { dput(dentry); goto out_nfserr;