Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1957398pxb; Mon, 8 Mar 2021 10:16:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpJ+ZqgaTiZQ2FHqp/Fum5XbDIVMNf2kf0alT1P4ORLARZS1+5254dE7Qu8ehlIM647Fbu X-Received: by 2002:a17:906:b747:: with SMTP id fx7mr16656182ejb.474.1615227360393; Mon, 08 Mar 2021 10:16:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615227360; cv=none; d=google.com; s=arc-20160816; b=QW8z9P/9M3ugN4NiveclT1Arapk+Nag7dyw9AJwbT5qNU9UkE+pOPSOxe1dEQ4cE3N sY8831au6MJJ8d/hJwwBXGnTK2Dhp1MBUiQ76u49lnfRcT9qamyGD403GyWeNxGGUI0C zOwKUIPCejSqpvE7Suh2Sg2/W9lOko5u3yVC9noFKbXws9bHbv33BjUva1HhVr60lbzm 0Zi7vkfJ9PjWMiQeh8ukoY3V3mHi668ZLrbuywgAPWP5SY2qGFCZfDekCDnyCV+4WXPS xbKiOOsUk3fNk52dM/Re3eSgbmpOGlP+xqdOYnptQQK1pu3ALqMi6t5yKvy/nBJDsBFI I6yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=pOvwgDCVFoFp8x5o6ZXGiZ7wNi+/BiGbbICIxdJ/OOE=; b=LLFBkj8PHY51FXupWMVDOK4ZTNA+gcl6rraOOx9bshYnVc2UrsNeQM706mR1V3OnS8 Oe+NlYfixekVmgeUrm1UJ+gNLORTH5MZ5IVDhAJfrBlc3Q7HEIZnFw6OBNJZ3yJdRiY7 POknUxzO5MJrpnQyyvMXmmyi4Xdb6M7azHUh2qPOU2JMWug60a4YA/QoVKOXYNkQt5BA gxL5ZSMo4ZBzK7Dri2kZ+Eod5CioJNs1u2blyaWYQT8+pc8bXNg7XS2yls9nqxiKZ2nD ccZmmqi0C5mIUGUSp85hu9asmuUCzIsrG7TU+eOPgG+Q9X/kPncqiVxMZJcotQj7rSU4 U+2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WPy8hndv; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si7632557ejj.317.2021.03.08.10.15.27; Mon, 08 Mar 2021 10:16:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WPy8hndv; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230412AbhCHSMo (ORCPT + 99 others); Mon, 8 Mar 2021 13:12:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22248 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229972AbhCHSMW (ORCPT ); Mon, 8 Mar 2021 13:12:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615227141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pOvwgDCVFoFp8x5o6ZXGiZ7wNi+/BiGbbICIxdJ/OOE=; b=WPy8hndv6rpFiZthoSeWC8kR8ONDE1fMPkSjVAZRoRQbCFSnUyTOizWVCKjH+sj5cJFvvX pMraPxytgYcpIBCCiRi+FMXjsyw3UMdHyqyHfIfeyPN1UbzzFBgmdyXBGMB7L6ffLlt1p9 V6Uqh6AaH+ryl0+qDIv2wbgAw9Oz1DE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-324-KS2bTa6xMweuFM387P3tPA-1; Mon, 08 Mar 2021 13:12:20 -0500 X-MC-Unique: KS2bTa6xMweuFM387P3tPA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A5391084D6D; Mon, 8 Mar 2021 18:12:19 +0000 (UTC) Received: from bearskin.sorenson.redhat.com (ovpn-114-44.phx2.redhat.com [10.3.114.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A3DD60C04; Mon, 8 Mar 2021 18:12:15 +0000 (UTC) From: Frank Sorenson To: linux-nfs@vger.kernel.org Cc: trond.myklebust@hammerspace.com, sorenson@redhat.com Subject: [PATCH] NFS: Correct size calculation for create reply length Date: Mon, 8 Mar 2021 12:12:13 -0600 Message-Id: <20210308181213.1182478-1-sorenson@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 --- fs/nfs/nfs3xdr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index ca10072644ff..ed1c83738c30 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c @@ -36,6 +36,7 @@ #define NFS3_pagepad_sz (1) /* Page padding */ #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)) @@ -73,7 +74,7 @@ #define NFS3_readlinkres_sz (1+NFS3_post_op_attr_sz+1+NFS3_pagepad_sz) #define NFS3_readres_sz (1+NFS3_post_op_attr_sz+3+NFS3_pagepad_sz) #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+NFS3_pagepad_sz) -- 2.29.2