Skip to content

Commit 8aafd2f

Browse files
trondmyamschuma-ntap
authored andcommitted
NFSv4: Don't busy wait if NFSv4 session draining is interrupted
Catch the ERESTARTSYS error so that it can be processed by the callers. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent e4648aa commit 8aafd2f

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

fs/nfs/nfs4state.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static int nfs4_drain_slot_tbl(struct nfs4_slot_table *tbl)
274274
static int nfs4_begin_drain_session(struct nfs_client *clp)
275275
{
276276
struct nfs4_session *ses = clp->cl_session;
277-
int ret = 0;
277+
int ret;
278278

279279
if (clp->cl_slot_tbl)
280280
return nfs4_drain_slot_tbl(clp->cl_slot_tbl);
@@ -1958,7 +1958,9 @@ static int nfs4_establish_lease(struct nfs_client *clp)
19581958
clp->cl_mvops->reboot_recovery_ops;
19591959
int status;
19601960

1961-
nfs4_begin_drain_session(clp);
1961+
status = nfs4_begin_drain_session(clp);
1962+
if (status != 0)
1963+
return status;
19621964
cred = nfs4_get_clid_cred(clp);
19631965
if (cred == NULL)
19641966
return -ENOENT;
@@ -2046,7 +2048,9 @@ static int nfs4_try_migration(struct nfs_server *server, struct rpc_cred *cred)
20462048
goto out;
20472049
}
20482050

2049-
nfs4_begin_drain_session(clp);
2051+
status = nfs4_begin_drain_session(clp);
2052+
if (status != 0)
2053+
return status;
20502054

20512055
status = nfs4_replace_transport(server, locations);
20522056
if (status != 0) {
@@ -2396,7 +2400,9 @@ static int nfs4_reset_session(struct nfs_client *clp)
23962400

23972401
if (!nfs4_has_session(clp))
23982402
return 0;
2399-
nfs4_begin_drain_session(clp);
2403+
status = nfs4_begin_drain_session(clp);
2404+
if (status != 0)
2405+
return status;
24002406
cred = nfs4_get_clid_cred(clp);
24012407
status = nfs4_proc_destroy_session(clp->cl_session, cred);
24022408
switch (status) {
@@ -2439,7 +2445,9 @@ static int nfs4_bind_conn_to_session(struct nfs_client *clp)
24392445

24402446
if (!nfs4_has_session(clp))
24412447
return 0;
2442-
nfs4_begin_drain_session(clp);
2448+
ret = nfs4_begin_drain_session(clp);
2449+
if (ret != 0)
2450+
return ret;
24432451
cred = nfs4_get_clid_cred(clp);
24442452
ret = nfs4_proc_bind_conn_to_session(clp, cred);
24452453
if (cred)

0 commit comments

Comments
 (0)