<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfs/dir.c, branch linux-5.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-06-15T19:03:12Z</updated>
<entry>
<title>NFSv4: Add FMODE_CAN_ODIRECT after successful open of a NFS4.x file</title>
<updated>2022-06-15T19:03:12Z</updated>
<author>
<name>Dave Wysochanski</name>
</author>
<published>2022-06-10T00:46:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5ee3d10f84d0a32fc11a55c70c204b6d81fd9ef6'/>
<id>urn:sha1:5ee3d10f84d0a32fc11a55c70c204b6d81fd9ef6</id>
<content type='text'>
Commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag")
added the FMODE_CAN_ODIRECT flag for NFSv3 but neglected to add
it for NFSv4.x.  This causes direct io on NFSv4.x to fail open
with EINVAL:
  mount -o vers=4.2 127.0.0.1:/export /mnt/nfs4
  dd if=/dev/zero of=/mnt/nfs4/file.bin bs=128k count=1 oflag=direct
  dd: failed to open '/mnt/nfs4/file.bin': Invalid argument
  dd of=/dev/null if=/mnt/nfs4/file.bin bs=128k count=1 iflag=direct
  dd: failed to open '/mnt/dir1/file1.bin': Invalid argument

Fixes: a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag")
Signed-off-by: Dave Wysochanski &lt;dwysocha@redhat.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>nfs: Convert to free_folio</title>
<updated>2022-05-10T03:12:53Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2022-05-01T12:00:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aa5dc8c46189779555e491d5a5ae1cc717ead774'/>
<id>urn:sha1:aa5dc8c46189779555e491d5a5ae1cc717ead774</id>
<content type='text'>
Add a wrapper that converts back from the folio to the page.  This
entire file needs to be converted to use folios, but that's a
task for a different set of patches.

Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>NFS: Replace readdir's use of xxhash() with hash_64()</title>
<updated>2022-04-07T20:19:47Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-03-31T00:00:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=830f1111d90e8770fcfad8bd5628e8ae6fecec06'/>
<id>urn:sha1:830f1111d90e8770fcfad8bd5628e8ae6fecec06</id>
<content type='text'>
Both xxhash() and hash_64() appear to give similarly low collision
rates with a standard linearly increasing readdir offset. They both give
similarly higher collision rates when applied to ext4's offsets.

So switch to using the standard hash_64().

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFSv4: fix open failure with O_ACCMODE flag</title>
<updated>2022-03-30T02:14:00Z</updated>
<author>
<name>ChenXiaoSong</name>
</author>
<published>2022-03-29T11:32:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b243874f6f9568b2daf1a00e9222cacdc15e159c'/>
<id>urn:sha1:b243874f6f9568b2daf1a00e9222cacdc15e159c</id>
<content type='text'>
open() with O_ACCMODE|O_DIRECT flags secondly will fail.

Reproducer:
  1. mount -t nfs -o vers=4.2 $server_ip:/ /mnt/
  2. fd = open("/mnt/file", O_ACCMODE|O_DIRECT|O_CREAT)
  3. close(fd)
  4. fd = open("/mnt/file", O_ACCMODE|O_DIRECT)

Server nfsd4_decode_share_access() will fail with error nfserr_bad_xdr when
client use incorrect share access mode of 0.

Fix this by using NFS4_SHARE_ACCESS_BOTH share access mode in client,
just like firstly opening.

Fixes: ce4ef7c0a8a05 ("NFS: Split out NFS v4 file operations")
Signed-off-by: ChenXiaoSong &lt;chenxiaosong2@huawei.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Fix revalidation of empty readdir pages</title>
<updated>2022-03-22T19:52:55Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-03-22T13:11:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e47a62df29a0714cc2d5129516a3618337c84554'/>
<id>urn:sha1:e47a62df29a0714cc2d5129516a3618337c84554</id>
<content type='text'>
If the page is empty, we need to check the array-&gt;last_cookie instead of
the first entry. Add a helper for the cases where we care.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Don't deadlock when cookie hashes collide</title>
<updated>2022-03-22T13:14:39Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-03-22T02:27:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=648a4548d622c4ae965058db1a6b5b95c062789a'/>
<id>urn:sha1:648a4548d622c4ae965058db1a6b5b95c062789a</id>
<content type='text'>
In the very rare case where the readdir reply contains multiple cookies
that map to the same hash value, we can end up deadlocking waiting for a
page lock that we already hold. In this case we should fail the page
lock by using grab_cache_page_nowait().

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Cache all entries in the readdirplus reply</title>
<updated>2022-03-02T13:43:39Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-02-24T16:48:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=612896ec5a4edbf98c4a631503899da04df76480'/>
<id>urn:sha1:612896ec5a4edbf98c4a631503899da04df76480</id>
<content type='text'>
Even if we're not able to cache all the entries in the readdir buffer,
let's ensure that we do prime the dcache.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Optimise away the previous cookie field</title>
<updated>2022-03-02T13:43:39Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-02-27T17:46:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0adf85b445c7fbc5d2df1f8c1bc54d62c4340237'/>
<id>urn:sha1:0adf85b445c7fbc5d2df1f8c1bc54d62c4340237</id>
<content type='text'>
Replace the 'previous cookie' field in struct nfs_entry with the
array-&gt;last_cookie.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Fix up forced readdirplus</title>
<updated>2022-03-02T13:43:39Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-02-23T18:29:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0365ccb0712efacf99936e94e92eb7ae63de4d5'/>
<id>urn:sha1:b0365ccb0712efacf99936e94e92eb7ae63de4d5</id>
<content type='text'>
Avoid clearing the entire readdir page cache if we're just doing forced
readdirplus for the 'ls -l' heuristic.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Convert readdir page cache to use a cookie based index</title>
<updated>2022-03-02T13:43:39Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-02-23T16:31:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f648022faa68ef76058aa121d1aa3a967d59cae8'/>
<id>urn:sha1:f648022faa68ef76058aa121d1aa3a967d59cae8</id>
<content type='text'>
Instead of using a linear index to address the pages, use the cookie of
the first entry, since that is what we use to match the page anyway.

This allows us to avoid re-reading the entire cache on a seekdir() type
of operation. The latter is very common when re-exporting NFS, and is a
major performance drain.

The change does affect our duplicate cookie detection, since we can no
longer rely on the page index as a linear offset for detecting whether
we looped backwards. However since we no longer do a linear search
through all the pages on each call to nfs_readdir(), this is less of a
concern than it was previously.
The other downside is that invalidate_mapping_pages() no longer can use
the page index to avoid clearing pages that have been read. A subsequent
patch will restore the functionality this provides to the 'ls -l'
heuristic.

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