<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfs, branch linux-2.6.37.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2011-03-27T19:00:43Z</updated>
<entry>
<title>NFS: Fix a hang/infinite loop in nfs_wb_page()</title>
<updated>2011-03-27T19:00:43Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2011-03-21T19:37:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5460834c2384874904358ad2191f947a2d83ec72'/>
<id>urn:sha1:5460834c2384874904358ad2191f947a2d83ec72</id>
<content type='text'>
commit b8413f98f997bb3ed7327e6d7117e7e91ce010c3 upstream.

When one of the two waits in nfs_commit_inode() is interrupted, it
returns a non-negative value, which causes nfs_wb_page() to think
that the operation was successful causing it to busy-loop rather
than exiting.
It also causes nfs_file_fsync() to incorrectly report the file as
being successfully committed to disk.

This patch fixes both problems by ensuring that we return an error
if the attempts to wait fail.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>NFS: Fix a decoding problem in nfs3_decode_dirent</title>
<updated>2011-03-23T19:50:22Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2011-03-18T01:54:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2ea86e74bb34b67226254b99f7071af69228ec95'/>
<id>urn:sha1:2ea86e74bb34b67226254b99f7071af69228ec95</id>
<content type='text'>
[This needs to be applied to 2.6.37 only. The bug in question was
inadvertently fixed by a series of cleanups in 2.6.38, but the patches
in question are too large to be backported. This patch is a minimal fix
that serves the same purpose.]

When we decode a filename followed by an 8-byte cookie, we need to
consider the fact that the filename and cookie are 32-bit word aligned.
Presently, we may end up copying insufficient amounts of data when
xdr_inline_decode() needs to invoke xdr_copy_to_scratch to deal
with a page boundary.

The following patch fixes the issue by first decoding the filename, and
then decoding the cookie.

Reported-by: Neil Brown &lt;neilb@suse.de&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Reviewed-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>nfs: fix compilation warning</title>
<updated>2011-03-23T19:49:59Z</updated>
<author>
<name>Jovi Zhang</name>
</author>
<published>2011-03-02T23:19:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5eac80b1296c5326888307ab76af00e9f8d535f8'/>
<id>urn:sha1:5eac80b1296c5326888307ab76af00e9f8d535f8</id>
<content type='text'>
commit 43b7c3f051dea504afccc39bcb56d8e26c2e0b77 upstream.

this commit fix compilation warning as following:
linux-2.6/fs/nfs/nfs4proc.c:3265: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Jovi Zhang &lt;bookjovi@gmail.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>NFS: NFSROOT should default to "proto=udp"</title>
<updated>2011-03-23T19:49:55Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2011-03-11T20:31:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7713ab22e90f782af5747e738ebb33ea94f67cf0'/>
<id>urn:sha1:7713ab22e90f782af5747e738ebb33ea94f67cf0</id>
<content type='text'>
commit 53d4737580535e073963b91ce87d4216e434fab5 upstream.

There have been a number of recent reports that NFSROOT is no longer
working with default mount options, but fails only with certain NICs.

Brian Downing &lt;bdowning@lavos.net&gt; bisected to commit 56463e50 "NFS:
Use super.c for NFSROOT mount option parsing".  Among other things,
this commit changes the default mount options for NFSROOT to use TCP
instead of UDP as the underlying transport.

TCP seems less able to deal with NICs that are slow to initialize.
The system logs that have accompanied reports of problems all show
that NFSROOT attempts to establish a TCP connection before the NIC is
fully initialized, and thus the TCP connection attempt fails.

When a TCP connection attempt fails during a mount operation, the
NFS stack needs to fail the operation.  Usually user space knows how
and when to retry it.  The network layer does not report a distinct
error code for this particular failure mode.  Thus, there isn't a
clean way for the RPC client to see that it needs to retry in this
case, but not in others.

Because NFSROOT is used in some environments where it is not possible
to update the kernel command line to specify "udp", the proper thing
to do is change NFSROOT to use UDP by default, as it did before commit
56463e50.

To make it easier to see how to change default mount options for
NFSROOT and to distinguish default settings from mandatory settings,
I've adjusted a couple of areas to document the specifics.

root_nfs_cat() is also modified to deal with commas properly when
concatenating strings containing mount option lists.  This keeps
root_nfs_cat() call sites simpler, now that we may be concatenating
multiple mount option strings.

Tested-by: Brian Downing &lt;bdowning@lavos.net&gt;
Tested-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>NFS: NFSv4 readdir loses entries</title>
<updated>2011-03-14T21:17:36Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2011-01-28T17:41:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=73c2a0d93eb479373c14717a3e9bd0ce7b31e2e2'/>
<id>urn:sha1:73c2a0d93eb479373c14717a3e9bd0ce7b31e2e2</id>
<content type='text'>
commit d1205f87bbb8040c1408bbd9e0a720310b2b0b9b upstream.

