All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFSv4: Don't add a new lock on an interrupted wait for LOCK
@ 2017-07-21 17:38 Benjamin Coddington
  2017-08-01 20:12 ` Jeff Layton
  0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Coddington @ 2017-07-21 17:38 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker; +Cc: linux-nfs

If the wait for a LOCK operation is interrupted, and then the file is
closed, the locks cleanup code will assume that no new locks will be added
to the inode after it has completed.  We already have a mechanism to detect
if there was an interrupt, so let's use that to avoid recreating the local
lock once the RPC completes.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
---
 fs/nfs/nfs4proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index dbfa18900e25..5256f429c268 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6100,7 +6100,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
 	case 0:
 		renew_lease(NFS_SERVER(d_inode(data->ctx->dentry)),
 				data->timestamp);
-		if (data->arg.new_lock) {
+		if (data->arg.new_lock && !data->cancelled) {
 			data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
 			if (locks_lock_inode_wait(lsp->ls_state->inode, &data->fl) < 0) {
 				rpc_restart_call_prepare(task);
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-08-23 20:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-21 17:38 [PATCH] NFSv4: Don't add a new lock on an interrupted wait for LOCK Benjamin Coddington
2017-08-01 20:12 ` Jeff Layton
2017-08-02 11:27   ` [PATCH v2] " Benjamin Coddington
2017-08-23 20:11     ` Benjamin Coddington
2017-08-23 20:15       ` Trond Myklebust
2017-08-23 20:25         ` Benjamin Coddington
2017-08-23 20:27           ` Benjamin Coddington

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.