diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-09 12:19:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-09 12:19:15 -0400 |
commit | bf97293eb878df3792d9de7213bd7b82135aea77 (patch) | |
tree | 16cb367bd78095b9eb8a54c800fcddfcccb618c7 /net/sunrpc/xprtsock.c | |
parent | 16d70e15295953b19ecf59e943723a181782b856 (diff) | |
parent | b1b3e136948a2bf4915326acb0d825d7d180753f (diff) |
Merge tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust:
"Highlights include:
- Fix NFSv4 recovery so that it doesn't recover lost locks in cases
such as lease loss due to a network partition, where doing so may
result in data corruption. Add a kernel parameter to control
choice of legacy behaviour or not.
- Performance improvements when 2 processes are writing to the same
file.
- Flush data to disk when an RPCSEC_GSS session timeout is imminent.
- Implement NFSv4.1 SP4_MACH_CRED state protection to prevent other
NFS clients from being able to manipulate our lease and file
locking state.
- Allow sharing of RPCSEC_GSS caches between different rpc clients.
- Fix the broken NFSv4 security auto-negotiation between client and
server.
- Fix rmdir() to wait for outstanding sillyrename unlinks to complete
- Add a tracepoint framework for debugging NFSv4 state recovery
issues.
- Add tracing to the generic NFS layer.
- Add tracing for the SUNRPC socket connection state.
- Clean up the rpc_pipefs mount/umount event management.
- Merge more patches from Chuck in preparation for NFSv4 migration
support"
* tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (107 commits)
NFSv4: use mach cred for SECINFO_NO_NAME w/ integrity
NFS: nfs_compare_super shouldn't check the auth flavour unless 'sec=' was set
NFSv4: Allow security autonegotiation for submounts
NFSv4: Disallow security negotiation for lookups when 'sec=' is specified
NFSv4: Fix security auto-negotiation
NFS: Clean up nfs_parse_security_flavors()
NFS: Clean up the auth flavour array mess
NFSv4.1 Use MDS auth flavor for data server connection
NFS: Don't check lock owner compatability unless file is locked (part 2)
NFS: Don't check lock owner compatibility in writes unless file is locked
nfs4: Map NFS4ERR_WRONG_CRED to EPERM
nfs4.1: Add SP4_MACH_CRED write and commit support
nfs4.1: Add SP4_MACH_CRED stateid support
nfs4.1: Add SP4_MACH_CRED secinfo support
nfs4.1: Add SP4_MACH_CRED cleanup support
nfs4.1: Add state protection handler
nfs4.1: Minimal SP4_MACH_CRED implementation
SUNRPC: Replace pointer values with task->tk_pid and rpc_clnt->cl_clid
SUNRPC: Add an identifier for struct rpc_clnt
SUNRPC: Ensure rpc_task->tk_pid is available for tracepoints
...
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r-- | net/sunrpc/xprtsock.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index d6656d7768f4..ee03d35677d9 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -47,6 +47,8 @@ | |||
47 | #include <net/udp.h> | 47 | #include <net/udp.h> |
48 | #include <net/tcp.h> | 48 | #include <net/tcp.h> |
49 | 49 | ||
50 | #include <trace/events/sunrpc.h> | ||
51 | |||
50 | #include "sunrpc.h" | 52 | #include "sunrpc.h" |
51 | 53 | ||
52 | static void xs_close(struct rpc_xprt *xprt); | 54 | static void xs_close(struct rpc_xprt *xprt); |
@@ -665,8 +667,10 @@ static void xs_tcp_shutdown(struct rpc_xprt *xprt) | |||
665 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); | 667 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); |
666 | struct socket *sock = transport->sock; | 668 | struct socket *sock = transport->sock; |
667 | 669 | ||
668 | if (sock != NULL) | 670 | if (sock != NULL) { |
669 | kernel_sock_shutdown(sock, SHUT_WR); | 671 | kernel_sock_shutdown(sock, SHUT_WR); |
672 | trace_rpc_socket_shutdown(xprt, sock); | ||
673 | } | ||
670 | } | 674 | } |
671 | 675 | ||
672 | /** | 676 | /** |
@@ -811,6 +815,7 @@ static void xs_reset_transport(struct sock_xprt *transport) | |||
811 | 815 | ||
812 | sk->sk_no_check = 0; | 816 | sk->sk_no_check = 0; |
813 | 817 | ||
818 | trace_rpc_socket_close(&transport->xprt, sock); | ||
814 | sock_release(sock); | 819 | sock_release(sock); |
815 | } | 820 | } |
816 | 821 | ||
@@ -1492,6 +1497,7 @@ static void xs_tcp_state_change(struct sock *sk) | |||
1492 | sock_flag(sk, SOCK_ZAPPED), | 1497 | sock_flag(sk, SOCK_ZAPPED), |
1493 | sk->sk_shutdown); | 1498 | sk->sk_shutdown); |
1494 | 1499 | ||
1500 | trace_rpc_socket_state_change(xprt, sk->sk_socket); | ||
1495 | switch (sk->sk_state) { | 1501 | switch (sk->sk_state) { |
1496 | case TCP_ESTABLISHED: | 1502 | case TCP_ESTABLISHED: |
1497 | spin_lock(&xprt->transport_lock); | 1503 | spin_lock(&xprt->transport_lock); |
@@ -1896,6 +1902,7 @@ static int xs_local_setup_socket(struct sock_xprt *transport) | |||
1896 | xprt, xprt->address_strings[RPC_DISPLAY_ADDR]); | 1902 | xprt, xprt->address_strings[RPC_DISPLAY_ADDR]); |
1897 | 1903 | ||
1898 | status = xs_local_finish_connecting(xprt, sock); | 1904 | status = xs_local_finish_connecting(xprt, sock); |
1905 | trace_rpc_socket_connect(xprt, sock, status); | ||
1899 | switch (status) { | 1906 | switch (status) { |
1900 | case 0: | 1907 | case 0: |
1901 | dprintk("RPC: xprt %p connected to %s\n", | 1908 | dprintk("RPC: xprt %p connected to %s\n", |
@@ -2039,6 +2046,7 @@ static void xs_udp_setup_socket(struct work_struct *work) | |||
2039 | xprt->address_strings[RPC_DISPLAY_PORT]); | 2046 | xprt->address_strings[RPC_DISPLAY_PORT]); |
2040 | 2047 | ||
2041 | xs_udp_finish_connecting(xprt, sock); | 2048 | xs_udp_finish_connecting(xprt, sock); |
2049 | trace_rpc_socket_connect(xprt, sock, 0); | ||
2042 | status = 0; | 2050 | status = 0; |
2043 | out: | 2051 | out: |
2044 | xprt_clear_connecting(xprt); | 2052 | xprt_clear_connecting(xprt); |
@@ -2064,6 +2072,8 @@ static void xs_abort_connection(struct sock_xprt *transport) | |||
2064 | memset(&any, 0, sizeof(any)); | 2072 | memset(&any, 0, sizeof(any)); |
2065 | any.sa_family = AF_UNSPEC; | 2073 | any.sa_family = AF_UNSPEC; |
2066 | result = kernel_connect(transport->sock, &any, sizeof(any), 0); | 2074 | result = kernel_connect(transport->sock, &any, sizeof(any), 0); |
2075 | trace_rpc_socket_reset_connection(&transport->xprt, | ||
2076 | transport->sock, result); | ||
2067 | if (!result) | 2077 | if (!result) |
2068 | xs_sock_reset_connection_flags(&transport->xprt); | 2078 | xs_sock_reset_connection_flags(&transport->xprt); |
2069 | dprintk("RPC: AF_UNSPEC connect return code %d\n", result); | 2079 | dprintk("RPC: AF_UNSPEC connect return code %d\n", result); |
@@ -2194,6 +2204,7 @@ static void xs_tcp_setup_socket(struct work_struct *work) | |||
2194 | xprt->address_strings[RPC_DISPLAY_PORT]); | 2204 | xprt->address_strings[RPC_DISPLAY_PORT]); |
2195 | 2205 | ||
2196 | status = xs_tcp_finish_connecting(xprt, sock); | 2206 | status = xs_tcp_finish_connecting(xprt, sock); |
2207 | trace_rpc_socket_connect(xprt, sock, status); | ||
2197 | dprintk("RPC: %p connect status %d connected %d sock state %d\n", | 2208 | dprintk("RPC: %p connect status %d connected %d sock state %d\n", |
2198 | xprt, -status, xprt_connected(xprt), | 2209 | xprt, -status, xprt_connected(xprt), |
2199 | sock->sk->sk_state); | 2210 | sock->sk->sk_state); |