All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jeff.layton@primarydata.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Christoph Hellwig <hch@lst.de>,
	Dave Chinner <david@fromorbit.com>,
	Sasha Levin <sasha.levin@oracle.com>
Subject: [PATCH 4/4] locks: only remove leases associated with the file being closed
Date: Tue, 17 Feb 2015 07:46:30 -0500	[thread overview]
Message-ID: <1424177190-14252-5-git-send-email-jeff.layton@primarydata.com> (raw)
In-Reply-To: <1424177190-14252-1-git-send-email-jeff.layton@primarydata.com>

We don't want to remove all leases just because one filp was closed.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
---
 fs/locks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/locks.c b/fs/locks.c
index 59eadd416b8c..c748176fde6a 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2437,7 +2437,8 @@ locks_remove_lease(struct file *filp)
 
 	spin_lock(&ctx->flc_lock);
 	list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list)
-		lease_modify(fl, F_UNLCK, &dispose);
+		if (filp == fl->fl_file)
+			lease_modify(fl, F_UNLCK, &dispose);
 	spin_unlock(&ctx->flc_lock);
 	locks_dispose_list(&dispose);
 }
-- 
2.1.0


  parent reply	other threads:[~2015-02-17 12:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-17 12:46 [PATCH 0/4] locks: flock and lease related bugfixes, and remove i_flctx counters Jeff Layton
2015-02-17 12:46 ` [PATCH 1/4] Revert "locks: keep a count of locks on the flctx lists" Jeff Layton
2015-02-17 12:46 ` [PATCH 2/4] locks: remove conditional lock release in middle of flock_lock_file Jeff Layton
2015-02-17 17:10   ` J. Bruce Fields
2015-02-17 17:56     ` Jeff Layton
2015-02-17 19:11       ` J. Bruce Fields
2015-02-17 22:21         ` J. Bruce Fields
2015-02-17 22:29           ` Jeff Layton
2015-02-17 12:46 ` [PATCH 3/4] locks: when upgrading, don't remove old flock lock until replacing with new one Jeff Layton
2015-02-17 12:46 ` Jeff Layton [this message]
2015-02-17 19:55 ` [PATCH 0/4] locks: flock and lease related bugfixes, and remove i_flctx counters Linus Torvalds
2015-02-17 20:20   ` Linus Torvalds
2015-02-17 20:20   ` Al Viro
2015-02-17 21:10     ` 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=1424177190-14252-5-git-send-email-jeff.layton@primarydata.com \
    --to=jeff.layton@primarydata.com \
    --cc=bfields@fieldses.org \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=kirill@shutemov.name \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sasha.levin@oracle.com \
    --cc=torvalds@linux-foundation.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.