mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juan Gomez <juang@us.ibm.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: linux-kernel@vger.kernel.org, nfs@lists.sourceforge.net
Subject: Re: Non-blocking lock requests during the grace period
Date: Fri, 15 Nov 2002 08:31:28 -0800	[thread overview]
Message-ID: <OF92154664.1C5EF07E-ON87256C72.005A0481@us.ibm.com> (raw)

                                                                                                               
                                                                                                               
                                                                                                               


Trond,

I think this would fix it but the patch I have tested locally is a bit
different.

1).-Instead of

+wait_on_grace:
+                        if (!argp->block)
+                                    return -EAGAIN;

I have

+wait_on_grace:
+                        if ((proc == NLMPROC_LOCK) && !argp->block)
+                                    return -EAGAIN;

2.-I also have this part enclosed in the if(resp->status ==
NLM_LCK_DENIED_GRACE_PERIOD) as follows:

if(resp->status == NLM_LCK_DENIED_GRACE_PERIOD) {

      blah blah...

wait_on_grace:
                         if ((proc == NLMPROC_LOCK) && !argp->block)
                                     return -EAGAIN
} else {

      ....
}

This with the intention to be very specific as to when we want the return
-EAGAIN to be called.

Juan



|---------+---------------------------->
|         |           Trond Myklebust  |
|         |           <trond.myklebust@|
|         |           fys.uio.no>      |
|         |                            |
|         |           11/14/02 06:33 PM|
|         |                            |
|---------+---------------------------->
  >-------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                         |
  |       To:       Juan Gomez/Almaden/IBM@IBMUS                                                                            |
  |       cc:       nfs@lists.sourceforge.net, linux-kernel@vger.kernel.org                                                 |
  |       Subject:  Re: Non-blocking lock requests during the grace period                                                  |
  |                                                                                                                         |
  |                                                                                                                         |
  >-------------------------------------------------------------------------------------------------------------------------|



>>>>> " " == Juan Gomez <juang@us.ibm.com> writes:

     > I found out that the current Linux client of lockd blocks
     > non-blocking lock requests while the server is in the grace
     > period.  I think this is incorrect behavior and I am wondering
     > if the will exists out there to correct this and return
     > "resource not available" to the process when a request is for a
     > *non-blocking* lock while the server is in the grace period.

Would the following fix it?

Cheers,
  Trond

--- linux-2.5.47/fs/lockd/clntproc.c.orig        2002-09-29
10:15:13.000000000 -0400
+++ linux-2.5.47/fs/lockd/clntproc.c             2002-11-14
21:32:26.000000000 -0500
@@ -256,10 +256,8 @@
                         msg.rpc_cred = NULL;

             do {
-                        if (host->h_reclaiming && !argp->reclaim) {
-
interruptible_sleep_on(&host->h_gracewait);
-                                    continue;
-                        }
+                        if (host->h_reclaiming && !argp->reclaim)
+                                    goto wait_on_grace;

                         /* If we have no RPC client yet, create one. */
                         if ((clnt = nlm_bind_host(host)) == NULL)
@@ -296,6 +294,9 @@
                                     dprintk("lockd: server returns status
%d\n", resp->status);
                                     return 0;         /* Okay, call
complete */
                         }
+wait_on_grace:
+                        if (!argp->block)
+                                    return -EAGAIN;

                         /* Back off a little and try again */
                         interruptible_sleep_on_timeout(&host->h_gracewait,
15*HZ);




             reply	other threads:[~2002-11-15 16:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-15 16:31 Juan Gomez [this message]
2002-11-15 17:35 ` Trond Myklebust
  -- strict thread matches above, loose matches on Subject: below --
2002-11-15 19:09 Juan Gomez
2002-11-15 20:01 ` Trond Myklebust
2002-11-15 18:48 Juan Gomez
2002-11-14 19:56 Juan Gomez
2002-11-15  2:33 ` Trond Myklebust

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=OF92154664.1C5EF07E-ON87256C72.005A0481@us.ibm.com \
    --to=juang@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    --cc=trond.myklebust@fys.uio.no \
    /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

all inboxes | Powered by JetHome®