All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jeff.layton@primarydata.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH 0/5] locks: move most locks_release_private calls outside of i_lock
Date: Tue, 12 Aug 2014 12:21:16 -0400	[thread overview]
Message-ID: <20140812122116.5e047c3d@tlielax.poochiereds.net> (raw)
In-Reply-To: <20140812153229.GA15922@infradead.org>

On Tue, 12 Aug 2014 08:32:29 -0700
Christoph Hellwig <hch@infradead.org> wrote:

> Btw, I might be missing something here, but wouldn't it be better
> to reference count the file_lock structure and grab a reference to
> it where we currently call (__)locks_copy_lock?
> 

It's not really possible with the way this code works at the moment.
The problem there is that struct file_lock can represent any of:

- a lock request (copied from userland into a kernel structure)
- a lock record (that lives on the i_flock list)
- a conflicting lock record (returned by GETLK-type request)

In many cases we call (__)locks_copy_lock to copy from one "use-type" of
struct file_lock to another, and doing that with refcounts makes that a
bit difficult to manage.

If I were designing this code from scratch, I'd have probably made each
use-type a distinct structure. Maybe we should do that anyway at
some point -- I'm not sure.

Now, all that said...I think we will end up needing to do some sort of
refcounting to fix the leasing code at some point. Currently,
->setlease operations can't block, which is a significant impediment to
adding leases to clustered filesystems and the like. It would be nice
to lift that limitation and that may require making leases be
refcounted (or maybe RCU-managed).

-- 
Jeff Layton <jlayton@primarydata.com>

  reply	other threads:[~2014-08-12 16:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12 14:48 [PATCH 0/5] locks: move most locks_release_private calls outside of i_lock Jeff Layton
2014-08-12 14:48 ` [PATCH 1/5] locks: don't call locks_release_private from locks_copy_lock Jeff Layton
2014-08-12 14:48 ` [PATCH 2/5] locks: don't reuse file_lock in __posix_lock_file Jeff Layton
2014-08-12 14:48 ` [PATCH 3/5] locks: defer freeing locks in locks_delete_lock until after i_lock has been dropped Jeff Layton
2014-08-12 14:48 ` [PATCH 4/5] locks: move locks_free_lock calls in do_fcntl_add_lease outside spinlock Jeff Layton
2014-08-12 14:48 ` [PATCH 5/5] locks: update Locking documentation to clarify fl_release_private behavior Jeff Layton
2014-08-12 15:32 ` [PATCH 0/5] locks: move most locks_release_private calls outside of i_lock Christoph Hellwig
2014-08-12 16:21   ` Jeff Layton [this message]
2014-08-12 17:43 ` Jeff Layton
2014-08-12 17:43   ` Jeff Layton
2014-08-12 17:53   ` J. Bruce Fields
2014-08-12 17:53     ` J. Bruce Fields
2014-08-12 22:28 ` Stephen Rothwell
2014-08-12 23:47   ` Jeff Layton
2014-08-12 23:47     ` Jeff Layton
2014-08-13  2:09     ` Stephen Rothwell
2014-08-13 15: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=20140812122116.5e047c3d@tlielax.poochiereds.net \
    --to=jeff.layton@primarydata.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.