<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/net/sunrpc, branch linux-2.6.32.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-2.6.32.y</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-2.6.32.y'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2015-12-05T23:49:08+00:00</updated>
<entry>
<title>SUNRPC: xs_reset_transport must mark the connection as disconnected</title>
<updated>2015-12-05T23:49:08+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2015-08-29T20:36:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7af536c9e9cb014eb8cf9dc5f4cc67e7226f98a6'/>
<id>urn:sha1:7af536c9e9cb014eb8cf9dc5f4cc67e7226f98a6</id>
<content type='text'>
commit 0c78789e3a030615c6650fde89546cadf40ec2cc upstream.

In case the reconnection attempt fails.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
[bwh: Backported to 3.2: add local variable xprt]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
(cherry picked from commit 9434e4855e90d2af3751cd93b47b4a3e40bc2dc1)

Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Fix a memory leak in the backchannel code</title>
<updated>2015-09-18T11:52:10+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2015-06-01T19:10:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8a156fbcb0f05278c765666ef06bb79c5a853500'/>
<id>urn:sha1:8a156fbcb0f05278c765666ef06bb79c5a853500</id>
<content type='text'>
commit 88de6af24f2b48b06c514d3c3d0a8f22fafe30bd upstream.

req-&gt;rq_private_buf isn't initialised when xprt_setup_backchannel calls
xprt_free_allocation.

