<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/fs/nfs/nfs3xdr.c, branch docs-6.8</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-6.8</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-6.8'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2023-08-30T15:08:27+00:00</updated>
<entry>
<title>NFS: Guard against READDIR loop when entry names exceed MAXNAMELEN</title>
<updated>2023-08-30T15:08:27+00:00</updated>
<author>
<name>Benjamin Coddington</name>
<email>bcodding@redhat.com</email>
</author>
<published>2023-08-22T18:22:38+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f67b55b6588bcf9316a1e6e8d529100a5aa3ebe6'/>
<id>urn:sha1:f67b55b6588bcf9316a1e6e8d529100a5aa3ebe6</id>
<content type='text'>
Commit 64cfca85bacd asserts the only valid return values for
nfs2/3_decode_dirent should not include -ENAMETOOLONG, but for a server
that sends a filename3 which exceeds MAXNAMELEN in a READDIR response the
client's behavior will be to endlessly retry the operation.

We could map -ENAMETOOLONG into -EBADCOOKIE, but that would produce
truncated listings without any error.  The client should return an error
for this case to clearly assert that the server implementation must be
corrected.

Fixes: 64cfca85bacd ("NFS: Return valid errors from nfs2/3_decode_dirent()")
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: Optimise away the previous cookie field</title>
<updated>2022-03-02T13:43:39+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@hammerspace.com</email>
</author>
<published>2022-02-27T17:46:24+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.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>NFSv4: Ask for a full XDR buffer of readdir goodness</title>
<updated>2022-03-02T13:43:38+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@hammerspace.com</email>
</author>
<published>2022-02-18T17:04:06+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=c49c68944f2d4c3827cd8ac7f70da277674d11ad'/>
<id>urn:sha1:c49c68944f2d4c3827cd8ac7f70da277674d11ad</id>
<content type='text'>
Instead of pretending that we know the ratio of directory info vs
readdirplus attribute info, just set the 'dircount' field to the same
value as the 'maxcount' field.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Return valid errors from nfs2/3_decode_dirent()</title>
<updated>2022-02-28T15:11:32+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@hammerspace.com</email>
</author>
<published>2022-02-24T15:59:37+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=64cfca85bacde54caa64e0ab855c48734894fa37'/>
<id>urn:sha1:64cfca85bacde54caa64e0ab855c48734894fa37</id>
<content type='text'>
Valid return values for decode_dirent() callback functions are:
 0: Success
 -EBADCOOKIE: End of directory
 -EAGAIN: End of xdr_stream

All errors need to map into one of those three values.

Fixes: 573c4e1ef53a ("NFS: Simplify -&gt;decode_dirent() calling sequence")
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: NFSv2/v3 clients should never be setting NFS_CAP_XATTR</title>
<updated>2022-02-25T23:50:13+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@hammerspace.com</email>
</author>
<published>2022-02-22T23:20:38+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b622ffe1d9ecbac71f0cddb52ff0831efdf8fb83'/>
<id>urn:sha1:b622ffe1d9ecbac71f0cddb52ff0831efdf8fb83</id>
<content type='text'>
Ensure that we always initialise the 'xattr_support' field in struct
nfs_fsinfo, so that nfs_server_set_fsinfo() doesn't declare our NFSv2/v3
client to be capable of supporting the NFSv4.2 xattr protocol by setting
the NFS_CAP_XATTR capability.

This configuration can cause nfs_do_access() to set access mode bits
that are unsupported by the NFSv3 ACCESS call, which may confuse
spec-compliant servers.

Reported-by: Olga Kornievskaia &lt;kolga@netapp.com&gt;
Fixes: b78ef845c35d ("NFSv4.2: query the server for extended attribute support")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Default change_attr_type to NFS4_CHANGE_TYPE_IS_UNDEFINED</title>
<updated>2021-10-04T00:49:06+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@hammerspace.com</email>
</author>
<published>2021-09-26T18:05:04+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=eea413308f2e6deb00f061f18081a53f3ecc8cc6'/>
<id>urn:sha1:eea413308f2e6deb00f061f18081a53f3ecc8cc6</id>
<content type='text'>
Both NFSv3 and NFSv2 generate their change attribute from the ctime
value that was supplied by the server. However the problem is that there
are plenty of servers out there with ctime resolutions of 1ms or worse.
In a modern performance system, this is insufficient when trying to
decide which is the most recent set of attributes when, for instance, a
READ or GETATTR call races with a WRITE or SETATTR.

For this reason, let's revert to labelling the NFSv2/v3 change
attributes as NFS4_CHANGE_TYPE_IS_UNDEFINED. This will ensure we protect
against such races.

Fixes: 7b24dacf0840 ("NFS: Another inode revalidation improvement")
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Tested-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>NFSv4: Catch and trace server filehandle encoding errors</title>
<updated>2021-04-14T13:36:29+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@hammerspace.com</email>
</author>
<published>2021-04-01T18:03:26+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=eb3d58c68e39fad68d8054e0324eb06d82dcedbb'/>
<id>urn:sha1:eb3d58c68e39fad68d8054e0324eb06d82dcedbb</id>
<content type='text'>
If the server returns a filehandle with an invalid length, then trace
that, and return an EREMOTEIO error.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFSv4: Add support for the NFSv4.2 "change_attr_type" attribute</title>
<updated>2021-04-13T14:04:05+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@hammerspace.com</email>
</author>
<published>2021-03-26T13:50:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=7f08a3359a3c1e39c2a118fbbe583d8c8db14ace'/>
<id>urn:sha1:7f08a3359a3c1e39c2a118fbbe583d8c8db14ace</id>
<content type='text'>
The change_attr_type allows the server to provide a description of how
the change attribute will behave. This again will allow the client to
optimise its behaviour w.r.t. attribute revalidation.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Correct size calculation for create reply length</title>
<updated>2021-03-08T18:40:12+00:00</updated>
<author>
<name>Frank Sorenson</name>
<email>sorenson@redhat.com</email>
</author>
<published>2021-03-08T18:12:13+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ad3dbe35c833c2d4d0bbf3f04c785d32f931e7c9'/>
<id>urn:sha1:ad3dbe35c833c2d4d0bbf3f04c785d32f931e7c9</id>
<content type='text'>
CREATE requests return a post_op_fh3, rather than nfs_fh3. The
post_op_fh3 includes an extra word to indicate 'handle_follows'.

Without that additional word, create fails when full 64-byte
filehandles are in use.

Add NFS3_post_op_fh_sz, and correct the size calculation for
NFS3_createres_sz.

Signed-off-by: Frank Sorenson &lt;sorenson@redhat.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Clean up the handling of page padding in rpc_prepare_reply_pages()</title>
<updated>2020-12-02T19:05:53+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@hammerspace.com</email>
</author>
<published>2020-11-22T01:46:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9ed5af268e88f6e5b65376be98d652b37cb20d7b'/>
<id>urn:sha1:9ed5af268e88f6e5b65376be98d652b37cb20d7b</id>
<content type='text'>
rpc_prepare_reply_pages() currently expects the 'hdrsize' argument to
contain the length of the data that we expect to want placed in the head
kvec plus a count of 1 word of padding that is placed after the page data.
This is very confusing when trying to read the code, and sometimes leads
to callers adding an arbitrary value of '1' just in order to satisfy the
requirement (whether or not the page data actually needs such padding).

This patch aims to clarify the code by changing the 'hdrsize' argument
to remove that 1 word of padding. This means we need to subtract the
padding from all the existing callers.

Fixes: 02ef04e432ba ("NFS: Account for XDR pad of buf-&gt;pages")
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
</feed>