On recent 2.6.38-rc kernels, connectathon basic test 6 fails on
NFSv4 mounts of OpenSolaris with something like:

&gt; ./test6: readdir
&gt; 	./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.12' dir entry, pass 0
&gt; 	./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.82' dir entry, pass 0
&gt; 	./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.164' dir entry, pass 0
&gt; 	./test6: (/mnt/klimt/matisse.test) Test failed with 3 errors
&gt; basic tests failed
&gt; Tests failed, leaving /mnt/klimt mounted
&gt; [cel@matisse cthon04]$

I narrowed the problem down to nfs4_decode_dirent() reporting that the
decode buffer had overflowed while decoding the entries for those
missing files.

verify_attr_len() assumes both it's pointer arguments reside on the
same page.  When these arguments point to locations on two different
pages, verify_attr_len() can report false errors.  This can happen now
that a large NFSv4 readdir result can span pages.

We have reasonably good checking in nfs4_decode_dirent() anyway, so
it should be safe to simply remove the extra checking.

At a guess, this was introduced by commit 6650239a, "NFS: Don't use
vm_map_ram() in readdir".

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>nfs4: Ensure that ACL pages sent over NFS were not allocated from the slab (v3)</title>
<updated>2011-03-14T21:17:33Z</updated>
<author>
<name>Neil Horman</name>
</author>
<published>2011-03-05T00:26:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4ff51e31281b8628f6d2e16770e1f047efa34713'/>
<id>urn:sha1:4ff51e31281b8628f6d2e16770e1f047efa34713</id>
<content type='text'>
commit e9e3d724e2145f5039b423c290ce2b2c3d8f94bc upstream.

The "bad_page()" page allocator sanity check was reported recently (call
chain as follows):

  bad_page+0x69/0x91
  free_hot_cold_page+0x81/0x144
  skb_release_data+0x5f/0x98
  __kfree_skb+0x11/0x1a
  tcp_ack+0x6a3/0x1868
  tcp_rcv_established+0x7a6/0x8b9
  tcp_v4_do_rcv+0x2a/0x2fa
  tcp_v4_rcv+0x9a2/0x9f6
  do_timer+0x2df/0x52c
  ip_local_deliver+0x19d/0x263
  ip_rcv+0x539/0x57c
  netif_receive_skb+0x470/0x49f
  :virtio_net:virtnet_poll+0x46b/0x5c5
  net_rx_action+0xac/0x1b3
  __do_softirq+0x89/0x133
  call_softirq+0x1c/0x28
  do_softirq+0x2c/0x7d
  do_IRQ+0xec/0xf5
  default_idle+0x0/0x50
  ret_from_intr+0x0/0xa
  default_idle+0x29/0x50
  cpu_idle+0x95/0xb8
  start_kernel+0x220/0x225
  _sinittext+0x22f/0x236

It occurs because an skb with a fraglist was freed from the tcp
retransmit queue when it was acked, but a page on that fraglist had
PG_Slab set (indicating it was allocated from the Slab allocator (which
means the free path above can't safely free it via put_page.

We tracked this back to an nfsv4 setacl operation, in which the nfs code
attempted to fill convert the passed in buffer to an array of pages in
__nfs4_proc_set_acl, which gets used by the skb-&gt;frags list in
xs_sendpages.  __nfs4_proc_set_acl just converts each page in the buffer
to a page struct via virt_to_page, but the vfs allocates the buffer via
kmalloc, meaning the PG_slab bit is set.  We can't create a buffer with
kmalloc and free it later in the tcp ack path with put_page, so we need
to either:

1) ensure that when we create the list of pages, no page struct has
   PG_Slab set

 or

2) not use a page list to send this data

Given that these buffers can be multiple pages and arbitrarily sized, I
think (1) is the right way to go.  I've written the below patch to
allocate a page from the buddy allocator directly and copy the data over
to it.  This ensures that we have a put_page free-able page for every
entry that winds up on an skb frag list, so it can be safely freed when
the frame is acked.  We do a put page on each entry after the
rpc_call_sync call so as to drop our own reference count to the page,
leaving only the ref count taken by tcp_sendpages.  This way the data
will be properly freed when the ack comes in

Successfully tested by myself to solve the above oops.

Note, as this is the result of a setacl operation that exceeded a page
of data, I think this amounts to a local DOS triggerable by an
uprivlidged user, so I'm CCing security on this as well.

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
CC: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>NFS: Fix "kernel BUG at fs/aio.c:554!"</title>
<updated>2011-02-17T23:14:14Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2011-01-21T15:54:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2a5771645face3922702fecedf3cd75263434f96'/>
<id>urn:sha1:2a5771645face3922702fecedf3cd75263434f96</id>
<content type='text'>
commit 839f7ad6932d95f4d5ae7267b95c574714ff3d5b upstream.

