diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-28 21:02:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-28 21:02:55 -0500 |
commit | b6669737d3db7df79fad07180837c23dbe581db5 (patch) | |
tree | 671a9d13fe5ab00d6a3c7c5c5c466802ca96d38a /net/sunrpc/xprtsock.c | |
parent | 1cf0209c431fa7790253c532039d53b0773193aa (diff) | |
parent | dc107402ae06286a9ed33c32daf3f35514a7cb8d (diff) |
Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux
Pull nfsd changes from J Bruce Fields:
"Miscellaneous bugfixes, plus:
- An overhaul of the DRC cache by Jeff Layton. The main effect is
just to make it larger. This decreases the chances of intermittent
errors especially in the UDP case. But we'll need to watch for any
reports of performance regressions.
- Containerized nfsd: with some limitations, we now support
per-container nfs-service, thanks to extensive work from Stanislav
Kinsbursky over the last year."
Some notes about conflicts, since there were *two* non-data semantic
conflicts here:
- idr_remove_all() had been added by a memory leak fix, but has since
become deprecated since idr_destroy() does it for us now.
- xs_local_connect() had been added by this branch to make AF_LOCAL
connections be synchronous, but in the meantime Trond had changed the
calling convention in order to avoid a RCU dereference.
There were a couple of more obvious actual source-level conflicts due to
the hlist traversal changes and one just due to code changes next to
each other, but those were trivial.
* 'for-3.9' of git://linux-nfs.org/~bfields/linux: (49 commits)
SUNRPC: make AF_LOCAL connect synchronous
nfsd: fix compiler warning about ambiguous types in nfsd_cache_csum
svcrpc: fix rpc server shutdown races
svcrpc: make svc_age_temp_xprts enqueue under sv_lock
lockd: nlmclnt_reclaim(): avoid stack overflow
nfsd: enable NFSv4 state in containers
nfsd: disable usermode helper client tracker in container
nfsd: use proper net while reading "exports" file
nfsd: containerize NFSd filesystem
nfsd: fix comments on nfsd_cache_lookup
SUNRPC: move cache_detail->cache_request callback call to cache_read()
SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function
SUNRPC: rework cache upcall logic
SUNRPC: introduce cache_detail->cache_request callback
NFS: simplify and clean cache library
NFS: use SUNRPC cache creation and destruction helper for DNS cache
nfsd4: free_stid can be static
nfsd: keep a checksum of the first 256 bytes of request
sunrpc: trim off trailing checksum before returning decrypted or integrity authenticated buffer
sunrpc: fix comment in struct xdr_buf definition
...
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r-- | net/sunrpc/xprtsock.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 37cbda63f45c..c1d8476b7692 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/udp.h> | 33 | #include <linux/udp.h> |
34 | #include <linux/tcp.h> | 34 | #include <linux/tcp.h> |
35 | #include <linux/sunrpc/clnt.h> | 35 | #include <linux/sunrpc/clnt.h> |
36 | #include <linux/sunrpc/addr.h> | ||
36 | #include <linux/sunrpc/sched.h> | 37 | #include <linux/sunrpc/sched.h> |
37 | #include <linux/sunrpc/svcsock.h> | 38 | #include <linux/sunrpc/svcsock.h> |
38 | #include <linux/sunrpc/xprtsock.h> | 39 | #include <linux/sunrpc/xprtsock.h> |
@@ -1867,13 +1868,9 @@ static int xs_local_finish_connecting(struct rpc_xprt *xprt, | |||
1867 | * @xprt: RPC transport to connect | 1868 | * @xprt: RPC transport to connect |
1868 | * @transport: socket transport to connect | 1869 | * @transport: socket transport to connect |
1869 | * @create_sock: function to create a socket of the correct type | 1870 | * @create_sock: function to create a socket of the correct type |
1870 | * | ||
1871 | * Invoked by a work queue tasklet. | ||
1872 | */ | 1871 | */ |
1873 | static void xs_local_setup_socket(struct work_struct *work) | 1872 | static int xs_local_setup_socket(struct sock_xprt *transport) |
1874 | { | 1873 | { |
1875 | struct sock_xprt *transport = | ||
1876 | container_of(work, struct sock_xprt, connect_worker.work); | ||
1877 | struct rpc_xprt *xprt = &transport->xprt; | 1874 | struct rpc_xprt *xprt = &transport->xprt; |
1878 | struct socket *sock; | 1875 | struct socket *sock; |
1879 | int status = -EIO; | 1876 | int status = -EIO; |
@@ -1918,6 +1915,30 @@ out: | |||
1918 | xprt_clear_connecting(xprt); | 1915 | xprt_clear_connecting(xprt); |
1919 | xprt_wake_pending_tasks(xprt, status); | 1916 | xprt_wake_pending_tasks(xprt, status); |
1920 | current->flags &= ~PF_FSTRANS; | 1917 | current->flags &= ~PF_FSTRANS; |
1918 | return status; | ||
1919 | } | ||
1920 | |||
1921 | static void xs_local_connect(struct rpc_xprt *xprt, struct rpc_task *task) | ||
1922 | { | ||
1923 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); | ||
1924 | int ret; | ||
1925 | |||
1926 | if (RPC_IS_ASYNC(task)) { | ||
1927 | /* | ||
1928 | * We want the AF_LOCAL connect to be resolved in the | ||
1929 | * filesystem namespace of the process making the rpc | ||
1930 | * call. Thus we connect synchronously. | ||
1931 | * | ||
1932 | * If we want to support asynchronous AF_LOCAL calls, | ||
1933 | * we'll need to figure out how to pass a namespace to | ||
1934 | * connect. | ||
1935 | */ | ||
1936 | rpc_exit(task, -ENOTCONN); | ||
1937 | return; | ||
1938 | } | ||
1939 | ret = xs_local_setup_socket(transport); | ||
1940 | if (ret && !RPC_IS_SOFTCONN(task)) | ||
1941 | msleep_interruptible(15000); | ||
1921 | } | 1942 | } |
1922 | 1943 | ||
1923 | #ifdef CONFIG_SUNRPC_SWAP | 1944 | #ifdef CONFIG_SUNRPC_SWAP |
@@ -2455,7 +2476,7 @@ static struct rpc_xprt_ops xs_local_ops = { | |||
2455 | .alloc_slot = xprt_alloc_slot, | 2476 | .alloc_slot = xprt_alloc_slot, |
2456 | .rpcbind = xs_local_rpcbind, | 2477 | .rpcbind = xs_local_rpcbind, |
2457 | .set_port = xs_local_set_port, | 2478 | .set_port = xs_local_set_port, |
2458 | .connect = xs_connect, | 2479 | .connect = xs_local_connect, |
2459 | .buf_alloc = rpc_malloc, | 2480 | .buf_alloc = rpc_malloc, |
2460 | .buf_free = rpc_free, | 2481 | .buf_free = rpc_free, |
2461 | .send_request = xs_local_send_request, | 2482 | .send_request = xs_local_send_request, |
@@ -2628,8 +2649,6 @@ static struct rpc_xprt *xs_setup_local(struct xprt_create *args) | |||
2628 | goto out_err; | 2649 | goto out_err; |
2629 | } | 2650 | } |
2630 | xprt_set_bound(xprt); | 2651 | xprt_set_bound(xprt); |
2631 | INIT_DELAYED_WORK(&transport->connect_worker, | ||
2632 | xs_local_setup_socket); | ||
2633 | xs_format_peer_addresses(xprt, "local", RPCBIND_NETID_LOCAL); | 2652 | xs_format_peer_addresses(xprt, "local", RPCBIND_NETID_LOCAL); |
2634 | break; | 2653 | break; |
2635 | default: | 2654 | default: |