diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-03 13:49:45 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-03 13:49:45 -0400 |
commit | 026477c1141b67e98e3bd8bdedb7d4b88a3ecd09 (patch) | |
tree | 2624a44924c625c367f3cebf937853b9da2de282 /fs/nfsd/nfsfh.c | |
parent | 9f2fa466383ce100b90fe52cb4489d7a26bf72a9 (diff) | |
parent | 29454dde27d8e340bb1987bad9aa504af7081eba (diff) |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Diffstat (limited to 'fs/nfsd/nfsfh.c')
-rw-r--r-- | fs/nfsd/nfsfh.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 3f2ec2e6d06c..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; |
@@ -312,8 +313,8 @@ int | |||
312 | fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, struct svc_fh *ref_fh) | 313 | fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, struct svc_fh *ref_fh) |
313 | { | 314 | { |
314 | /* ref_fh is a reference file handle. | 315 | /* ref_fh is a reference file handle. |
315 | * if it is non-null, then we should compose a filehandle which is | 316 | * if it is non-null and for the same filesystem, then we should compose |
316 | * of the same version, where possible. | 317 | * a filehandle which is of the same version, where possible. |
317 | * Currently, that means that if ref_fh->fh_handle.fh_version == 0xca | 318 | * Currently, that means that if ref_fh->fh_handle.fh_version == 0xca |
318 | * Then create a 32byte filehandle using nfs_fhbase_old | 319 | * Then create a 32byte filehandle using nfs_fhbase_old |
319 | * | 320 | * |
@@ -332,7 +333,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, st | |||
332 | parent->d_name.name, dentry->d_name.name, | 333 | parent->d_name.name, dentry->d_name.name, |
333 | (inode ? inode->i_ino : 0)); | 334 | (inode ? inode->i_ino : 0)); |
334 | 335 | ||
335 | if (ref_fh) { | 336 | if (ref_fh && ref_fh->fh_export == exp) { |
336 | ref_fh_version = ref_fh->fh_handle.fh_version; | 337 | ref_fh_version = ref_fh->fh_handle.fh_version; |
337 | if (ref_fh_version == 0xca) | 338 | if (ref_fh_version == 0xca) |
338 | ref_fh_fsid_type = 0; | 339 | ref_fh_fsid_type = 0; |
@@ -461,7 +462,7 @@ fh_update(struct svc_fh *fhp) | |||
461 | } else { | 462 | } else { |
462 | int size; | 463 | int size; |
463 | if (fhp->fh_handle.fh_fileid_type != 0) | 464 | if (fhp->fh_handle.fh_fileid_type != 0) |
464 | goto out_uptodate; | 465 | goto out; |
465 | datap = fhp->fh_handle.fh_auth+ | 466 | datap = fhp->fh_handle.fh_auth+ |
466 | fhp->fh_handle.fh_size/4 -1; | 467 | fhp->fh_handle.fh_size/4 -1; |
467 | size = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4; | 468 | size = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4; |
@@ -481,10 +482,6 @@ out_negative: | |||
481 | printk(KERN_ERR "fh_update: %s/%s still negative!\n", | 482 | printk(KERN_ERR "fh_update: %s/%s still negative!\n", |
482 | dentry->d_parent->d_name.name, dentry->d_name.name); | 483 | dentry->d_parent->d_name.name, dentry->d_name.name); |
483 | goto out; | 484 | goto out; |
484 | out_uptodate: | ||
485 | printk(KERN_ERR "fh_update: %s/%s already up-to-date!\n", | ||
486 | dentry->d_parent->d_name.name, dentry->d_name.name); | ||
487 | goto out; | ||
488 | } | 485 | } |
489 | 486 | ||
490 | /* | 487 | /* |