From: David Teigland <teigland@redhat.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-fsdevel@vger.kernel.org, nfs@lists.sourceforge.net,
Marc Eshel <eshel@almaden.ibm.com>
Subject: Re: [PATCH 10/10] gfs2: nfs lock support for gfs2
Date: Wed, 6 Dec 2006 14:58:22 -0600 [thread overview]
Message-ID: <20061206205822.GB25322@redhat.com> (raw)
In-Reply-To: <20061206195722.GH1714@fieldses.org>
On Wed, Dec 06, 2006 at 02:57:22PM -0500, J. Bruce Fields wrote:
> On Wed, Dec 06, 2006 at 09:49:51AM -0600, David Teigland wrote:
> > The gfs side looks fine to me. Did you forget to call fl_notify from
> > gdlm_plock_callback() or am I missing something?
>
> Yes, looks like we missed something, thanks. This code's an rfc (not
> even tested), so don't apply it yet! What we should have there is
> something like:
>
> rv = op->info.rv;
>
> if (fl_notify(fl, NULL, rv)) {
> /* XXX: We need to cancel the lock here: */
> printk("gfs2 lock granted after lock request failed; dangling lock!\n");
> }
>
> if (!rv) {
> /* check if the following are still valid or make a copy */
> file = op->info.file;
> fl = op->info.fl;
>
> if (posix_lock_file_wait(file, fl) < 0)
> log_error("gdlm_plock: vfs lock error file %p fl %p",
> file, fl);
> }
>
> Note there's a race condition--that calls fl_notify before actually
> getting the lock locally. I don't *think* that's a problem, as long as
> it's the filesystem and not the local lock list that's authoritative
> when it comes to who gets a posix lock.
agree
> The more annoying problem is the need to cancel the GFS lock when
> fl_notify fails; is that something that it's possible for GFS to do?
>
> It can fail because lockd has a timeout--it waits a few seconds for the
> callback, then gives up and returns a failure to the user. If that
> happens after your userspace posix lock manager acquires the lock (but
> before fl_notify is called) then you've got to cancel it somehow.
I'd think we could just send an unlock for it at that point. Set up an op
with GDLM_PLOCK_OP_UNLOCK and the same fields as the lock you're removing
and call send_op(). We probably need to flag this internal-unlock op so
that when the result arrives, device_write() delists and frees it itself.
(I wouldn't call this "canceling", I think of cancel as trying to force a
blocked request to return/fail prematurely.)
Dave
next prev parent reply other threads:[~2006-12-06 20:58 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-06 5:34 asynchronous locks for cluster exports J. Bruce Fields
2006-12-06 5:34 ` [PATCH 1/10] lockd: add new export operation for nfsv4/lockd locking J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-09 5:53 ` Wendy Cheng
2006-12-10 18:31 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 2/10] nfsd4: Convert NFSv4 to new lock interface J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 3/10] lockd: request deferral routine J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 4/10] locks: add fl_notify arguments J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 5/10] lockd: handle fl_notify callbacks J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 6/10] lockd: pass cookie in nlmsvc_testlock J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 7/10] lockd: handle test_lock deferrals J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 8/10] lockd: always preallocate block in nlmsvc_lock() J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 9/10] lockd: add code to handle deferred lock requests J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 5:34 ` [PATCH 10/10] gfs2: nfs lock support for gfs2 J. Bruce Fields
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 6:00 ` [NFS] " Wendy Cheng
2006-12-06 13:26 ` Wendy Cheng
2006-12-06 5:34 ` J. Bruce Fields
2006-12-06 12:02 ` [Cluster-devel] " Steven Whitehouse
2006-12-06 12:02 ` Steven Whitehouse
2006-12-06 15:49 ` David Teigland
2006-12-06 19:57 ` J. Bruce Fields
2006-12-06 20:08 ` [NFS] " J. Bruce Fields
2006-12-06 20:58 ` David Teigland [this message]
2006-12-06 21:23 ` J. Bruce Fields
2006-12-06 21:42 ` David Teigland
2006-12-06 22:00 ` [NFS] " J. Bruce Fields
2006-12-07 15:30 ` David Teigland
2006-12-08 17:35 ` [NFS] " J. Bruce Fields
2006-12-07 6:47 ` Marc Eshel
2006-12-07 15:23 ` J. Bruce Fields
2006-12-07 15:43 ` [NFS] " Marc Eshel
2006-12-07 16:21 ` J. Bruce Fields
2006-12-07 18:52 ` [NFS] " Trond Myklebust
2006-12-14 23:04 ` [PATCH 1/10] lockd: add new export operation for nfsv4/lockd locking J. Bruce Fields
2006-12-15 5:52 ` Marc Eshel
2006-12-15 7:40 ` Christoph Hellwig
2006-12-07 16:51 ` asynchronous locks for cluster exports Christoph Hellwig
2006-12-14 22:51 ` J. Bruce Fields
2006-12-15 19:51 ` J. Bruce Fields
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=20061206205822.GB25322@redhat.com \
--to=teigland@redhat.com \
--cc=bfields@fieldses.org \
--cc=eshel@almaden.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=nfs@lists.sourceforge.net \
/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.