From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Re: [PATCH] gfs2: use pid for plock owner for nfs clients
Date: Fri, 07 Dec 2007 13:43:34 +0000 [thread overview]
Message-ID: <1197035014.1068.1031.camel@quoit> (raw)
In-Reply-To: <20071206153524.GA16916@redhat.com>
Hi,
Now in the -nmw git tree. Thanks,
Steve.
On Thu, 2007-12-06 at 09:35 -0600, David Teigland wrote:
> 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>
> ---
> fs/gfs2/locking/dlm/plock.c | 18 ++++++++++++++----
> 1 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c
> index 1f7b038..2ebd374 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,
> op->info.number = name->ln_number;
> op->info.start = fl->fl_start;
> op->info.end = fl->fl_end;
> - op->info.owner = (__u64)(long) fl->fl_owner;
> 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;
> locks_init_lock(&xop->flc);
> locks_copy_lock(&xop->flc, fl);
> xop->fl = fl;
> xop->file = file;
> - } else
> + } else {
> + op->info.owner = (__u64)(long) fl->fl_owner;
> xop->callback = NULL;
> + }
>
> send_op(op);
>
> @@ -203,7 +207,10 @@ int gdlm_punlock(void *lockspace, struct lm_lockname *name,
> op->info.number = name->ln_number;
> op->info.start = fl->fl_start;
> op->info.end = fl->fl_end;
> - op->info.owner = (__u64)(long) fl->fl_owner;
> + 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;
>
> send_op(op);
> wait_event(recv_wq, (op->done != 0));
> @@ -242,7 +249,10 @@ int gdlm_plock_get(void *lockspace, struct lm_lockname *name,
> op->info.number = name->ln_number;
> op->info.start = fl->fl_start;
> op->info.end = fl->fl_end;
> - op->info.owner = (__u64)(long) fl->fl_owner;
> + 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;
>
> send_op(op);
> wait_event(recv_wq, (op->done != 0));
prev parent reply other threads:[~2007-12-07 13:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-06 15:35 [Cluster-devel] [PATCH] gfs2: use pid for plock owner for nfs clients David Teigland
2007-12-07 13:43 ` Steven Whitehouse [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1197035014.1068.1031.camel@quoit \
--to=swhiteho@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.