diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-28 15:12:27 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-28 17:21:57 -0400 |
commit | cc0a98436820b161b595b8cc1d2329bcf7328107 (patch) | |
tree | 6ba95165311342c7f7030759dd972926ea94b7e9 /fs | |
parent | fb13bfa7e1bcfdcfdece47c24b62f1a1cad957e9 (diff) |
NFSv4: Add debugging printks to state manager
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4state.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index dfedde6f2a71..c679b9ecef63 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -1108,6 +1108,8 @@ void nfs4_schedule_lease_recovery(struct nfs_client *clp) | |||
1108 | return; | 1108 | return; |
1109 | if (!test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) | 1109 | if (!test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) |
1110 | set_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state); | 1110 | set_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state); |
1111 | dprintk("%s: scheduling lease recovery for server %s\n", __func__, | ||
1112 | clp->cl_hostname); | ||
1111 | nfs4_schedule_state_manager(clp); | 1113 | nfs4_schedule_state_manager(clp); |
1112 | } | 1114 | } |
1113 | EXPORT_SYMBOL_GPL(nfs4_schedule_lease_recovery); | 1115 | EXPORT_SYMBOL_GPL(nfs4_schedule_lease_recovery); |
@@ -1124,6 +1126,8 @@ static void nfs40_handle_cb_pathdown(struct nfs_client *clp) | |||
1124 | { | 1126 | { |
1125 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); | 1127 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); |
1126 | nfs_expire_all_delegations(clp); | 1128 | nfs_expire_all_delegations(clp); |
1129 | dprintk("%s: handling CB_PATHDOWN recovery for server %s\n", __func__, | ||
1130 | clp->cl_hostname); | ||
1127 | } | 1131 | } |
1128 | 1132 | ||
1129 | void nfs4_schedule_path_down_recovery(struct nfs_client *clp) | 1133 | void nfs4_schedule_path_down_recovery(struct nfs_client *clp) |
@@ -1160,6 +1164,8 @@ void nfs4_schedule_stateid_recovery(const struct nfs_server *server, struct nfs4 | |||
1160 | struct nfs_client *clp = server->nfs_client; | 1164 | struct nfs_client *clp = server->nfs_client; |
1161 | 1165 | ||
1162 | nfs4_state_mark_reclaim_nograce(clp, state); | 1166 | nfs4_state_mark_reclaim_nograce(clp, state); |
1167 | dprintk("%s: scheduling stateid recovery for server %s\n", __func__, | ||
1168 | clp->cl_hostname); | ||
1163 | nfs4_schedule_state_manager(clp); | 1169 | nfs4_schedule_state_manager(clp); |
1164 | } | 1170 | } |
1165 | EXPORT_SYMBOL_GPL(nfs4_schedule_stateid_recovery); | 1171 | EXPORT_SYMBOL_GPL(nfs4_schedule_stateid_recovery); |
@@ -1506,8 +1512,12 @@ static int nfs4_recovery_handle_error(struct nfs_client *clp, int error) | |||
1506 | nfs4_warn_keyexpired(clp->cl_hostname); | 1512 | nfs4_warn_keyexpired(clp->cl_hostname); |
1507 | break; | 1513 | break; |
1508 | default: | 1514 | default: |
1515 | dprintk("%s: failed to handle error %d for server %s\n", | ||
1516 | __func__, error, clp->cl_hostname); | ||
1509 | return error; | 1517 | return error; |
1510 | } | 1518 | } |
1519 | dprintk("%s: handled error %d for server %s\n", __func__, error, | ||
1520 | clp->cl_hostname); | ||
1511 | return 0; | 1521 | return 0; |
1512 | } | 1522 | } |
1513 | 1523 | ||
@@ -1605,15 +1615,21 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status) | |||
1605 | case -NFS4ERR_MINOR_VERS_MISMATCH: | 1615 | case -NFS4ERR_MINOR_VERS_MISMATCH: |
1606 | if (clp->cl_cons_state == NFS_CS_SESSION_INITING) | 1616 | if (clp->cl_cons_state == NFS_CS_SESSION_INITING) |
1607 | nfs_mark_client_ready(clp, -EPROTONOSUPPORT); | 1617 | nfs_mark_client_ready(clp, -EPROTONOSUPPORT); |
1618 | dprintk("%s: exit with error %d for server %s\n", | ||
1619 | __func__, -EPROTONOSUPPORT, clp->cl_hostname); | ||
1608 | return -EPROTONOSUPPORT; | 1620 | return -EPROTONOSUPPORT; |
1609 | case -EKEYEXPIRED: | 1621 | case -EKEYEXPIRED: |
1610 | nfs4_warn_keyexpired(clp->cl_hostname); | 1622 | nfs4_warn_keyexpired(clp->cl_hostname); |
1611 | case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery | 1623 | case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery |
1612 | * in nfs4_exchange_id */ | 1624 | * in nfs4_exchange_id */ |
1613 | default: | 1625 | default: |
1626 | dprintk("%s: exit with error %d for server %s\n", __func__, | ||
1627 | status, clp->cl_hostname); | ||
1614 | return status; | 1628 | return status; |
1615 | } | 1629 | } |
1616 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); | 1630 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); |
1631 | dprintk("%s: handled error %d for server %s\n", __func__, status, | ||
1632 | clp->cl_hostname); | ||
1617 | return 0; | 1633 | return 0; |
1618 | } | 1634 | } |
1619 | 1635 | ||
@@ -1653,6 +1669,8 @@ EXPORT_SYMBOL_GPL(nfs4_schedule_session_recovery); | |||
1653 | void nfs41_handle_recall_slot(struct nfs_client *clp) | 1669 | void nfs41_handle_recall_slot(struct nfs_client *clp) |
1654 | { | 1670 | { |
1655 | set_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state); | 1671 | set_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state); |
1672 | dprintk("%s: scheduling slot recall for server %s\n", __func__, | ||
1673 | clp->cl_hostname); | ||
1656 | nfs4_schedule_state_manager(clp); | 1674 | nfs4_schedule_state_manager(clp); |
1657 | } | 1675 | } |
1658 | 1676 | ||
@@ -1662,6 +1680,8 @@ static void nfs4_reset_all_state(struct nfs_client *clp) | |||
1662 | set_bit(NFS4CLNT_PURGE_STATE, &clp->cl_state); | 1680 | set_bit(NFS4CLNT_PURGE_STATE, &clp->cl_state); |
1663 | clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); | 1681 | clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); |
1664 | nfs4_state_start_reclaim_nograce(clp); | 1682 | nfs4_state_start_reclaim_nograce(clp); |
1683 | dprintk("%s: scheduling reset of all state for server %s!\n", | ||
1684 | __func__, clp->cl_hostname); | ||
1665 | nfs4_schedule_state_manager(clp); | 1685 | nfs4_schedule_state_manager(clp); |
1666 | } | 1686 | } |
1667 | } | 1687 | } |
@@ -1670,6 +1690,8 @@ static void nfs41_handle_server_reboot(struct nfs_client *clp) | |||
1670 | { | 1690 | { |
1671 | if (test_and_set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) == 0) { | 1691 | if (test_and_set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) == 0) { |
1672 | nfs4_state_start_reclaim_reboot(clp); | 1692 | nfs4_state_start_reclaim_reboot(clp); |
1693 | dprintk("%s: server %s rebooted!\n", __func__, | ||
1694 | clp->cl_hostname); | ||
1673 | nfs4_schedule_state_manager(clp); | 1695 | nfs4_schedule_state_manager(clp); |
1674 | } | 1696 | } |
1675 | } | 1697 | } |
@@ -1677,12 +1699,15 @@ static void nfs41_handle_server_reboot(struct nfs_client *clp) | |||
1677 | static void nfs41_handle_state_revoked(struct nfs_client *clp) | 1699 | static void nfs41_handle_state_revoked(struct nfs_client *clp) |
1678 | { | 1700 | { |
1679 | nfs4_reset_all_state(clp); | 1701 | nfs4_reset_all_state(clp); |
1702 | dprintk("%s: state revoked on server %s\n", __func__, clp->cl_hostname); | ||
1680 | } | 1703 | } |
1681 | 1704 | ||
1682 | static void nfs41_handle_recallable_state_revoked(struct nfs_client *clp) | 1705 | static void nfs41_handle_recallable_state_revoked(struct nfs_client *clp) |
1683 | { | 1706 | { |
1684 | /* This will need to handle layouts too */ | 1707 | /* This will need to handle layouts too */ |
1685 | nfs_expire_all_delegations(clp); | 1708 | nfs_expire_all_delegations(clp); |
1709 | dprintk("%s: Recallable state revoked on server %s!\n", __func__, | ||
1710 | clp->cl_hostname); | ||
1686 | } | 1711 | } |
1687 | 1712 | ||
1688 | static void nfs41_handle_backchannel_fault(struct nfs_client *clp) | 1713 | static void nfs41_handle_backchannel_fault(struct nfs_client *clp) |
@@ -1690,6 +1715,8 @@ static void nfs41_handle_backchannel_fault(struct nfs_client *clp) | |||
1690 | nfs_expire_all_delegations(clp); | 1715 | nfs_expire_all_delegations(clp); |
1691 | if (test_and_set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state) == 0) | 1716 | if (test_and_set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state) == 0) |
1692 | nfs4_schedule_state_manager(clp); | 1717 | nfs4_schedule_state_manager(clp); |
1718 | dprintk("%s: server %s declared a backchannel fault\n", __func__, | ||
1719 | clp->cl_hostname); | ||
1693 | } | 1720 | } |
1694 | 1721 | ||
1695 | static void nfs41_handle_cb_path_down(struct nfs_client *clp) | 1722 | static void nfs41_handle_cb_path_down(struct nfs_client *clp) |
@@ -1740,6 +1767,8 @@ static int nfs4_reset_session(struct nfs_client *clp) | |||
1740 | memset(clp->cl_session->sess_id.data, 0, NFS4_MAX_SESSIONID_LEN); | 1767 | memset(clp->cl_session->sess_id.data, 0, NFS4_MAX_SESSIONID_LEN); |
1741 | status = nfs4_proc_create_session(clp, cred); | 1768 | status = nfs4_proc_create_session(clp, cred); |
1742 | if (status) { | 1769 | if (status) { |
1770 | dprintk("%s: session reset failed with status %d for server %s!\n", | ||
1771 | __func__, status, clp->cl_hostname); | ||
1743 | status = nfs4_handle_reclaim_lease_error(clp, status); | 1772 | status = nfs4_handle_reclaim_lease_error(clp, status); |
1744 | goto out; | 1773 | goto out; |
1745 | } | 1774 | } |
@@ -1747,6 +1776,8 @@ static int nfs4_reset_session(struct nfs_client *clp) | |||
1747 | /* create_session negotiated new slot table */ | 1776 | /* create_session negotiated new slot table */ |
1748 | clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state); | 1777 | clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state); |
1749 | clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state); | 1778 | clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state); |
1779 | dprintk("%s: session reset was successful for server %s!\n", | ||
1780 | __func__, clp->cl_hostname); | ||
1750 | 1781 | ||
1751 | /* Let the state manager reestablish state */ | 1782 | /* Let the state manager reestablish state */ |
1752 | if (!test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) | 1783 | if (!test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) |
@@ -1798,6 +1829,8 @@ static int nfs4_bind_conn_to_session(struct nfs_client *clp) | |||
1798 | clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state); | 1829 | clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state); |
1799 | switch (ret) { | 1830 | switch (ret) { |
1800 | case 0: | 1831 | case 0: |
1832 | dprintk("%s: bind_conn_to_session was successful for server %s!\n", | ||
1833 | __func__, clp->cl_hostname); | ||
1801 | break; | 1834 | break; |
1802 | case -NFS4ERR_DELAY: | 1835 | case -NFS4ERR_DELAY: |
1803 | ssleep(1); | 1836 | ssleep(1); |