<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfs/dir.c, branch linux-4.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-07-27T22:10:20Z</updated>
<entry>
<title>NFS: only invalidate dentrys that are clearly invalid.</title>
<updated>2017-07-27T22:10:20Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2017-07-05T02:22:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9968e8105914ba437b98dd19200092537dfeb23b'/>
<id>urn:sha1:9968e8105914ba437b98dd19200092537dfeb23b</id>
<content type='text'>
commit cc89684c9a265828ce061037f1f79f4a68ccd3f7 upstream.

Since commit bafc9b754f75 ("vfs: More precise tests in d_invalidate")
in v3.18, a return of '0' from -&gt;d_revalidate() will cause the dentry
to be invalidated even if it has filesystems mounted on or it or on a
descendant.  The mounted filesystem is unmounted.

This means we need to be careful not to return 0 unless the directory
referred to truly is invalid.  So -ESTALE or -ENOENT should invalidate
the directory.  Other errors such a -EPERM or -ERESTARTSYS should be
returned from -&gt;d_revalidate() so they are propagated to the caller.

A particular problem can be demonstrated by:

1/ mount an NFS filesystem using NFSv3 on /mnt
2/ mount any other filesystem on /mnt/foo
3/ ls /mnt/foo
4/ turn off network, or otherwise make the server unable to respond
5/ ls /mnt/foo &amp;
6/ cat /proc/$!/stack # note that nfs_lookup_revalidate is in the call stack
7/ kill -9 $! # this results in -ERESTARTSYS being returned
8/ observe that /mnt/foo has been unmounted.

This patch changes nfs_lookup_revalidate() to only treat
  -ESTALE from nfs_lookup_verify_inode() and
  -ESTALE or -ENOENT from -&gt;lookup()
as indicating an invalid inode.  Other errors are returned.

Also nfs_check_inode_attributes() is changed to return -ESTALE rather
than -EIO.  This is consistent with the error returned in similar
circumstances from nfs_update_inode().

As this bug allows any user to unmount a filesystem mounted on an NFS
filesystem, this fix is suitable for stable kernels.

Fixes: bafc9b754f75 ("vfs: More precise tests in d_invalidate")
Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Revert "NFS: nfs_rename() handle -ERESTARTSYS dentry left behind"</title>
<updated>2017-06-28T01:58:14Z</updated>
<author>
<name>Benjamin Coddington</name>
</author>
<published>2017-06-16T15:12:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9f2950006f110f54444a10442752372ee568289'/>
<id>urn:sha1:d9f2950006f110f54444a10442752372ee568289</id>
<content type='text'>
This reverts commit 920b4530fb80430ff30ef83efe21ba1fa5623731 which could
call d_move() without holding the directory's i_mutex, and reverts commit
d4ea7e3c5c0e341c15b073016dbf3ab6c65f12f3 "NFS: Fix old dentry rehash after
move", which was a follow-up fix.

Signed-off-by: Benjamin Coddington &lt;bcodding@redhat.com&gt;
Fixes: 920b4530fb80 ("NFS: nfs_rename() handle -ERESTARTSYS dentry left behind")
Cc: stable@vger.kernel.org # v4.10+
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>nfs: use kmap/kunmap directly</title>
<updated>2017-05-05T17:01:33Z</updated>
<author>
<name>Fabian Frederick</name>
</author>
<published>2017-05-03T18:52:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0795bf8357c1887e2a95e6e4f5b89d0896a0d929'/>
<id>urn:sha1:0795bf8357c1887e2a95e6e4f5b89d0896a0d929</id>
<content type='text'>
This patch removes useless nfs_readdir_get_array() and
nfs_readdir_release_array() as suggested by Trond Myklebust

nfs_readdir() calls nfs_revalidate_mapping() before
readdir_search_pagecache() , nfs_do_filldir(), uncached_readdir()
so mapping should be correct.

While kmap() can't fail, all subsequent error checks were removed
as well as unused labels.

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>NFS: switch back to to -&gt;iterate()</title>
<updated>2017-04-20T17:33:09Z</updated>
<author>
<name>Benjamin Coddington</name>
</author>
<published>2017-03-10T22:07:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b044f64513843e960f4b8d8e2e042abca1b7c029'/>
<id>urn:sha1:b044f64513843e960f4b8d8e2e042abca1b7c029</id>
<content type='text'>
NFS has some optimizations for readdir to choose between using READDIR or
READDIRPLUS based on workload, and which NFS operation to use is determined
by subsequent interactions with lookup, d_revalidate, and getattr.

Concurrent use of nfs_readdir() via -&gt;iterate_shared() can cause those
optimizations to repeatedly invalidate the pagecache used to store
directory entries during readdir(), which causes some very bad performance
for directories with many entries (more than about 10000).

