From: Miklos Szeredi <mszeredi@suse.cz>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Frank van Maarseveen <frankvm@frankvm.com>,
Linux NFS mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [NLM] 2.6.27 broken
Date: Thu, 05 Feb 2009 11:47:09 +0100 [thread overview]
Message-ID: <1233830829.4965.56.camel@tucsk> (raw)
In-Reply-To: <20090204233348.GD20917@fieldses.org>
On Wed, 2009-02-04 at 18:33 -0500, J. Bruce Fields wrote:
> On Tue, Dec 16, 2008 at 03:16:10PM -0500, bfields wrote:
> > On Tue, Dec 16, 2008 at 08:43:52PM +0100, Miklos Szeredi wrote:
> > > On Tue, 2008-12-16 at 12:39 -0500, J. Bruce Fields wrote:
> > > > More precisely, it looks like this started with
> > > >
> > > > bde74e4bc64415b142e "locks: add special return value for
> > > > asynchronous locks"
> > > >
> > > > But I haven't had the chance to look any harder yet. Miklos? Is this
> > > > easy for you to reproduce?
> > >
> > > Not immediately, at the moment I don't have NFS set up. But if you
> > > don't beat me to it, I'll look into this.
> >
> > OK, thanks. I'll take another look too when I get the chance, so let me
> > know of any partial result.
> >
> > It may just for example be returning the wrong error to the client on an
> > nlm blocking lock request, so that the client assumes the lock is gone
> > and goes away rather than waiting for a grant request.
>
> Sorry, I've gotten a bit backlogged, but I finally got back to this. If
> there's no objections, the following is what I intend to submit.
OK (though I don't really understand why we make a lock request to the
VFS _at all_ if we know the lock is already queued???).
But I think at least a comment in the code would be in order, or this
same mistake might be made again. Also I think the original code flow
is somewhat illogical.
How about this (it's essentially the same patch just a bit rearranged,
the authorship is still yours of course ;)
Thanks,
Miklos
Index: linux-2.6/fs/lockd/svclock.c
===================================================================
--- linux-2.6.orig/fs/lockd/svclock.c 2009-01-26 14:47:48.000000000 +0100
+++ linux-2.6/fs/lockd/svclock.c 2009-02-05 11:42:20.000000000 +0100
@@ -426,6 +426,13 @@ nlmsvc_lock(struct svc_rqst *rqstp, stru
ret = nlm_granted;
goto out;
case -EAGAIN:
+ /*
+ * If this is a blocking request for an
+ * already pending lock request then we need
+ * to put it back on lockd's block list
+ */
+ if (wait)
+ break;
ret = nlm_lck_denied;
goto out;
case FILE_LOCK_DEFERRED:
next prev parent reply other threads:[~2009-02-05 10:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-15 13:28 [NLM] 2.6.27 broken Frank van Maarseveen
2008-11-20 22:27 ` J. Bruce Fields
2008-11-28 11:24 ` Frank van Maarseveen
2008-12-16 17:39 ` J. Bruce Fields
2008-12-16 19:43 ` Miklos Szeredi
2008-12-16 20:16 ` J. Bruce Fields
2009-02-04 23:33 ` J. Bruce Fields
2009-02-05 10:21 ` Frank van Maarseveen
2009-02-05 19:52 ` J. Bruce Fields
2009-02-05 10:47 ` Miklos Szeredi [this message]
2009-02-05 19:52 ` J. Bruce Fields
2009-02-06 11:29 ` Miklos Szeredi
2009-02-09 18:10 ` J. Bruce Fields
2009-02-09 20:18 ` Miklos Szeredi
2009-02-09 20: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=1233830829.4965.56.camel@tucsk \
--to=mszeredi@suse.cz \
--cc=bfields@fieldses.org \
--cc=frankvm@frankvm.com \
--cc=linux-nfs@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox