]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
NFS: Correct size calculation for create reply length
authorFrank Sorenson <sorenson@redhat.com>
Mon, 8 Mar 2021 18:12:13 +0000 (12:12 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:41:39 +0000 (14:41 +0200)
[ Upstream commit ad3dbe35c833c2d4d0bbf3f04c785d32f931e7c9 ]

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 <sorenson@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs3xdr.c

index 267126d32ec0f6a1d5d09293ef9427585edca9c6..4a68837e92ea44228d0fb262376ea8f09da69d7e 100644 (file)
@@ -33,6 +33,7 @@
  */
 #define NFS3_fhandle_sz                (1+16)
 #define NFS3_fh_sz             (NFS3_fhandle_sz)       /* shorthand */
+#define NFS3_post_op_fh_sz     (1+NFS3_fh_sz)
 #define NFS3_sattr_sz          (15)
 #define NFS3_filename_sz       (1+(NFS3_MAXNAMLEN>>2))
 #define NFS3_path_sz           (1+(NFS3_MAXPATHLEN>>2))
@@ -70,7 +71,7 @@
 #define NFS3_readlinkres_sz    (1+NFS3_post_op_attr_sz+1)
 #define NFS3_readres_sz                (1+NFS3_post_op_attr_sz+3)
 #define NFS3_writeres_sz       (1+NFS3_wcc_data_sz+4)
-#define NFS3_createres_sz      (1+NFS3_fh_sz+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
+#define NFS3_createres_sz      (1+NFS3_post_op_fh_sz+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
 #define NFS3_renameres_sz      (1+(2 * NFS3_wcc_data_sz))
 #define NFS3_linkres_sz                (1+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
 #define NFS3_readdirres_sz     (1+NFS3_post_op_attr_sz+2)