linux-fsdevel.vger.kernel.org archive mirror
 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-cifs@vger.kernel.org, linux-nfs@vger.kernel.org,
	ceph-devel@vger.kernel.org
Subject: Re: [PATCH v2 02/10] locks: have locks_release_file use flock_lock_file to release generic flock locks
Date: Fri, 9 Jan 2015 06:42:57 -0800	[thread overview]
Message-ID: <20150109064257.02f28d85@synchrony.poochiereds.net> (raw)
In-Reply-To: <20150109142723.GA30294@infradead.org>

On Fri, 9 Jan 2015 06:27:23 -0800
Christoph Hellwig <hch@infradead.org> wrote:

> On Thu, Jan 08, 2015 at 10:34:17AM -0800, Jeff Layton wrote:
> > ...instead of open-coding it and removing flock locks directly. This
> > simplifies some coming interim changes in the following patches when
> > we have different file_lock types protected by different spinlocks.
> 
> It took me quite a while to figure out what's going on here, as this
> adds a call to flock_lock_file, but it still keeps the old open coded
> loop around, just with a slightly different WARN_ON.
> 

Right. Eventually that open-coded loop (and the WARN_ON) goes away once
leases get moved into i_flctx in a later patch.

FWIW, there is some messiness involved in this patchset in the interim
stages due to the need to keep things bisectable. Once all of the
patches are applied, the result looks a lot cleaner.

> I'd suggest keeping an open coded loop in locks_remove_flock, which
> should both be more efficient and easier to review.
> 

I don't know. On the one hand, I rather like keeping all of the lock
removal logic in a single spot. On the other hand, we do take and drop
the i_lock/flc_lock more than once with this scheme if there are both
flock locks and leases present at the time of the close. Open coding
the loops would allow us to do that just once.

I'll ponder it a bit more for the next iteration...

Thanks,
-- 
Jeff Layton <jlayton@primarydata.com>

  reply	other threads:[~2015-01-09 14:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 18:34 [PATCH v2 00/10] locks: saner method for managing file locks Jeff Layton
2015-01-08 18:34 ` [PATCH v2 01/10] locks: add new struct list_head to struct file_lock Jeff Layton
2015-01-08 18:34 ` [PATCH v2 02/10] locks: have locks_release_file use flock_lock_file to release generic flock locks Jeff Layton
2015-01-09 14:27   ` Christoph Hellwig
2015-01-09 14:42     ` Jeff Layton [this message]
2015-01-09 14:46       ` Christoph Hellwig
2015-01-08 18:34 ` [PATCH v2 03/10] locks: add a new struct file_locking_context pointer to struct inode Jeff Layton
2015-01-08 18:34 ` [PATCH v2 04/10] locks: move flock locks to file_lock_context Jeff Layton
     [not found]   ` <1420742065-28423-5-git-send-email-jlayton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>
2015-01-09 14:31     ` Christoph Hellwig
2015-01-09 14:47       ` Jeff Layton
2015-01-08 18:34 ` [PATCH v2 05/10] locks: convert posix " Jeff Layton
     [not found] ` <1420742065-28423-1-git-send-email-jlayton-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>
2015-01-08 18:34   ` [PATCH v2 06/10] locks: convert lease handling " Jeff Layton
2015-01-08 18:34   ` [PATCH v2 09/10] locks: clean up the lm_change prototype Jeff Layton
2015-01-08 18:34   ` [PATCH v2 10/10] locks: keep a count of locks on the flctx lists Jeff Layton
2015-01-09 17:21   ` [PATCH v2 00/10] locks: saner method for managing file locks Christoph Hellwig
2015-01-08 18:34 ` [PATCH v2 07/10] locks: remove i_flock field from struct inode Jeff Layton
2015-01-08 18:34 ` [PATCH v2 08/10] locks: add a dedicated spinlock to protect i_flctx lists Jeff Layton

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=20150109064257.02f28d85@synchrony.poochiereds.net \
    --to=jeff.layton@primarydata.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-cifs@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).