[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201118002431.GA6941@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com>
Date: Wed, 18 Nov 2020 00:24:31 +0000
From: Anchal Agarwal <anchalag@...zon.com>
To: Trond Myklebust <trond.myklebust@...merspace.com>,
Anna Schumaker <anna.schumaker@...app.com>,
<linux-nfs@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <anchalag@...zon.com>
Subject: [PATCH] NFS: Retry the CLOSE if the embedded GETATTR is rejected
with ERR_STALE
If our CLOSE RPC call is rejected with an ERR_STALE error, then we
should remove the GETATTR call from the compound RPC and retry.
This could happen in a scenario where two clients tries to access
the same file. One client opens the file and the other client removes
the file while it's opened by first client. When the first client
attempts to close the file the server returns ESTALE and the file ends
up being leaked on the server. This depends on how nfs server is
configured and is not reproducible if running against nfsd.
Signed-off-by: Anchal Agarwal <anchalag@...zon.com>
---
fs/nfs/nfs4proc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 9e0ca9b2b210..40e4259bc83e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3548,6 +3548,7 @@ static void nfs4_close_done(struct rpc_task *task, void *data)
res_stateid = &calldata->res.stateid;
renew_lease(server, calldata->timestamp);
break;
+ case -ESTALE:
case -NFS4ERR_ACCESS:
if (calldata->arg.bitmask != NULL) {
calldata->arg.bitmask = NULL;
--
2.16.6
Powered by blists - more mailing lists