summaryrefslogtreecommitdiffstats
path: root/fs/lockd/clntlock.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:06 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-20 13:44:06 -0500
commit7bab377fcb495ee2e5a1cd69d235f8d84c76e3af (patch)
tree67f03fbc543632ccf71075af250635201b43801b /fs/lockd/clntlock.c
parent36943fa4b2701b9ef2d60084c85ecbe634aec252 (diff)
downloadop-kernel-dev-7bab377fcb495ee2e5a1cd69d235f8d84c76e3af.zip
op-kernel-dev-7bab377fcb495ee2e5a1cd69d235f8d84c76e3af.tar.gz
lockd: Don't expose the process pid to the NLM server
Instead we use the nlm_lockowner->pid. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd/clntlock.c')
-rw-r--r--fs/lockd/clntlock.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index da6354b..8ae79ae 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -125,7 +125,15 @@ u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *lock)
list_for_each_entry(block, &nlm_blocked, b_list) {
struct file_lock *fl_blocked = block->b_lock;
- if (!nlm_compare_locks(fl_blocked, fl))
+ if (fl_blocked->fl_start != fl->fl_start)
+ continue;
+ if (fl_blocked->fl_end != fl->fl_end)
+ continue;
+ /*
+ * Careful! The NLM server will return the 32-bit "pid" that
+ * we put on the wire: in this case the lockowner "pid".
+ */
+ if (fl_blocked->fl_u.nfs_fl.owner->pid != lock->svid)
continue;
if (!nlm_cmp_addr(&block->b_host->h_addr, addr))
continue;
OpenPOWER on IntegriCloud