Fixes: fb7a0b9addbdb ("nfs41: New backchannel helper routines")
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
(cherry picked from commit bd031759bcc0865938ecc52846a3f22f2a26ad8e)

Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>kernel panic when mount NFSv4</title>
<updated>2013-06-10T09:43:23+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2010-12-20T21:19:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fc9e795a20735726400c834f3290806139f2c957'/>
<id>urn:sha1:fc9e795a20735726400c834f3290806139f2c957</id>
<content type='text'>
On Tue, 2010-12-14 at 16:58 +0800, Mi Jinlong wrote:
&gt; Hi,
&gt;
&gt; When testing NFSv4 at RHEL6 with kernel 2.6.32, I got a kernel panic
&gt; at NFS client's __rpc_create_common function.
&gt;
&gt; The panic place is:
&gt;   rpc_mkpipe
&gt;     __rpc_lookup_create()          &lt;=== find pipefile *idmap*
&gt;     __rpc_mkpipe()                 &lt;=== pipefile is *idmap*
&gt;       __rpc_create_common()
&gt;        ******  BUG_ON(!d_unhashed(dentry)); ******    *panic*
&gt;
&gt; It means that the dentry's d_flags have be set DCACHE_UNHASHED,
&gt; but it should not be set here.
&gt;
&gt; Is someone known this bug? or give me some idea?
&gt;
&gt; A reproduce program is append, but it can't reproduce the bug every time.
&gt; the export is: "/nfsroot       *(rw,no_root_squash,fsid=0,insecure)"
&gt;
&gt; And the panic message is append.
&gt;
&gt; ============================================================================
&gt; #!/bin/sh
&gt;
&gt; LOOPTOTAL=768
&gt; LOOPCOUNT=0
&gt; ret=0
&gt;
&gt; while [ $LOOPCOUNT -ne $LOOPTOTAL ]
&gt; do
&gt; 	((LOOPCOUNT += 1))
&gt; 	service nfs restart
&gt; 	/usr/sbin/rpc.idmapd
&gt; 	mount -t nfs4 127.0.0.1:/ /mnt|| return 1;
&gt; 	ls -l /var/lib/nfs/rpc_pipefs/nfs/*/
&gt; 	umount /mnt
&gt; 	echo $LOOPCOUNT
&gt; done
&gt;
&gt; ===============================================================================
&gt; Code: af 60 01 00 00 89 fa 89 f0 e8 64 cf 89 f0 e8 5c 7c 64 cf 31 c0 8b 5c 24 10 8b
&gt; 74 24 14 8b 7c 24 18 8b 6c 24 1c 83 c4 20 c3 &lt;0f&gt; 0b eb fc 8b 46 28 c7 44 24 08 20
&gt; de ee f0 c7 44 24 04 56 ea
&gt; EIP:[&lt;f0ee92ea&gt;] __rpc_create_common+0x8a/0xc0 [sunrpc] SS:ESP 0068:eccb5d28
&gt; ---[ end trace 8f5606cd08928ed2]---
&gt; Kernel panic - not syncing: Fatal exception
&gt; Pid:7131, comm: mount.nfs4 Tainted: G     D   -------------------2.6.32 #1
&gt; Call Trace:
&gt;  [&lt;c080ad18&gt;] ? panic+0x42/0xed
&gt;  [&lt;c080e42c&gt;] ? oops_end+0xbc/0xd0
&gt;  [&lt;c040b090&gt;] ? do_invalid_op+0x0/0x90
&gt;  [&lt;c040b10f&gt;] ? do_invalid_op+0x7f/0x90
&gt;  [&lt;f0ee92ea&gt;] ? __rpc_create_common+0x8a/0xc0[sunrpc]
&gt;  [&lt;f0edc433&gt;] ? rpc_free_task+0x33/0x70[sunrpc]
&gt;  [&lt;f0ed6508&gt;] ? prc_call_sync+0x48/0x60[sunrpc]
&gt;  [&lt;f0ed656e&gt;] ? rpc_ping+0x4e/0x60[sunrpc]
&gt;  [&lt;f0ed6eaf&gt;] ? rpc_create+0x38f/0x4f0[sunrpc]
&gt;  [&lt;c080d80b&gt;] ? error_code+0x73/0x78
&gt;  [&lt;f0ee92ea&gt;] ? __rpc_create_common+0x8a/0xc0[sunrpc]
&gt;  [&lt;c0532bda&gt;] ? d_lookup+0x2a/0x40
&gt;  [&lt;f0ee94b1&gt;] ? rpc_mkpipe+0x111/0x1b0[sunrpc]
&gt;  [&lt;f10a59f4&gt;] ? nfs_create_rpc_client+0xb4/0xf0[nfs]
&gt;  [&lt;f10d6c6d&gt;] ? nfs_fscache_get_client_cookie+0x1d/0x50[nfs]
&gt;  [&lt;f10d3fcb&gt;] ? nfs_idmap_new+0x7b/0x140[nfs]
&gt;  [&lt;c05e76aa&gt;] ? strlcpy+0x3a/0x60
&gt;  [&lt;f10a60ca&gt;] ? nfs4_set_client+0xea/0x2b0[nfs]
&gt;  [&lt;f10a6d0c&gt;] ? nfs4_create_server+0xac/0x1b0[nfs]
&gt;  [&lt;c04f1400&gt;] ? krealloc+0x40/0x50
&gt;  [&lt;f10b0e8b&gt;] ? nfs4_remote_get_sb+0x6b/0x250[nfs]
&gt;  [&lt;c04f14ec&gt;] ? kstrdup+0x3c/0x60
&gt;  [&lt;c0520739&gt;] ? vfs_kern_mount+0x69/0x170
&gt;  [&lt;f10b1a3c&gt;] ? nfs_do_root_mount+0x6c/0xa0[nfs]
&gt;  [&lt;f10b1b47&gt;] ? nfs4_try_mount+0x37/0xa0[nfs]
&gt;  [&lt;f10afe6d&gt;] ? nfs4_validate_text_mount_data+-x7d/0xf0[nfs]
&gt;  [&lt;f10b1c42&gt;] ? nfs4_get_sb+0x92/0x2f0
&gt;  [&lt;c0520739&gt;] ? vfs_kern_mount+0x69/0x170
&gt;  [&lt;c05366d2&gt;] ? get_fs_type+0x32/0xb0
&gt;  [&lt;c052089f&gt;] ? do_kern_mount+0x3f/0xe0
&gt;  [&lt;c053954f&gt;] ? do_mount+0x2ef/0x740
&gt;  [&lt;c0537740&gt;] ? copy_mount_options+0xb0/0x120
&gt;  [&lt;c0539a0e&gt;] ? sys_mount+0x6e/0xa0

Hi,

Does the following patch fix the problem?

Cheers
  Trond

--------------------------
SUNRPC: Fix a BUG in __rpc_create_common

From: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;

Mi Jinlong reports:

When testing NFSv4 at RHEL6 with kernel 2.6.32, I got a kernel panic
at NFS client's __rpc_create_common function.

The panic place is:
  rpc_mkpipe
      __rpc_lookup_create()          &lt;=== find pipefile *idmap*
      __rpc_mkpipe()                 &lt;=== pipefile is *idmap*
        __rpc_create_common()
         ******  BUG_ON(!d_unhashed(dentry)); ****** *panic*

The test is wrong: we can find ourselves with a hashed negative dentry here
if the idmapper tried to look up the file before we got round to creating
it.

Just replace the BUG_ON() with a d_drop(dentry).

[2.6.32 background info from Jonathan below]
&gt; Hi Willy et al,
&gt;
&gt; Please consider
&gt;
&gt;   beb0f0a9fba1 kernel panic when mount NFSv4, 2010-12-20
&gt;
&gt; for application to kernel.org's 2.6.32.y and 2.6.34.y trees.  The
&gt; patch was applied upstream during the 2.6.38 merge window, so newer
&gt; kernels don't need it.
&gt;
&gt; (Context: &lt;http://bugs.debian.org/695872&gt;.)  Tom Downes (cc-ed)
&gt; experienced the bug on a Debian kernel close to 2.6.32.58 and
&gt; confirmed that the patch doesn't seem to hurt.
&gt;
&gt; The patch is part of Fedora 13's 2.6.34-based and Fedora 14's
&gt; 2.6.35-based kernels[1].  It was also included in the RHEL kernel at
&gt; some point between 2.6.32-71.29.1.el6 and 2.6.32-131.0.15.el6[2].
&gt;
&gt; Thoughts of all kinds welcome, as always.
&gt;
&gt; Regards,
&gt; Jonathan
&gt;
&gt; [1] https://bugzilla.redhat.com/673207
&gt; [2] https://oss.oracle.com/git/?p=redpatch.git;a=commit;h=8028cccdc4b1

Reported-by: Mi Jinlong &lt;mijinlong@cn.fujitsu.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from commit beb0f0a9fba1fa98b378329a9a5b0a73f25097ae)
Cc: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>svcrpc: sends on closed socket should stop immediately</title>
<updated>2012-10-07T21:38:23+00:00</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2012-08-20T20:04:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c01b0313216b801d69913d9f704725bd6d784b3b'/>
<id>urn:sha1:c01b0313216b801d69913d9f704725bd6d784b3b</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: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping</title>
<updated>2012-10-07T21:38:22+00:00</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2012-08-17T21:31:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=70d79ae6e6c6ed674d9c2f3f57671227660356b6'/>
<id>urn:sha1:70d79ae6e6c6ed674d9c2f3f57671227660356b6</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: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>nfsd: don't allow zero length strings in cache_parse()</title>
<updated>2012-10-07T21:37:37+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2012-01-18T09:56:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0d1e8b8281ae7b43be54ec3409d299c99d7c975d'/>
<id>urn:sha1:0d1e8b8281ae7b43be54ec3409d299c99d7c975d</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;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>SUNRPC: We must not use list_for_each_entry_safe() in rpc_wake_up()</title>
<updated>2012-10-07T21:37:35+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2012-03-19T17:39:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=df79b5ef0bb8426ca21ece3ff9128e03d556c00d'/>
<id>urn:sha1:df79b5ef0bb8426ca21ece3ff9128e03d556c00d</id>
<content type='text'>
commit 540a0f7584169651f485e8ab67461fcb06934e38 upstream.

The problem is that for the case of priority queues, we
have to assume that __rpc_remove_wait_queue_priority will move new
elements from the tk_wait.links lists into the queue-&gt;tasks[] list.
We therefore cannot use list_for_each_entry_safe() on queue-&gt;tasks[],
since that will skip these new tasks that __rpc_remove_wait_queue_priority
is adding.

Without this fix, rpc_wake_up and rpc_wake_up_status will both fail
to wake up all functions on priority wait queues, which can result
in some nasty hangs.

Reported-by: Andy Adamson &lt;andros@netapp.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>rpc client can not deal with ENOSOCK, so translate it into ENOCONN</title>
<updated>2012-02-13T19:28:49+00:00</updated>
<author>
<name>Bian Naimeng</name>
<email>biannm@cn.fujitsu.com</email>
</author>
<published>2010-03-08T06:49:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=607ca4f51d6c4e7bec6d78f0a211476dae5552fc'/>
<id>urn:sha1:607ca4f51d6c4e7bec6d78f0a211476dae5552fc</id>
<content type='text'>
commit 5fe46e9d733f19a880ef7e516002bd4c2b833e14 upstream.

If NFSv4 client send a request before connect, or the old connection was broken
because a ETIMEOUT error catched by call_status, -&gt;send_request will return
ENOSOCK, but rpc layer can not deal with it, so make sure -&gt;send_request can
translate ENOSOCK into ENOCONN.

Signed-off-by: Bian Naimeng &lt;biannm@cn.fujitsu.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Cc: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>svcrpc: destroy server sockets all at once</title>
<updated>2012-01-25T21:53:22+00:00</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2011-11-29T16:35:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4ad71a69292de1f9d8f7a38a3f7e6508e89b3089'/>
<id>urn:sha1:4ad71a69292de1f9d8f7a38a3f7e6508e89b3089</id>
<content type='text'>
commit 2fefb8a09e7ed251ae8996e0c69066e74c5aa560 upstream.

There's no reason I can see that we need to call sv_shutdown between
closing the two lists of sockets.

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>svcrpc: fix double-free on shutdown of nfsd after changing pool mode</title>
<updated>2012-01-25T21:53:22+00:00</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2011-12-23T01:22:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=da27d545251bf5d1216307ada756bf747a46b6e4'/>
<id>urn:sha1:da27d545251bf5d1216307ada756bf747a46b6e4</id>
<content type='text'>
commit 61c8504c428edcebf23b97775a129c5b393a302b upstream.

The pool_to and to_pool fields of the global svc_pool_map are freed on
shutdown, but are initialized in nfsd startup only in the
SVC_POOL_PERCPU and SVC_POOL_PERNODE cases.

They *are* initialized to zero on kernel startup.  So as long as you use
only SVC_POOL_GLOBAL (the default), this will never be a problem.

You're also OK if you only ever use SVC_POOL_PERCPU or SVC_POOL_PERNODE.

However, the following sequence events leads to a double-free:

	1. set SVC_POOL_PERCPU or SVC_POOL_PERNODE
	2. start nfsd: both fields are initialized.
	3. shutdown nfsd: both fields are freed.
	4. set SVC_POOL_GLOBAL
	5. start nfsd: the fields are left untouched.
	6. shutdown nfsd: now we try to free them again.

Step 4 is actually unnecessary, since (for some bizarre reason), nfsd
automatically resets the pool mode to SVC_POOL_GLOBAL on shutdown.

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

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