aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2007-02-22 18:48:53 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2007-05-06 17:38:19 -0400
commit70cc6487a4e08b8698c0e2ec935fb48d10490162 (patch)
tree3dbf00694a5fcbea48233b78697a50effdcc80c9 /fs
parentc2fa1b8a6c059dd08a802545fed3badc8df2adc1 (diff)
locks: make ->lock release private data before returning in GETLK case
The file_lock argument to ->lock is used to return the conflicting lock when found. There's no reason for the filesystem to return any private information with this conflicting lock, but nfsv4 is. Fix nfsv4 client, and modify locks.c to stop calling fl_release_private for it in this case. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Cc: "Trond Myklebust" <Trond.Myklebust@netapp.com>"
Diffstat (limited to 'fs')
-rw-r--r--fs/locks.c4
-rw-r--r--fs/nfs/nfs4proc.c1
2 files changed, 1 insertions, 4 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 957775ba6468..b07e6e6f819b 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1665,8 +1665,6 @@ int fcntl_getlk(struct file *filp, struct flock __user *l)
1665 1665
1666 if (filp->f_op && filp->f_op->lock) { 1666 if (filp->f_op && filp->f_op->lock) {
1667 error = filp->f_op->lock(filp, F_GETLK, &file_lock); 1667 error = filp->f_op->lock(filp, F_GETLK, &file_lock);
1668 if (file_lock.fl_ops && file_lock.fl_ops->fl_release_private)
1669 file_lock.fl_ops->fl_release_private(&file_lock);
1670 if (error < 0) 1668 if (error < 0)
1671 goto out; 1669 goto out;
1672 else 1670 else
@@ -1804,8 +1802,6 @@ int fcntl_getlk64(struct file *filp, struct flock64 __user *l)
1804 1802
1805 if (filp->f_op && filp->f_op->lock) { 1803 if (filp->f_op && filp->f_op->lock) {
1806 error = filp->f_op->lock(filp, F_GETLK, &file_lock); 1804 error = filp->f_op->lock(filp, F_GETLK, &file_lock);
1807 if (file_lock.fl_ops && file_lock.fl_ops->fl_release_private)
1808 file_lock.fl_ops->fl_release_private(&file_lock);
1809 if (error < 0) 1805 if (error < 0)
1810 goto out; 1806 goto out;
1811 else 1807 else
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f52cf5c33c6c..d9000ec52f72 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3018,6 +3018,7 @@ static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock
3018 case -NFS4ERR_DENIED: 3018 case -NFS4ERR_DENIED:
3019 status = 0; 3019 status = 0;
3020 } 3020 }
3021 request->fl_ops->fl_release_private(request);
3021out: 3022out:
3022 up_read(&clp->cl_sem); 3023 up_read(&clp->cl_sem);
3023 return status; 3024 return status;