From 73f68eb6534c90544ca1395465a3d69d97bfb601 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Sun, 25 Oct 2009 21:18:19 -0400 Subject: [PATCH] --- yaml --- r: 177203 b: refs/heads/master c: 3b6cee7bc4b2f7858e9202293104acda8826bb68 h: refs/heads/master i: 177201: e11e252cdf1f7dc0cd8bd6d318d9dc972460ed40 177199: 5044ee80b97cfbad8a3b06ce31d98e49eaba2972 v: v3 --- [refs] | 2 +- trunk/fs/nfsd/vfs.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 9abbe9ae0f22..795da3ff661b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eb4c86c6a5adec423c9e615d4937fdddd06a16c5 +refs/heads/master: 3b6cee7bc4b2f7858e9202293104acda8826bb68 diff --git a/trunk/fs/nfsd/vfs.c b/trunk/fs/nfsd/vfs.c index 04bdba12d21b..7e2fdd50113f 100644 --- a/trunk/fs/nfsd/vfs.c +++ b/trunk/fs/nfsd/vfs.c @@ -99,8 +99,16 @@ nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, exp2 = rqst_exp_get_by_name(rqstp, &path); if (IS_ERR(exp2)) { - if (PTR_ERR(exp2) != -ENOENT) - err = PTR_ERR(exp2); + err = PTR_ERR(exp2); + /* + * We normally allow NFS clients to continue + * "underneath" a mountpoint that is not exported. + * The exception is V4ROOT, where no traversal is ever + * allowed without an explicit export of the new + * directory. + */ + if (err == -ENOENT && !(exp->ex_flags & NFSEXP_V4ROOT)) + err = 0; path_put(&path); goto out; }