Nick Piggin reports:

&gt; I'm getting use after frees in aio code in NFS
&gt;
&gt; [ 2703.396766] Call Trace:
&gt; [ 2703.396858]  [&lt;ffffffff8100b057&gt;] ? native_sched_clock+0x27/0x80
&gt; [ 2703.396959]  [&lt;ffffffff8108509e&gt;] ? put_lock_stats+0xe/0x40
&gt; [ 2703.397058]  [&lt;ffffffff81088348&gt;] ? lock_release_holdtime+0xa8/0x140
&gt; [ 2703.397159]  [&lt;ffffffff8108a2a5&gt;] lock_acquire+0x95/0x1b0
&gt; [ 2703.397260]  [&lt;ffffffff811627db&gt;] ? aio_put_req+0x2b/0x60
&gt; [ 2703.397361]  [&lt;ffffffff81039701&gt;] ? get_parent_ip+0x11/0x50
&gt; [ 2703.397464]  [&lt;ffffffff81612a31&gt;] _raw_spin_lock_irq+0x41/0x80
&gt; [ 2703.397564]  [&lt;ffffffff811627db&gt;] ? aio_put_req+0x2b/0x60
&gt; [ 2703.397662]  [&lt;ffffffff811627db&gt;] aio_put_req+0x2b/0x60
&gt; [ 2703.397761]  [&lt;ffffffff811647fe&gt;] do_io_submit+0x2be/0x7c0
&gt; [ 2703.397895]  [&lt;ffffffff81164d0b&gt;] sys_io_submit+0xb/0x10
&gt; [ 2703.397995]  [&lt;ffffffff8100307b&gt;] system_call_fastpath+0x16/0x1b
&gt;
&gt; Adding some tracing, it is due to nfs completing the request then
&gt; returning something other than -EIOCBQUEUED, so aio.c
&gt; also completes the request.

To address this, prevent the NFS direct I/O engine from completing
async iocbs when the forward path returns an error without starting
any I/O.

This fix appears to survive ^C during both "xfstest no. 208" and "fsx
-Z."

It's likely this bug has existed for a very long while, as we are seeing
very similar symptoms in OEL 5.  Copying stable.

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>NFS: Fix an NFS client lockdep issue</title>
<updated>2011-02-17T23:14:13Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2011-01-27T19:55:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9db9440fc8bf8b2cab09611525edbe734a9de2a1'/>
<id>urn:sha1:9db9440fc8bf8b2cab09611525edbe734a9de2a1</id>
<content type='text'>
commit e00b8a24041f37e56b4b8415ce4eba1cbc238065 upstream.

There is no reason to be freeing the delegation cred in the rcu callback,
and doing so is resulting in a lockdep complaint that rpc_credcache_lock
is being called from both softirq and non-softirq contexts.

Reported-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>NFS: Fix NFSv3 exclusive open semantics</title>
<updated>2011-02-17T23:14:13Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2011-01-13T19:15:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5cc08212d21eb9e855ea6d4ad2b5a68afcf06a9'/>
<id>urn:sha1:f5cc08212d21eb9e855ea6d4ad2b5a68afcf06a9</id>
<content type='text'>
commit 8a0eebf66e3b1deae036553ba641a9c2bdbae678 upstream.

Commit c0204fd2b8fe047b18b67e07e1bf2a03691240cd (NFS: Clean up
nfs4_proc_create()) broke NFSv3 exclusive open by removing the code
that passes the O_EXCL flag down to nfs3_proc_create(). This patch
reverts that offending hunk from the original commit.

Reported-by: Nick Bowler &lt;nbowler@elliptictech.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Tested-by: Nick Bowler &lt;nbowler@elliptictech.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>NFS: Don't use vm_map_ram() in readdir</title>
<updated>2011-02-17T23:14:13Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2011-01-08T22:45:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=55ea499d60aefa3d03a77fc8590c26b5881faa92'/>
<id>urn:sha1:55ea499d60aefa3d03a77fc8590c26b5881faa92</id>
<content type='text'>
commit 6650239a4b01077e80d5a4468562756d77afaa59 upstream.

vm_map_ram() is not available on NOMMU platforms, and causes trouble
on incoherrent architectures such as ARM when we access the page data
through both the direct and the virtual mapping.

The alternative is to use the direct mapping to access page data
for the case when we are not crossing a page boundary, but to copy
the data into a linear scratch buffer when we are accessing data
that spans page boundaries.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Tested-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

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