<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfsd/filecache.c, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-03-28T06:46:43Z</updated>
<entry>
<title>nfsd: Containerise filecache laundrette</title>
<updated>2022-03-28T06:46:43Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2020-01-06T18:18:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=628adfa21815f74c04724abc85847f24b5dd1645'/>
<id>urn:sha1:628adfa21815f74c04724abc85847f24b5dd1645</id>
<content type='text'>
commit 9542e6a643fc69d528dfb3303f145719c61d3050 upstream.

Ensure that if the filecache laundrette gets stuck, it only affects
the knfsd instances of one container.

The notifier callbacks can be called from various contexts so avoid
using synchonous filesystem operations that might deadlock.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Cc: Khazhy Kumykov &lt;khazhy@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nfsd: cleanup nfsd_file_lru_dispose()</title>
<updated>2022-03-28T06:46:43Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2020-01-06T18:18:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c32f1041382a88b17da5736886da4a492353a1bb'/>
<id>urn:sha1:c32f1041382a88b17da5736886da4a492353a1bb</id>
<content type='text'>
commit 36ebbdb96b694dd9c6b25ad98f2bbd263d022b63 upstream.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Cc: Khazhy Kumykov &lt;khazhy@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nfsd: Don't keep looking up unhashed files in the nfsd file cache</title>
<updated>2021-03-24T10:26:38Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2021-02-19T02:02:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4c5fab560cb06c4e4bc719a3a7ce1787a5afde23'/>
<id>urn:sha1:4c5fab560cb06c4e4bc719a3a7ce1787a5afde23</id>
<content type='text'>
commit d30881f573e565ebb5dbb50b31ed6106b5c81328 upstream.

If a file is unhashed, then we're going to reject it anyway and retry,
so make sure we skip it when we're doing the RCU lockless lookup.
This avoids a number of unnecessary nfserr_jukebox returns from
nfsd_file_acquire()

Fixes: 65294c1f2c5e ("nfsd: add a new struct file caching facility to nfsd")
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nfsd: Fix a soft lockup race in nfsd_file_mark_find_or_create()</title>
<updated>2020-10-01T11:17:28Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2020-01-06T18:20:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fed639f7e1d5e562f58a1d2de87490e43831e519'/>
<id>urn:sha1:fed639f7e1d5e562f58a1d2de87490e43831e519</id>
<content type='text'>
[ Upstream commit 90d2f1da832fd23290ef0c0d964d97501e5e8553 ]

If nfsd_file_mark_find_or_create() keeps winning the race for the
nfsd_file_fsnotify_group-&gt;mark_mutex against nfsd_file_mark_put()
then it can soft lock up, since fsnotify_add_inode_mark() ends
up always finding an existing entry.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfsd: fix filecache lookup</title>
<updated>2020-02-11T12:35:32Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2020-01-06T18:18:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6282102dbcbf26e20670ce932917ddcafe266e71'/>
<id>urn:sha1:6282102dbcbf26e20670ce932917ddcafe266e71</id>
<content type='text'>
commit 28c7d86bb6172ffbb1a1237c6388e77f9fe5f181 upstream.

If the lookup keeps finding a nfsd_file with an unhashed open file,
then retry once only.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Cc: stable@vger.kernel.org
Fixes: 65294c1f2c5e "nfsd: add a new struct file caching facility to nfsd"
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>nfsd: Don't garbage collect files that might contain write errors</title>
<updated>2019-09-10T13:23:41Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2019-09-02T17:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=055b24a8f23090043b2ce0c30f03e12c5f2c9e72'/>
<id>urn:sha1:055b24a8f23090043b2ce0c30f03e12c5f2c9e72</id>
<content type='text'>
If a file may contain unstable writes that can error out, then we want
to avoid garbage collecting the struct nfsd_file that may be
tracking those errors.
So in the garbage collector, we try to avoid collecting files that aren't
clean. Furthermore, we avoid immediately kicking off the garbage collector
in the case where the reference drops to zero for the case where there
is a write error that is being tracked.

If the file is unhashed while an error is pending, then declare a
reboot, to ensure the client resends any unstable writes.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>nfsd: nfsd_file cache entries should be per net namespace</title>
<updated>2019-09-10T13:23:41Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2019-09-02T17:02:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e113224c17e2fb156b785ddbbc48a0209fddb0c'/>
<id>urn:sha1:5e113224c17e2fb156b785ddbbc48a0209fddb0c</id>
<content type='text'>
Ensure that we can safely clear out the file cache entries when the
nfs server is shut down on a container. Otherwise, the file cache
may end up pinning the mounts.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>nfsd: remove duplicated include from filecache.c</title>
<updated>2019-08-20T15:15:34Z</updated>
<author>
<name>YueHaibing</name>
</author>
<published>2019-08-20T01:32:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bb13f35b96f4c83dc4015d71fa2b543c665fbdae'/>
<id>urn:sha1:bb13f35b96f4c83dc4015d71fa2b543c665fbdae</id>
<content type='text'>
Remove duplicated include.

Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>nfsd: add a new struct file caching facility to nfsd</title>
<updated>2019-08-19T15:00:39Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2019-08-18T18:18:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65294c1f2c5e72b15b76e16c8c8cfd9359fc9f6f'/>
<id>urn:sha1:65294c1f2c5e72b15b76e16c8c8cfd9359fc9f6f</id>
<content type='text'>
Currently, NFSv2/3 reads and writes have to open a file, do the read or
write and then close it again for each RPC. This is highly inefficient,
especially when the underlying filesystem has a relatively slow open
routine.

This patch adds a new open file cache to knfsd. Rather than doing an
open for each RPC, the read/write handlers can call into this cache to
see if there is one already there for the correct filehandle and
NFS_MAY_READ/WRITE flags.

If there isn't an entry, then we create a new one and attempt to
perform the open. If there is, then we wait until the entry is fully
instantiated and return it if it is at the end of the wait. If it's
not, then we attempt to take over construction.

Since the main goal is to speed up NFSv2/3 I/O, we don't want to
close these files on last put of these objects. We need to keep them
around for a little while since we never know when the next READ/WRITE
will come in.

Cache entries have a hardcoded 1s timeout, and we have a recurring
workqueue job that walks the cache and purges any entries that have
expired.

Signed-off-by: Jeff Layton &lt;jeff.layton@primarydata.com&gt;
Signed-off-by: Weston Andros Adamson &lt;dros@primarydata.com&gt;
Signed-off-by: Richard Sharpe &lt;richard.sharpe@primarydata.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
</feed>
