aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2007-12-06 10:35:25 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-01-25 03:08:23 -0500
commit2066b58b0a038d7aedd24133677efb8856cac3a1 (patch)
tree0afb8a5ee7a9c1a0e4f618b818f8bd05ccd8c3a9 /fs
parentdbee2199c37336e89060fbe9abdfd1ca8454372a (diff)
[GFS2] use pid for plock owner for nfs clients
The fl_owner is that of lockd when posix locks arrive from nfs clients, so it can't be used to distinguish between lock holders. Use fl_pid as owner instead; it's the pid of the process on the nfs client. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/locking/dlm/plock.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c
index 1f7b038530b4..2ebd374b3143 100644
--- a/fs/gfs2/locking/dlm/plock.c
+++ b/fs/gfs2/locking/dlm/plock.c
@@ -89,15 +89,19 @@ int gdlm_plock(void *lockspace, struct lm_lockname *name,
89 op->info.number = name->ln_number; 89 op->info.number = name->ln_number;
90 op->info.start = fl->fl_start; 90 op->info.start = fl->fl_start;
91 op->info.end = fl->fl_end; 91 op->info.end = fl->fl_end;
92 op->info.owner = (__u64)(long) fl->fl_owner;
93 if (fl->fl_lmops && fl->fl_lmops->fl_grant) { 92 if (fl->fl_lmops && fl->fl_lmops->fl_grant) {
93 /* fl_owner is lockd which doesn't distinguish
94 processes on the nfs client */
95 op->info.owner = (__u64) fl->fl_pid;
94 xop->callback = fl->fl_lmops->fl_grant; 96 xop->callback = fl->fl_lmops->fl_grant;
95 locks_init_lock(&xop->flc); 97 locks_init_lock(&xop->flc);
96 locks_copy_lock(&xop->flc, fl); 98 locks_copy_lock(&xop->flc, fl);
97 xop->fl = fl; 99 xop->fl = fl;
98 xop->file = file; 100 xop->file = file;
99 } else 101 } else {
102 op->info.owner = (__u64)(long) fl->fl_owner;
100 xop->callback = NULL; 103 xop->callback = NULL;
104 }
101 105
102 send_op(op); 106 send_op(op);
103 107
@@ -203,7 +207,10 @@ int gdlm_punlock(void *lockspace, struct lm_lockname *name,
203 op->info.number = name->ln_number; 207 op->info.number = name->ln_number;
204 op->info.start = fl->fl_start; 208 op->info.start = fl->fl_start;
205 op->info.end = fl->fl_end; 209 op->info.end = fl->fl_end;
206 op->info.owner = (__u64)(long) fl->fl_owner; 210 if (fl->fl_lmops && fl->fl_lmops->fl_grant)
211 op->info.owner = (__u64) fl->fl_pid;
212 else
213 op->info.owner = (__u64)(long) fl->fl_owner;
207 214
208 send_op(op); 215 send_op(op);
209 wait_event(recv_wq, (op->done != 0)); 216 wait_event(recv_wq, (op->done != 0));
@@ -242,7 +249,10 @@ int gdlm_plock_get(void *lockspace, struct lm_lockname *name,
242 op->info.number = name->ln_number; 249 op->info.number = name->ln_number;
243 op->info.start = fl->fl_start; 250 op->info.start = fl->fl_start;
244 op->info.end = fl->fl_end; 251 op->info.end = fl->fl_end;
245 op->info.owner = (__u64)(long) fl->fl_owner; 252 if (fl->fl_lmops && fl->fl_lmops->fl_grant)
253 op->info.owner = (__u64) fl->fl_pid;
254 else
255 op->info.owner = (__u64)(long) fl->fl_owner;
246 256
247 send_op(op); 257 send_op(op);
248 wait_event(recv_wq, (op->done != 0)); 258 wait_event(recv_wq, (op->done != 0));