public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* lockd and lock cancellation
@ 2010-04-09 19:40 David Teigland
  2010-04-09 20:25 ` Chuck Lever
  0 siblings, 1 reply; 8+ messages in thread
From: David Teigland @ 2010-04-09 19:40 UTC (permalink / raw)
  To: linux-nfs

Here's what I think was the first time we discussed cancelation and
Bruce's provisional locks: http://marc.info/?t=116538335700005&r=1&w=2
I'm still skeptical of trying to handle cancels, it seems too complex to
become reliable in the lifetime of nfs3.

What I would be interested to see fixed is this oops that's not difficult
to trigger by doing lock/unlock loops on a client:
https://bugzilla.redhat.com/show_bug.cgi?id=502977#c18

But, for all the kernel work on these nfs/gfs/dlm hooks, there's a larger
issue that no one is working on AFAIK:  the mechanisms for recovering
client locks on remaining gfs nodes when one gfs node fails.  That would
take a lot of work, and until it's done all the kernel apis will be a moot
point since clustered nfs locks on gfs will be unusable.

Dave


^ permalink raw reply	[flat|nested] 8+ messages in thread
* lockd and lock cancellation
@ 2010-04-01 12:16 Steven Whitehouse
  2010-04-01 12:40 ` Rob Gardner
  0 siblings, 1 reply; 8+ messages in thread
From: Steven Whitehouse @ 2010-04-01 12:16 UTC (permalink / raw)
  To: linux-nfs; +Cc: eshel

Hi,

I'm trying to find my way around the lockd code and I'm currently a bit
stumped by the code relating to lock cancellation. There is only one
call to vfs_cancel_lock() in lockd/svclock.c and its return value isn't
checked.

It is used in combination with nlmsvc_unlink_block() which
unconditionally calls posix_unblock_lock(). There are also other places
where the code also calls nlmsvc_unlink_block() without first canceling
the lock. The way in which vfs_cancel_lock() is used suggests that
canceling a lock is a synchronous operation, and that it must succeed
before returning.

I'd have expected to see (pseudo code) something more like the
following:

ret = vfs_cancel_lock();
if (ret == -ENOENT) /* never had the lock in the first place */
    do_something_appropriate();
else if (ret == -EINVAL) /* we raced with a grant */
    unlock_lock();
else /* lock successfully canceled */
    nlmsvc_unlink_block();

Is there a reason why that is not required? and indeed, is there a
reason why its safe to call nlmsvc_unlink_block() in the cases where the
lock isn't canceled first? I'm trying to work out how the underlying fs
can tell that a lock has gone away in those particular cases,

Steve.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-04-09 20:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-09 19:40 lockd and lock cancellation David Teigland
2010-04-09 20:25 ` Chuck Lever
2010-04-09 20:50   ` David Teigland
  -- strict thread matches above, loose matches on Subject: below --
2010-04-01 12:16 Steven Whitehouse
2010-04-01 12:40 ` Rob Gardner
2010-04-01 13:13   ` Steven Whitehouse
2010-04-01 14:07     ` Rob Gardner
2010-04-01 15:56       ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox