<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/sunrpc, branch v3.2.32</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/net/sunrpc?h=v3.2.32</id>
<link rel='self' href='https://git.amat.us/linux/atom/net/sunrpc?h=v3.2.32'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-10-17T02:48:37Z</updated>
<entry>
<title>SUNRPC: Ensure that the TCP socket is closed when in CLOSE_WAIT</title>
<updated>2012-10-17T02:48:37Z</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2012-09-12T20:49:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4dad484180d610ab1ce8f87124526c05f7d71d74'/>
<id>urn:sha1:4dad484180d610ab1ce8f87124526c05f7d71d74</id>
<content type='text'>
commit a519fc7a70d1a918574bb826cc6905b87b482eb9 upstream.

Instead of doing a shutdown() call, we need to do an actual close().
Ditto if/when the server is sending us junk RPC headers.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Tested-by: Simon Kirby &lt;sim@hostway.ca&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Fix a UDP transport regression</title>
<updated>2012-09-19T14:05:17Z</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2012-09-07T15:08:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7b8b925af13a058ad6696b117503d6894d65897c'/>
<id>urn:sha1:7b8b925af13a058ad6696b117503d6894d65897c</id>
<content type='text'>
commit f39c1bfb5a03e2d255451bff05be0d7255298fa4 upstream.

Commit 43cedbf0e8dfb9c5610eb7985d5f21263e313802 (SUNRPC: Ensure that
we grab the XPRT_LOCK before calling xprt_alloc_slot) is causing
hangs in the case of NFS over UDP mounts.

Since neither the UDP or the RDMA transport mechanism use dynamic slot
allocation, we can skip grabbing the socket lock for those transports.
Add a new rpc_xprt_op to allow switching between the TCP and UDP/RDMA
case.

Note that the NFSv4.1 back channel assigns the slot directly
through rpc_run_bc_task, so we can ignore that case.

Reported-by: Dick Streefland &lt;dick.streefland@altium.nl&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping</title>
<updated>2012-09-12T02:37:23Z</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2012-08-17T21:31:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9d16d84d61a215bfce9a342cb4eb7347dae3e4c3'/>
<id>urn:sha1:9d16d84d61a215bfce9a342cb4eb7347dae3e4c3</id>
<content type='text'>
commit d10f27a750312ed5638c876e4bd6aa83664cccd8 upstream.

The rpc server tries to ensure that there will be room to send a reply
before it receives a request.

It does this by tracking, in xpt_reserved, an upper bound on the total
size of the replies that is has already committed to for the socket.

Currently it is adding in the estimate for a new reply *before* it
checks whether there is space available.  If it finds that there is not
space, it then subtracts the estimate back out.

This may lead the subsequent svc_xprt_enqueue to decide that there is
space after all.

The results is a svc_recv() that will repeatedly return -EAGAIN, causing
server threads to loop without doing any actual work.

Reported-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Tested-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>svcrpc: sends on closed socket should stop immediately</title>
<updated>2012-09-12T02:37:22Z</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2012-08-20T20:04:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1057f77016b40d967d8527349ebb881311017df7'/>
<id>urn:sha1:1057f77016b40d967d8527349ebb881311017df7</id>
<content type='text'>
commit f06f00a24d76e168ecb38d352126fd203937b601 upstream.

svc_tcp_sendto sets XPT_CLOSE if we fail to transmit the entire reply.
However, the XPT_CLOSE won't be acted on immediately.  Meanwhile other
threads could send further replies before the socket is really shut
down.  This can manifest as data corruption: for example, if a truncated
read reply is followed by another rpc reply, that second reply will look
to the client like further read data.

Symptoms were data corruption preceded by svc_tcp_sendto logging
something like

	kernel: rpc-srv/tcp: nfsd: sent only 963696 when sending 1048708 bytes - shutting down socket

Reported-by: Malahal Naineni &lt;malahal@us.ibm.com&gt;
Tested-by: Malahal Naineni &lt;malahal@us.ibm.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>svcrpc: fix BUG() in svc_tcp_clear_pages</title>
<updated>2012-09-12T02:37:22Z</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2012-08-09T22:12:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b4d810559cd5e73751adbd9cf05034bb8775a691'/>
<id>urn:sha1:b4d810559cd5e73751adbd9cf05034bb8775a691</id>
<content type='text'>
commit be1e44441a560c43c136a562d49a1c9623c91197 upstream.

Examination of svc_tcp_clear_pages shows that it assumes sk_tcplen is
consistent with sk_pages[] (in particular, sk_pages[n] can't be NULL if
sk_tcplen would lead us to expect n pages of data).

svc_tcp_restore_pages zeroes out sk_pages[] while leaving sk_tcplen.
This is OK, since both functions are serialized by XPT_BUSY.  However,
that means the inconsistency must be repaired before dropping XPT_BUSY.

Therefore we should be ensuring that svc_tcp_save_pages repairs the
problem before exiting svc_tcp_recv_record on error.

Symptoms were a BUG() in svc_tcp_clear_pages.

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>SUNRPC: return negative value in case rpcbind client creation error</title>
<updated>2012-08-09T23:25:02Z</updated>
<author>
<name>Stanislav Kinsbursky</name>
<email>skinsbursky@parallels.com</email>
</author>
<published>2012-07-20T11:57:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=baea16318bd48dbee1e0f1a5ca05ba932b64927a'/>
<id>urn:sha1:baea16318bd48dbee1e0f1a5ca05ba932b64927a</id>
<content type='text'>
commit caea33da898e4e14f0ba58173e3b7689981d2c0b upstream.

