Linux NFS development
 help / color / mirror / Atom feed
From: Bryan Schumaker <bjschuma@netapp.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Pavel <free.lan.c2.718r@gmail.com>,
	linux-nfs@vger.kernel.org, "J. Bruce Fields" <bfields@redhat.com>
Subject: Re: clients fail to reclaim locks after server reboot or manual sm-notify
Date: Wed, 16 Nov 2011 12:37:39 -0500	[thread overview]
Message-ID: <4EC3F4E3.7050803@netapp.com> (raw)
In-Reply-To: <20111116153052.GA20545@fieldses.org>

On 11/16/2011 10:30 AM, J. Bruce Fields wrote:
> On Wed, Nov 16, 2011 at 09:25:01AM -0500, Bryan Schumaker wrote:
>> Here is what I'm doing (On debian with 2.6.32):
>> - (On Client) Mount the server: `sudo mount -o vers=3 
>> 192.168.122.202:/home/bjschuma /mnt`
>> - (On Client) Lock a file using nfs-utils/tools/locktest: `./testlk 
>> /mnt/test`
>> - (On Server) Call sm-notify with the server's IP address: `sudo 
>> sm-notify -f -v 192.168.122.202`
>> - dmesg on the client has this message:
>>     lockd: spurious grace period reject?!
>>     lockd: failed to reclaim lock for pid 2099 (errno -37, status 4)
>> - (In wireshark) The client sends a lock request with the "Reclaim" bit 
>> set to "yes" but the server replies with "NLM_DENIED_GRACE_PERIOD".
> 
> That sounds like correct server behavior to me.
> 
> Once the server ends the grace period and starts accepting regular
> non-reclaim locks, there's the chance of a situation like:
> 
> 	client A		client B
> 	--------		--------
> 
> 	acquires lock
> 
> 		---server reboot---
> 		---grace period ends---
> 
> 				acquires conflicting lock
> 				drops conflicting lock
> 
> And if the server permits a reclaim of the original lock from client A,
> then it gives client A the impression that it has held its lock
> continuously over this whole time, when in fact someone else has held a
> conflicting lock.
> 
> So: no non-reclaim locks are allowed outside the grace period.

I see where I was confused.  I thought that running sm-notify also restarted the grace period.

- Bryan

> 
> If you restart the server, and *then* immediately run sm-notify while
> the new nfsd is still in its grace period, I'd expect the reclaim to
> succeed.
> 
> And that may be where the HA setup isn't right--if you're doing
> active/passive failover, then you need to make sure you don't start nfsd
> on the backup machine until just before you send the sm-notify.
> 
> --b.
> 
>>
>> Shouldn't the server be allowing the lock reclaim?  When I tried 
>> yesterday using 3.0 it only triggered DNS packets, I tried again a few 
>> minutes ago and got the same results that I did using .32.


  parent reply	other threads:[~2011-11-16 17:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14 17:11 clients fail to reclaim locks after server reboot or manual sm-notify Pavel
2011-11-14 19:10 ` Bryan Schumaker
2011-11-14 21:55   ` Bryan Schumaker
2011-11-15 15:50     ` Pavel
2011-11-15 17:19       ` Pavel
2011-11-15 21:48       ` Bryan Schumaker
2011-11-15 22:16         ` J. Bruce Fields
2011-11-16 14:25           ` Bryan Schumaker
2011-11-16 14:58             ` Pavel
2011-11-16 15:30             ` J. Bruce Fields
2011-11-16 17:15               ` Pasha Z
2011-11-16 17:28                 ` J. Bruce Fields
2011-11-16 17:37               ` Bryan Schumaker [this message]
2011-11-16 19:09                 ` Pavel A
2011-11-16 20:08                   ` J. Bruce Fields
2011-11-16 20:21                     ` Bryan Schumaker
2011-11-16 21:56                       ` Pavel A

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=4EC3F4E3.7050803@netapp.com \
    --to=bjschuma@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=bfields@redhat.com \
    --cc=free.lan.c2.718r@gmail.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