There's a couple ways to fix this in NFS, but no fix would be as simple as
going back to -&gt;iterate() to serialize nfs_readdir(), and neither fix I
tested performed as well as going back to -&gt;iterate().

The first required taking the directory's i_lock for each entry, with the
result of terrible contention.

The second way adds another flag to the nfs_inode, and so keeps the
optimizations working for large directories.  The difference from using
-&gt;iterate() here is that much more memory is consumed for a given workload
without any performance gain.

The workings of nfs_readdir() are such that concurrent users are serialized
within read_cache_page() waiting to retrieve pages of entries from the
server.  By serializing this work in iterate_dir() instead, contention for
cache pages is reduced.  Waiting processes can have an uncontended pass at
the entirety of the directory's pagecache once previous processes have
completed filling it.

v2 - Keep the bits needed for parallel lookup

Signed-off-by: Benjamin Coddington &lt;bcodding@redhat.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>NFS: Fix old dentry rehash after move</title>
<updated>2017-03-27T17:30:49Z</updated>
<author>
<name>Benjamin Coddington</name>
</author>
<published>2017-03-16T01:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d4ea7e3c5c0e341c15b073016dbf3ab6c65f12f3'/>
<id>urn:sha1:d4ea7e3c5c0e341c15b073016dbf3ab6c65f12f3</id>
<content type='text'>
Now that nfs_rename()'s d_move has moved within the RPC task's rpc_call_done
callback, rehashing new_dentry will actually rehash the old dentry's name
in nfs_rename().  d_move() is going to rehash the new dentry for us anyway,
so doing it again here is unnecessary.

Reported-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Fixes: 920b4530fb80 ("NFS: nfs_rename() handle -ERESTARTSYS dentry left behind")
Signed-off-by: Benjamin Coddington &lt;bcodding@redhat.com&gt;
Tested-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>NFS: nfs_rename() handle -ERESTARTSYS dentry left behind</title>
<updated>2017-02-08T22:02:44Z</updated>
<author>
<name>Benjamin Coddington</name>
</author>
<published>2017-02-01T05:00:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=920b4530fb80430ff30ef83efe21ba1fa5623731'/>
<id>urn:sha1:920b4530fb80430ff30ef83efe21ba1fa5623731</id>
<content type='text'>
An interrupted rename will leave the old dentry behind if the rename
succeeds.  Fix this by moving the final local work of the rename to
rpc_call_done so that the results of the RENAME can always be handled,
even if the original process has already returned with -ERESTARTSYS.

Signed-off-by: Benjamin Coddington &lt;bcodding@redhat.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>NFS: Fix and clean up the access cache validity checking</title>
<updated>2016-12-19T22:29:39Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2016-12-16T23:40:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=21c3ba7e5dcdba23094fb50f6d1198faed94dac4'/>
<id>urn:sha1:21c3ba7e5dcdba23094fb50f6d1198faed94dac4</id>
<content type='text'>
The access cache needs to check whether or not the mode bits, ownership,
or ACL has changed or the cache has timed out.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>NFS: Only look at the change attribute cache state in nfs_weak_revalidate()</title>
<updated>2016-12-19T22:29:37Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2016-12-16T23:04:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9cdd1d3f1a8cea9cfe7953f45fae9ff51c37afa3'/>
<id>urn:sha1:9cdd1d3f1a8cea9cfe7953f45fae9ff51c37afa3</id>
<content type='text'>
Just like in nfs_check_verifier(), we want to use
nfs_mapping_need_revalidate_inode() to check our knowledge of the
change attribute is up to date.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>nfs: add support for the umask attribute</title>
<updated>2016-12-10T04:47:10Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2016-12-03T03:53:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dff25ddb48086afcb434770caa3d6849a4489b85'/>
<id>urn:sha1:dff25ddb48086afcb434770caa3d6849a4489b85</id>
<content type='text'>
Clients can set the umask attribute when creating files to cause the
server to apply it always except when inheriting permissions from the
parent directory.  That way, the new files will end up with the same
permissions as files created locally.

See https://tools.ietf.org/html/draft-ietf-nfsv4-umask-02 for more details.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>NFS: Only look at the change attribute cache state in nfs_check_verifier</title>
<updated>2016-12-04T23:34:34Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2016-12-04T23:34:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1cd9cb05f96e526f41bb4704caa95dc40ed08c5d'/>
<id>urn:sha1:1cd9cb05f96e526f41bb4704caa95dc40ed08c5d</id>
<content type='text'>
When looking at whether or not our dcache is valid, we really don't care
about the general state of the directory attribute cache. Instead, we
we only care about the state of the change attribute.

This fixes a performance issue when the client is responsible for
changing the directory contents; a number of NFSv4 operations will
atomically update the directory change attribute, but may not return
all the other attributes.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
</feed>