Without this patch kernel will panic on LockD start, because lockd_up() checks
lockd_up_net() result for negative value.
From my pow it's better to return negative value from rpcbind routines instead
of replacing all such checks like in lockd_up().

Signed-off-by: Stanislav Kinsbursky &lt;skinsbursky@parallels.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>nfs: skip commit in releasepage if we're freeing memory for fs-related reasons</title>
<updated>2012-08-09T23:24:59Z</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2012-07-23T17:58:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1c88c581bfe3afd2d21a14b6dee7011af8512f91'/>
<id>urn:sha1:1c88c581bfe3afd2d21a14b6dee7011af8512f91</id>
<content type='text'>
commit 5cf02d09b50b1ee1c2d536c9cf64af5a7d433f56 upstream.

We've had some reports of a deadlock where rpciod ends up with a stack
trace like this:

    PID: 2507   TASK: ffff88103691ab40  CPU: 14  COMMAND: "rpciod/14"
     #0 [ffff8810343bf2f0] schedule at ffffffff814dabd9
     #1 [ffff8810343bf3b8] nfs_wait_bit_killable at ffffffffa038fc04 [nfs]
     #2 [ffff8810343bf3c8] __wait_on_bit at ffffffff814dbc2f
     #3 [ffff8810343bf418] out_of_line_wait_on_bit at ffffffff814dbcd8
     #4 [ffff8810343bf488] nfs_commit_inode at ffffffffa039e0c1 [nfs]
     #5 [ffff8810343bf4f8] nfs_release_page at ffffffffa038bef6 [nfs]
     #6 [ffff8810343bf528] try_to_release_page at ffffffff8110c670
     #7 [ffff8810343bf538] shrink_page_list.clone.0 at ffffffff81126271
     #8 [ffff8810343bf668] shrink_inactive_list at ffffffff81126638
     #9 [ffff8810343bf818] shrink_zone at ffffffff8112788f
    #10 [ffff8810343bf8c8] do_try_to_free_pages at ffffffff81127b1e
    #11 [ffff8810343bf958] try_to_free_pages at ffffffff8112812f
    #12 [ffff8810343bfa08] __alloc_pages_nodemask at ffffffff8111fdad
    #13 [ffff8810343bfb28] kmem_getpages at ffffffff81159942
    #14 [ffff8810343bfb58] fallback_alloc at ffffffff8115a55a
    #15 [ffff8810343bfbd8] ____cache_alloc_node at ffffffff8115a2d9
    #16 [ffff8810343bfc38] kmem_cache_alloc at ffffffff8115b09b
    #17 [ffff8810343bfc78] sk_prot_alloc at ffffffff81411808
    #18 [ffff8810343bfcb8] sk_alloc at ffffffff8141197c
    #19 [ffff8810343bfce8] inet_create at ffffffff81483ba6
    #20 [ffff8810343bfd38] __sock_create at ffffffff8140b4a7
    #21 [ffff8810343bfd98] xs_create_sock at ffffffffa01f649b [sunrpc]
    #22 [ffff8810343bfdd8] xs_tcp_setup_socket at ffffffffa01f6965 [sunrpc]
    #23 [ffff8810343bfe38] worker_thread at ffffffff810887d0
    #24 [ffff8810343bfee8] kthread at ffffffff8108dd96
    #25 [ffff8810343bff48] kernel_thread at ffffffff8100c1ca

rpciod is trying to allocate memory for a new socket to talk to the
server. The VM ends up calling -&gt;releasepage to get more memory, and it
tries to do a blocking commit. That commit can't succeed however without
a connected socket, so we deadlock.

Fix this by setting PF_FSTRANS on the workqueue task prior to doing the
socket allocation, and having nfs_release_page check for that flag when
deciding whether to do a commit call. Also, set PF_FSTRANS
unconditionally in rpc_async_schedule since that function can also do
allocations sometimes.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>NFSv4.1: Fix a request leak on the back channel</title>
<updated>2012-06-19T22:18:08Z</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2012-05-31T19:26:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0997627ec97c5159f383df2b64f4c8e7fbe71a7b'/>
<id>urn:sha1:0997627ec97c5159f383df2b64f4c8e7fbe71a7b</id>
<content type='text'>
commit b3b02ae5865c2dcd506322e0fc6def59a042e72f upstream.

If the call to svc_process_common() fails, then the request
needs to be freed before we can exit bc_svc_process.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>sunrpc: fix loss of task-&gt;tk_status after rpc_delay call in xprt_alloc_slot</title>
<updated>2012-06-10T13:41:32Z</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2012-05-19T16:12:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b35e0437787ca030484a278d052d3aada0bb9947'/>
<id>urn:sha1:b35e0437787ca030484a278d052d3aada0bb9947</id>
<content type='text'>
commit 1afeaf5c29aa07db25760d2fbed5c08a3aec3498 upstream.

xprt_alloc_slot will call rpc_delay() to make the task wait a bit before
retrying when it gets back an -ENOMEM error from xprt_dynamic_alloc_slot.
The problem is that rpc_delay will clear the task-&gt;tk_status, causing
call_reserveresult to abort the task.

The solution is simply to let call_reserveresult handle the ENOMEM error
directly.

Reported-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>nfsd: don't allow zero length strings in cache_parse()</title>
<updated>2012-04-02T16:53:10Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2012-01-18T09:56:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b43188de0cd27787a75c79856e72c649d4ee9035'/>
<id>urn:sha1:b43188de0cd27787a75c79856e72c649d4ee9035</id>
<content type='text'>
commit 6d8d17499810479eabd10731179c04b2ca22152f upstream.

There is no point in passing a zero length string here and quite a
few of that cache_parse() implementations will Oops if count is
zero.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
