From d622b7f7244aaeb1bdafa8b56742364056780273 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Fri, 30 Jun 2006 01:56:14 -0700 Subject: [PATCH] --- yaml --- r: 31417 b: refs/heads/master c: 7fc90ec93a5eb71f4b08403baf5ba7176b3ec6b1 h: refs/heads/master i: 31415: 01fd5f4fc6c0048bf96cf9aca7e0510deb5992b3 v: v3 --- [refs] | 2 +- trunk/fs/nfsd/nfsfh.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 4303998d8fd1..248dba2d92c8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a8cddc5dfc1d03a91885ef27eb91418e665577ce +refs/heads/master: 7fc90ec93a5eb71f4b08403baf5ba7176b3ec6b1 diff --git a/trunk/fs/nfsd/nfsfh.c b/trunk/fs/nfsd/nfsfh.c index ca96ede30a10..ecc439d2565f 100644 --- a/trunk/fs/nfsd/nfsfh.c +++ b/trunk/fs/nfsd/nfsfh.c @@ -187,13 +187,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) goto out; } - /* Set user creds for this exportpoint */ - error = nfsd_setuser(rqstp, exp); - if (error) { - error = nfserrno(error); - goto out; - } - /* * Look up the dentry using the NFS file handle. */ @@ -251,6 +244,14 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) } cache_get(&exp->h); + /* Set user creds for this exportpoint; necessary even in the "just + * checking" case because this may be a filehandle that was created by + * fh_compose, and that is about to be used in another nfsv4 compound + * operation */ + error = nfserrno(nfsd_setuser(rqstp, exp)); + if (error) + goto out; + error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); if (error) goto out;