All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Jeffery <djeffery@redhat.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH] nfs: Always try and release an NFS file lock, even after receiving a SIGKILL
Date: Tue, 5 Aug 2014 11:17:05 -0400 (EDT)	[thread overview]
Message-ID: <1438879608.14503585.1407251825405.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1136742914.14501494.1407251366067.JavaMail.zimbra@redhat.com>


If a task holding an NFS file lock is killed with SIGKILL, it can
error out of do_unlk without ever trying to release the lock on
the server. This triggers the WARN in locks_remove_file(), while
also leaving the lock still claimed on the NFS server.  The file's
lock state is left out of sync between client and server, requiring
a restart of one or the other in order to release this ghost lock
on the file.

do_unlk() should continue on and tell the server to release the
lock, even if nfs_iocounter_wait() reports an error do to SIGKILL.

Signed-off-by: David Jeffery <djeffery@redhat.com>

---
 file.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 4042ff5..1b09243 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -750,10 +750,8 @@ do_unlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
 
 	l_ctx = nfs_get_lock_context(nfs_file_open_context(filp));
 	if (!IS_ERR(l_ctx)) {
-		status = nfs_iocounter_wait(&l_ctx->io_count);
+		nfs_iocounter_wait(&l_ctx->io_count);
 		nfs_put_lock_context(l_ctx);
-		if (status < 0)
-			return status;
 	}
 
 	/* NOTE: special case

       reply	other threads:[~2014-08-05 15:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1136742914.14501494.1407251366067.JavaMail.zimbra@redhat.com>
2014-08-05 15:17 ` David Jeffery [this message]
2014-08-21  0:28   ` [PATCH] nfs: Always try and release an NFS file lock, even after receiving a SIGKILL Trond Myklebust
2014-08-21 15:40     ` David Jeffery
2014-08-21 15:50       ` Trond Myklebust
2014-08-21 18:15         ` David Jeffery
2014-08-21 18:41           ` Trond Myklebust
2014-08-29 15:34             ` Benjamin Coddington
2014-08-29 15:51               ` Trond Myklebust
2014-08-29 16:31                 ` Benjamin Coddington
2014-08-29 19:02                   ` Trond Myklebust

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=1438879608.14503585.1407251825405.JavaMail.zimbra@redhat.com \
    --to=djeffery@redhat.com \
    --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.