]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSv4.2: Fix up READ_PLUS alignment
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 30 Nov 2022 18:15:26 +0000 (13:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:48 +0000 (09:42 +0200)
[ Upstream commit f8527028a7e52da884055c401abc04e0b0c84285 ]

Assume that the first segment will be a DATA segment, and place the data
directly into the xdr pages so it doesn't need to be shifted.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Stable-dep-of: 8d18f6c5bb86 ("NFSv4.2: Fix READ_PLUS size calculations")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs42xdr.c

index ae034a1c53efdfc33691028ed6be27a7430e4474..ef3b150970ff62c958b6d0bef8a457d009afed62 100644 (file)
 #define decode_deallocate_maxsz                (op_decode_hdr_maxsz)
 #define encode_read_plus_maxsz         (op_encode_hdr_maxsz + \
                                         encode_stateid_maxsz + 3)
-#define NFS42_READ_PLUS_SEGMENT_SIZE   (1 /* data_content4 */ + \
+#define NFS42_READ_PLUS_DATA_SEGMENT_SIZE \
+                                       (1 /* data_content4 */ + \
                                         2 /* data_info4.di_offset */ + \
-                                        2 /* data_info4.di_length */)
+                                        1 /* data_info4.di_length */)
 #define decode_read_plus_maxsz         (op_decode_hdr_maxsz + \
                                         1 /* rpr_eof */ + \
                                         1 /* rpr_contents count */ + \
-                                        2 * NFS42_READ_PLUS_SEGMENT_SIZE)
+                                        NFS42_READ_PLUS_DATA_SEGMENT_SIZE)
 #define encode_seek_maxsz              (op_encode_hdr_maxsz + \
                                         encode_stateid_maxsz + \
                                         2 /* offset */ + \