<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfsd/filecache.c, branch linux-6.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-11-20T10:56:43Z</updated>
<entry>
<title>nfsd: Handle EOPENSTALE correctly in the filecache</title>
<updated>2023-11-20T10:56:43Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2023-09-11T18:30:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3aa811a186df2877366d12c99ac32a8ece6d6bce'/>
<id>urn:sha1:3aa811a186df2877366d12c99ac32a8ece6d6bce</id>
<content type='text'>
[ Upstream commit d59b3515ab021e010fdc58a8f445ea62dd2f7f4c ]

The nfsd_open code handles EOPENSTALE correctly, by retrying the call to
fh_verify() and __nfsd_open(). However the filecache just drops the
error on the floor, and immediately returns nfserr_stale to the caller.

This patch ensures that we propagate the EOPENSTALE code back to
nfsd_file_do_acquire, and that we handle it correctly.

Fixes: 65294c1f2c5e ("nfsd: add a new struct file caching facility to nfsd")
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Message-Id: &lt;20230911183027.11372-1-trond.myklebust@hammerspace.com&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>NFSD: Fix problem of COMMIT and NFS4ERR_DELAY in infinite loop</title>
<updated>2023-04-27T22:49:24Z</updated>
<author>
<name>Dai Ngo</name>
</author>
<published>2023-04-19T17:53:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=147abcacee33781e75588869e944ddb07528a897'/>
<id>urn:sha1:147abcacee33781e75588869e944ddb07528a897</id>
<content type='text'>
The following request sequence to the same file causes the NFS client and
server getting into an infinite loop with COMMIT and NFS4ERR_DELAY:

OPEN
REMOVE
WRITE
COMMIT

Problem reported by recall11, recall12, recall14, recall20, recall22,
recall40, recall42, recall48, recall50 of nfstest suite.

This patch restores the handling of race condition in nfsd_file_do_acquire
with unlink to that prior of the regression.

Fixes: ac3a2585f018 ("nfsd: rework refcounting in filecache")
Signed-off-by: Dai Ngo &lt;dai.ngo@oracle.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>nfsd: simplify the delayed disposal list code</title>
<updated>2023-04-26T13:05:01Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2023-04-14T21:31:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=92e4a6733f922f0fef1d0995f7b2d0eaff86c7ea'/>
<id>urn:sha1:92e4a6733f922f0fef1d0995f7b2d0eaff86c7ea</id>
<content type='text'>
When queueing a dispose list to the appropriate "freeme" lists, it
pointlessly queues the objects one at a time to an intermediate list.

Remove a few helpers and just open code a list_move to make it more
clear and efficient. Better document the resulting functions with
kerneldoc comments.

Signed-off-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>NFSD: Convert filecache to rhltable</title>
<updated>2023-04-26T13:04:59Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2022-11-24T20:09:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c4c649ab413ba6a785b25f0edbb12f617c87db2a'/>
<id>urn:sha1:c4c649ab413ba6a785b25f0edbb12f617c87db2a</id>
<content type='text'>
While we were converting the nfs4_file hashtable to use the kernel's
resizable hashtable data structure, Neil Brown observed that the
list variant (rhltable) would be better for managing nfsd_file items
as well. The nfsd_file hash table will contain multiple entries for
the same inode -- these should be kept together on a list. And, it
could be possible for exotic or malicious client behavior to cause
the hash table to resize itself on every insertion.

A nice simplification is that rhltable_lookup() can return a list
that contains only nfsd_file items that match a given inode, which
enables us to eliminate specialized hash table helper functions and
use the default functions provided by the rhashtable implementation).

Since we are now storing nfsd_file items for the same inode on a
single list, that effectively reduces the number of hash entries
that have to be tracked in the hash table. The mininum bucket count
is therefore lowered.

Light testing with fstests generic/531 show no regressions.

Suggested-by: Neil Brown &lt;neilb@suse.de&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>nfsd: allow reaping files still under writeback</title>
<updated>2023-04-26T13:04:59Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2023-02-15T11:53:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dcb779fcd4ed5984ad15991d574943d12a8693d1'/>
<id>urn:sha1:dcb779fcd4ed5984ad15991d574943d12a8693d1</id>
<content type='text'>
On most filesystems, there is no reason to delay reaping an nfsd_file
just because its underlying inode is still under writeback. nfsd just
relies on client activity or the local flusher threads to do writeback.

The main exception is NFS, which flushes all of its dirty data on last
close. Add a new EXPORT_OP_FLUSH_ON_CLOSE flag to allow filesystems to
signal that they do this, and only skip closing files under writeback on
such filesystems.

Also, remove a redundant NULL file pointer check in
nfsd_file_check_writeback, and clean up nfs's export op flag
definitions.

Signed-off-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Acked-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>nfsd: update comment over __nfsd_file_cache_purge</title>
<updated>2023-04-26T13:04:59Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2023-01-26T17:21:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=972cc0e0924598cb293b919d39c848dc038b2c28'/>
<id>urn:sha1:972cc0e0924598cb293b919d39c848dc038b2c28</id>
<content type='text'>
Signed-off-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>nfsd: don't take/put an extra reference when putting a file</title>
<updated>2023-04-26T13:04:59Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2023-01-18T17:31:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b2ff1bd71db2a1b193a6dde0845adcd69cbcf75e'/>
<id>urn:sha1:b2ff1bd71db2a1b193a6dde0845adcd69cbcf75e</id>
<content type='text'>
The last thing that filp_close does is an fput, so don't bother taking
and putting the extra reference.

Signed-off-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>nfsd: add some comments to nfsd_file_do_acquire</title>
<updated>2023-04-26T13:04:58Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2023-01-05T12:15:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b680cb9b737331aad271feebbedafb865504e234'/>
<id>urn:sha1:b680cb9b737331aad271feebbedafb865504e234</id>
<content type='text'>
David Howells mentioned that he found this bit of code confusing, so
sprinkle in some comments to clarify.

Reported-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>nfsd: don't kill nfsd_files because of lease break error</title>
<updated>2023-04-26T13:04:58Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2023-01-05T12:15:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c6593366c0bf222be9c7561354dfb921c611745e'/>
<id>urn:sha1:c6593366c0bf222be9c7561354dfb921c611745e</id>
<content type='text'>
An error from break_lease is non-fatal, so we needn't destroy the
nfsd_file in that case. Just put the reference like we normally would
and return the error.

Signed-off-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>nfsd: simplify test_bit return in NFSD_FILE_KEY_FULL comparator</title>
<updated>2023-04-26T13:04:58Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2023-01-06T15:39:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d69b8dbfd0866abc5ec84652cc1c10fc3d4d91ef'/>
<id>urn:sha1:d69b8dbfd0866abc5ec84652cc1c10fc3d4d91ef</id>
<content type='text'>
test_bit returns bool, so we can just compare the result of that to the
key-&gt;gc value without the "!!".

Signed-off-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
</feed>
