diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-13 08:32:54 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-13 08:32:54 -0400 |
commit | dc2af52c0d6d00fd530e4a5e300834cdb1bb1c1c (patch) | |
tree | 4573b99fb11e5b93bd011045039b370ddafe45e6 /fs/nfsd/nfs4state.c | |
parent | f1992dde7fef6713a469a5a142b86812b8a47f9e (diff) | |
parent | 36be50515fe2aef61533b516fa2576a2c7fe7664 (diff) |
Merge tag 'v3.4-rc7' into for-3.5
Linux 3.4-rc7
Conflicts):
drivers/base/regmap/regmap.c (overlap with bug fixes)
sound/soc/blackfin/bf5xx-ssm2602.c (overlap with bug fixes)
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 1841f8bf845e..7f71c69cdcdf 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -4211,16 +4211,14 @@ out: | |||
4211 | * vfs_test_lock. (Arguably perhaps test_lock should be done with an | 4211 | * vfs_test_lock. (Arguably perhaps test_lock should be done with an |
4212 | * inode operation.) | 4212 | * inode operation.) |
4213 | */ | 4213 | */ |
4214 | static int nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock) | 4214 | static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock) |
4215 | { | 4215 | { |
4216 | struct file *file; | 4216 | struct file *file; |
4217 | int err; | 4217 | __be32 err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); |
4218 | 4218 | if (!err) { | |
4219 | err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); | 4219 | err = nfserrno(vfs_test_lock(file, lock)); |
4220 | if (err) | 4220 | nfsd_close(file); |
4221 | return err; | 4221 | } |
4222 | err = vfs_test_lock(file, lock); | ||
4223 | nfsd_close(file); | ||
4224 | return err; | 4222 | return err; |
4225 | } | 4223 | } |
4226 | 4224 | ||
@@ -4234,7 +4232,6 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
4234 | struct inode *inode; | 4232 | struct inode *inode; |
4235 | struct file_lock file_lock; | 4233 | struct file_lock file_lock; |
4236 | struct nfs4_lockowner *lo; | 4234 | struct nfs4_lockowner *lo; |
4237 | int error; | ||
4238 | __be32 status; | 4235 | __be32 status; |
4239 | 4236 | ||
4240 | if (locks_in_grace()) | 4237 | if (locks_in_grace()) |
@@ -4280,12 +4277,10 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
4280 | 4277 | ||
4281 | nfs4_transform_lock_offset(&file_lock); | 4278 | nfs4_transform_lock_offset(&file_lock); |
4282 | 4279 | ||
4283 | status = nfs_ok; | 4280 | status = nfsd_test_lock(rqstp, &cstate->current_fh, &file_lock); |
4284 | error = nfsd_test_lock(rqstp, &cstate->current_fh, &file_lock); | 4281 | if (status) |
4285 | if (error) { | ||
4286 | status = nfserrno(error); | ||
4287 | goto out; | 4282 | goto out; |
4288 | } | 4283 | |
4289 | if (file_lock.fl_type != F_UNLCK) { | 4284 | if (file_lock.fl_type != F_UNLCK) { |
4290 | status = nfserr_denied; | 4285 | status = nfserr_denied; |
4291 | nfs4_set_lock_denied(&file_lock, &lockt->lt_denied); | 4286 | nfs4_set_lock_denied(&file_lock, &lockt->lt_denied); |