diff options
author | Weston Andros Adamson <dros@netapp.com> | 2012-05-29 15:57:59 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-06-28 17:20:47 -0400 |
commit | 8ed27d4fb1ce95e65f5a3b26b02d3b77135cc7a1 (patch) | |
tree | 4908884d85ecc7c00f7e8a0c801f073e5325f3e4 /fs/nfs/nfs4state.c | |
parent | f8bb7f08549a1ced9ceb69a9bd5e163122044ab2 (diff) |
NFS: add more context to state manager error mesgs
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index f38300e9f171..76bbac367880 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -1857,10 +1857,12 @@ static int nfs4_bind_conn_to_session(struct nfs_client *clp) | |||
1857 | static void nfs4_state_manager(struct nfs_client *clp) | 1857 | static void nfs4_state_manager(struct nfs_client *clp) |
1858 | { | 1858 | { |
1859 | int status = 0; | 1859 | int status = 0; |
1860 | const char *section = "", *section_sep = ""; | ||
1860 | 1861 | ||
1861 | /* Ensure exclusive access to NFSv4 state */ | 1862 | /* Ensure exclusive access to NFSv4 state */ |
1862 | do { | 1863 | do { |
1863 | if (test_bit(NFS4CLNT_PURGE_STATE, &clp->cl_state)) { | 1864 | if (test_bit(NFS4CLNT_PURGE_STATE, &clp->cl_state)) { |
1865 | section = "purge state"; | ||
1864 | status = nfs4_reclaim_lease(clp); | 1866 | status = nfs4_reclaim_lease(clp); |
1865 | if (status < 0) | 1867 | if (status < 0) |
1866 | goto out_error; | 1868 | goto out_error; |
@@ -1869,6 +1871,7 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1869 | } | 1871 | } |
1870 | 1872 | ||
1871 | if (test_and_clear_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) { | 1873 | if (test_and_clear_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) { |
1874 | section = "lease expired"; | ||
1872 | /* We're going to have to re-establish a clientid */ | 1875 | /* We're going to have to re-establish a clientid */ |
1873 | status = nfs4_reclaim_lease(clp); | 1876 | status = nfs4_reclaim_lease(clp); |
1874 | if (status < 0) | 1877 | if (status < 0) |
@@ -1888,6 +1891,7 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1888 | } | 1891 | } |
1889 | 1892 | ||
1890 | if (test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) { | 1893 | if (test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) { |
1894 | section = "check lease"; | ||
1891 | status = nfs4_check_lease(clp); | 1895 | status = nfs4_check_lease(clp); |
1892 | if (status < 0) | 1896 | if (status < 0) |
1893 | goto out_error; | 1897 | goto out_error; |
@@ -1898,6 +1902,7 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1898 | /* Initialize or reset the session */ | 1902 | /* Initialize or reset the session */ |
1899 | if (test_and_clear_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state) | 1903 | if (test_and_clear_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state) |
1900 | && nfs4_has_session(clp)) { | 1904 | && nfs4_has_session(clp)) { |
1905 | section = "reset session"; | ||
1901 | status = nfs4_reset_session(clp); | 1906 | status = nfs4_reset_session(clp); |
1902 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) | 1907 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) |
1903 | continue; | 1908 | continue; |
@@ -1908,6 +1913,7 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1908 | /* Send BIND_CONN_TO_SESSION */ | 1913 | /* Send BIND_CONN_TO_SESSION */ |
1909 | if (test_and_clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, | 1914 | if (test_and_clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, |
1910 | &clp->cl_state) && nfs4_has_session(clp)) { | 1915 | &clp->cl_state) && nfs4_has_session(clp)) { |
1916 | section = "bind conn to session"; | ||
1911 | status = nfs4_bind_conn_to_session(clp); | 1917 | status = nfs4_bind_conn_to_session(clp); |
1912 | if (status < 0) | 1918 | if (status < 0) |
1913 | goto out_error; | 1919 | goto out_error; |
@@ -1916,6 +1922,7 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1916 | 1922 | ||
1917 | /* First recover reboot state... */ | 1923 | /* First recover reboot state... */ |
1918 | if (test_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state)) { | 1924 | if (test_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state)) { |
1925 | section = "reclaim reboot"; | ||
1919 | status = nfs4_do_reclaim(clp, | 1926 | status = nfs4_do_reclaim(clp, |
1920 | clp->cl_mvops->reboot_recovery_ops); | 1927 | clp->cl_mvops->reboot_recovery_ops); |
1921 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) || | 1928 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) || |
@@ -1930,6 +1937,7 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1930 | 1937 | ||
1931 | /* Now recover expired state... */ | 1938 | /* Now recover expired state... */ |
1932 | if (test_and_clear_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state)) { | 1939 | if (test_and_clear_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state)) { |
1940 | section = "reclaim nograce"; | ||
1933 | status = nfs4_do_reclaim(clp, | 1941 | status = nfs4_do_reclaim(clp, |
1934 | clp->cl_mvops->nograce_recovery_ops); | 1942 | clp->cl_mvops->nograce_recovery_ops); |
1935 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) || | 1943 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) || |
@@ -1948,6 +1956,7 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1948 | /* Recall session slots */ | 1956 | /* Recall session slots */ |
1949 | if (test_and_clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state) | 1957 | if (test_and_clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state) |
1950 | && nfs4_has_session(clp)) { | 1958 | && nfs4_has_session(clp)) { |
1959 | section = "recall slot"; | ||
1951 | status = nfs4_recall_slot(clp); | 1960 | status = nfs4_recall_slot(clp); |
1952 | if (status < 0) | 1961 | if (status < 0) |
1953 | goto out_error; | 1962 | goto out_error; |
@@ -1964,8 +1973,11 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1964 | } while (atomic_read(&clp->cl_count) > 1); | 1973 | } while (atomic_read(&clp->cl_count) > 1); |
1965 | return; | 1974 | return; |
1966 | out_error: | 1975 | out_error: |
1967 | pr_warn_ratelimited("NFS: state manager failed on NFSv4 server %s" | 1976 | if (strlen(section)) |
1968 | " with error %d\n", clp->cl_hostname, -status); | 1977 | section_sep = ": "; |
1978 | pr_warn_ratelimited("NFS: state manager%s%s failed on NFSv4 server %s" | ||
1979 | " with error %d\n", section_sep, section, | ||
1980 | clp->cl_hostname, -status); | ||
1969 | nfs4_end_drain_session(clp); | 1981 | nfs4_end_drain_session(clp); |
1970 | nfs4_clear_state_manager_bit(clp); | 1982 | nfs4_clear_state_manager_bit(clp); |
1971 | } | 1983 | } |