diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2008-04-24 10:08:22 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-04-25 13:00:11 -0400 |
commit | 1a747ee0cc11a198f9e2435add821bd0dfedb7c1 (patch) | |
tree | 10b5a55bde30bef3f466e5126bd44fc0e111fc5a /fs/nfsd | |
parent | 17efa372cfe4d189705edf6cd4fbe283827a5dc7 (diff) |
locks: don't call ->copy_lock methods on return of conflicting locks
The file_lock structure is used both as a heavy-weight representation of
an active lock, with pointers to reference-counted structures, etc., and
as a simple container for parameters that describe a file lock.
The conflicting lock returned from __posix_lock_file is an example of
the latter; so don't call the filesystem or lock manager callbacks when
copying to it. This also saves the need for an unnecessary
locks_init_lock in the nfsv4 server.
Thanks to Trond for pointing out the error.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 55dfdd71f1b0..8799b8708188 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2712,9 +2712,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
2712 | * Note: locks.c uses the BKL to protect the inode's lock list. | 2712 | * Note: locks.c uses the BKL to protect the inode's lock list. |
2713 | */ | 2713 | */ |
2714 | 2714 | ||
2715 | /* XXX?: Just to divert the locks_release_private at the start of | ||
2716 | * locks_copy_lock: */ | ||
2717 | locks_init_lock(&conflock); | ||
2718 | err = vfs_lock_file(filp, cmd, &file_lock, &conflock); | 2715 | err = vfs_lock_file(filp, cmd, &file_lock, &conflock); |
2719 | switch (-err) { | 2716 | switch (-err) { |
2720 | case 0: /* success! */ | 2717 | case 0: /* success! */ |