[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>
This commit is contained in:
parent
dbee2199c3
commit
2066b58b0a
|
@ -89,15 +89,19 @@ int gdlm_plock(void *lockspace, struct lm_lockname *name,
|
||||||
op->info.number = name->ln_number;
|
op->info.number = name->ln_number;
|
||||||
op->info.start = fl->fl_start;
|
op->info.start = fl->fl_start;
|
||||||
op->info.end = fl->fl_end;
|
op->info.end = fl->fl_end;
|
||||||
op->info.owner = (__u64)(long) fl->fl_owner;
|
|
||||||
if (fl->fl_lmops && fl->fl_lmops->fl_grant) {
|
if (fl->fl_lmops && fl->fl_lmops->fl_grant) {
|
||||||
|
/* fl_owner is lockd which doesn't distinguish
|
||||||
|
processes on the nfs client */
|
||||||
|
op->info.owner = (__u64) fl->fl_pid;
|
||||||
xop->callback = fl->fl_lmops->fl_grant;
|
xop->callback = fl->fl_lmops->fl_grant;
|
||||||
locks_init_lock(&xop->flc);
|
locks_init_lock(&xop->flc);
|
||||||
locks_copy_lock(&xop->flc, fl);
|
locks_copy_lock(&xop->flc, fl);
|
||||||
xop->fl = fl;
|
xop->fl = fl;
|
||||||
xop->file = file;
|
xop->file = file;
|
||||||
} else
|
} else {
|
||||||
|
op->info.owner = (__u64)(long) fl->fl_owner;
|
||||||
xop->callback = NULL;
|
xop->callback = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
send_op(op);
|
send_op(op);
|
||||||
|
|
||||||
|
@ -203,6 +207,9 @@ int gdlm_punlock(void *lockspace, struct lm_lockname *name,
|
||||||
op->info.number = name->ln_number;
|
op->info.number = name->ln_number;
|
||||||
op->info.start = fl->fl_start;
|
op->info.start = fl->fl_start;
|
||||||
op->info.end = fl->fl_end;
|
op->info.end = fl->fl_end;
|
||||||
|
if (fl->fl_lmops && fl->fl_lmops->fl_grant)
|
||||||
|
op->info.owner = (__u64) fl->fl_pid;
|
||||||
|
else
|
||||||
op->info.owner = (__u64)(long) fl->fl_owner;
|
op->info.owner = (__u64)(long) fl->fl_owner;
|
||||||
|
|
||||||
send_op(op);
|
send_op(op);
|
||||||
|
@ -242,6 +249,9 @@ int gdlm_plock_get(void *lockspace, struct lm_lockname *name,
|
||||||
op->info.number = name->ln_number;
|
op->info.number = name->ln_number;
|
||||||
op->info.start = fl->fl_start;
|
op->info.start = fl->fl_start;
|
||||||
op->info.end = fl->fl_end;
|
op->info.end = fl->fl_end;
|
||||||
|
if (fl->fl_lmops && fl->fl_lmops->fl_grant)
|
||||||
|
op->info.owner = (__u64) fl->fl_pid;
|
||||||
|
else
|
||||||
op->info.owner = (__u64)(long) fl->fl_owner;
|
op->info.owner = (__u64)(long) fl->fl_owner;
|
||||||
|
|
||||||
send_op(op);
|
send_op(op);
|
||||||
|
|
Loading…
Reference in a new issue