All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
To: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: cifs client lease logic
Date: Fri, 8 Jul 2011 17:45:41 -0400	[thread overview]
Message-ID: <20110708214541.GF13886@fieldses.org> (raw)

I was just looking at the cifs client lease code, and I think there's a
problem:

Leases can be broken at any time, but all that does is notify the
lease-holder.  They shouldn't be removed until the lease holder gets a
chance to do whatever cleanup they need to do and issues an F_UNLCK.
(Or until a tiemout expires and we give up on the lease holder.)

(NFSv4 delegations and oplocks work the same way, as I understand it, in
the sense that delegations and oplocks have to be explicitly given up by
whoever holds them (or until there's a timeout).)

But it looks like F_UNLCK is a no-op for the cifs client.  Without
understanding the code at all, it looks to me like cifs is doing
whatever it normally does on losing an oplock--flushing out dirty pages,
etc.--and is sending a lease break notification, but isn't waiting on
the application that holds the lease to give the lease up.

Note that calling break_lease on its own doesn't wait for that, it
*only* notifies the lease holder of the break.

Am I missing something?

--b.

             reply	other threads:[~2011-07-08 21:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-08 21:45 J. Bruce Fields [this message]
     [not found] ` <20110708214541.GF13886-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2011-07-08 21:57   ` cifs client lease logic 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=20110708214541.GF13886@fieldses.org \
    --to=bfields-uc3wqj2krung9huczpvpmw@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 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.