diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-12-01 16:31:34 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-12-01 16:31:34 -0500 |
commit | 4f38e4aadcca319650c0de31edf7193d7c384de2 (patch) | |
tree | b33e902da4078218c7246646aecb50ad6658660a /fs/nfs/nfs4state.c | |
parent | c25573b5134294c0be82bfaecc6d08136835b271 (diff) |
NFSv4: Don't error if we handled it in nfs4_recovery_handle_error
If we handled an error condition, then nfs4_recovery_handle_error should
return '0' so that the state recovery thread can continue.
Also ensure that nfs4_check_lease() continues to abort if we haven't got
any credentials by having it return ENOKEY (which is not handled).
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 39914be40b03..1da95e3947bb 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -1350,12 +1350,14 @@ static void nfs4_warn_keyexpired(const char *s) | |||
1350 | static int nfs4_recovery_handle_error(struct nfs_client *clp, int error) | 1350 | static int nfs4_recovery_handle_error(struct nfs_client *clp, int error) |
1351 | { | 1351 | { |
1352 | switch (error) { | 1352 | switch (error) { |
1353 | case 0: | ||
1354 | break; | ||
1353 | case -NFS4ERR_CB_PATH_DOWN: | 1355 | case -NFS4ERR_CB_PATH_DOWN: |
1354 | nfs_handle_cb_pathdown(clp); | 1356 | nfs_handle_cb_pathdown(clp); |
1355 | return 0; | 1357 | break; |
1356 | case -NFS4ERR_NO_GRACE: | 1358 | case -NFS4ERR_NO_GRACE: |
1357 | nfs4_state_end_reclaim_reboot(clp); | 1359 | nfs4_state_end_reclaim_reboot(clp); |
1358 | return 0; | 1360 | break; |
1359 | case -NFS4ERR_STALE_CLIENTID: | 1361 | case -NFS4ERR_STALE_CLIENTID: |
1360 | case -NFS4ERR_LEASE_MOVED: | 1362 | case -NFS4ERR_LEASE_MOVED: |
1361 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); | 1363 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); |
@@ -1375,13 +1377,15 @@ static int nfs4_recovery_handle_error(struct nfs_client *clp, int error) | |||
1375 | case -NFS4ERR_SEQ_MISORDERED: | 1377 | case -NFS4ERR_SEQ_MISORDERED: |
1376 | set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); | 1378 | set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); |
1377 | /* Zero session reset errors */ | 1379 | /* Zero session reset errors */ |
1378 | return 0; | 1380 | break; |
1379 | case -EKEYEXPIRED: | 1381 | case -EKEYEXPIRED: |
1380 | /* Nothing we can do */ | 1382 | /* Nothing we can do */ |
1381 | nfs4_warn_keyexpired(clp->cl_hostname); | 1383 | nfs4_warn_keyexpired(clp->cl_hostname); |
1382 | return 0; | 1384 | break; |
1385 | default: | ||
1386 | return error; | ||
1383 | } | 1387 | } |
1384 | return error; | 1388 | return 0; |
1385 | } | 1389 | } |
1386 | 1390 | ||
1387 | static int nfs4_do_reclaim(struct nfs_client *clp, const struct nfs4_state_recovery_ops *ops) | 1391 | static int nfs4_do_reclaim(struct nfs_client *clp, const struct nfs4_state_recovery_ops *ops) |
@@ -1428,7 +1432,7 @@ static int nfs4_check_lease(struct nfs_client *clp) | |||
1428 | struct rpc_cred *cred; | 1432 | struct rpc_cred *cred; |
1429 | const struct nfs4_state_maintenance_ops *ops = | 1433 | const struct nfs4_state_maintenance_ops *ops = |
1430 | clp->cl_mvops->state_renewal_ops; | 1434 | clp->cl_mvops->state_renewal_ops; |
1431 | int status = -NFS4ERR_EXPIRED; | 1435 | int status; |
1432 | 1436 | ||
1433 | /* Is the client already known to have an expired lease? */ | 1437 | /* Is the client already known to have an expired lease? */ |
1434 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) | 1438 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) |
@@ -1438,6 +1442,7 @@ static int nfs4_check_lease(struct nfs_client *clp) | |||
1438 | spin_unlock(&clp->cl_lock); | 1442 | spin_unlock(&clp->cl_lock); |
1439 | if (cred == NULL) { | 1443 | if (cred == NULL) { |
1440 | cred = nfs4_get_setclientid_cred(clp); | 1444 | cred = nfs4_get_setclientid_cred(clp); |
1445 | status = -ENOKEY; | ||
1441 | if (cred == NULL) | 1446 | if (cred == NULL) |
1442 | goto out; | 1447 | goto out; |
1443 | } | 1448 | } |
@@ -1662,10 +1667,10 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1662 | 1667 | ||
1663 | if (test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) { | 1668 | if (test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) { |
1664 | status = nfs4_check_lease(clp); | 1669 | status = nfs4_check_lease(clp); |
1670 | if (status < 0) | ||
1671 | goto out_error; | ||
1665 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) | 1672 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) |
1666 | continue; | 1673 | continue; |
1667 | if (status < 0 && status != -NFS4ERR_CB_PATH_DOWN) | ||
1668 | goto out_error; | ||
1669 | } | 1674 | } |
1670 | 1675 | ||
1671 | /* Initialize or reset the session */ | 1676 | /* Initialize or reset the session */ |