diff options
-rw-r--r-- | fs/nfsd/nfsfh.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index ca96ede30a10..ecc439d2565f 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -187,13 +187,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
187 | goto out; | 187 | goto out; |
188 | } | 188 | } |
189 | 189 | ||
190 | /* Set user creds for this exportpoint */ | ||
191 | error = nfsd_setuser(rqstp, exp); | ||
192 | if (error) { | ||
193 | error = nfserrno(error); | ||
194 | goto out; | ||
195 | } | ||
196 | |||
197 | /* | 190 | /* |
198 | * Look up the dentry using the NFS file handle. | 191 | * Look up the dentry using the NFS file handle. |
199 | */ | 192 | */ |
@@ -251,6 +244,14 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) | |||
251 | } | 244 | } |
252 | cache_get(&exp->h); | 245 | cache_get(&exp->h); |
253 | 246 | ||
247 | /* Set user creds for this exportpoint; necessary even in the "just | ||
248 | * checking" case because this may be a filehandle that was created by | ||
249 | * fh_compose, and that is about to be used in another nfsv4 compound | ||
250 | * operation */ | ||
251 | error = nfserrno(nfsd_setuser(rqstp, exp)); | ||
252 | if (error) | ||
253 | goto out; | ||
254 | |||
254 | error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); | 255 | error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type); |
255 | if (error) | 256 | if (error) |
256 | goto out; | 257 | goto out; |