Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4059176pxu; Wed, 9 Dec 2020 07:24:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJx43Xiq55jl07xDBZx3m0td2QHxWsuxOwm9y92oHAZqqTKOGNGHYhazApHn0J9705BP0pm2 X-Received: by 2002:a50:d6dc:: with SMTP id l28mr2462454edj.286.1607527493004; Wed, 09 Dec 2020 07:24:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607527492; cv=none; d=google.com; s=arc-20160816; b=ZDCYIBtBD/PDs2V4MNdVxF6laJKxGnAopSRbPF9uV5TMjnZx0kAycqlxMWYQU45bG4 UmKVZ5aX7glCFPpN5cfsD7Vy4LuhRQPf92YIim5Oal2KHq/7Uz77/HQhludYSdL09VVn 9BGBEwqgsvufIT/CajoX+8ZIfioI+j3tkEvonPZKKPPEZtN8OXDVg4E7pFYW2L6tODyo pCoXalC8SNKkmLrcj/CyrV3Kk2yrtyfcU4qAyHrFKCxKkFHC7Nzj5ayLtbsTnjbMCcon J7SLYe3NJDKPU44yKDo3ji3p6dCD+Zgcw4id61NV8hSLsR16GC3vmnGI0QUnzYndVIkG 6nSg== 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 :references:in-reply-to:message-id:date:subject:to:from; bh=4bXxLKGZWJq5LjQjoAIbfjfk6rUcY9+Dei9JP56yfp4=; b=G3VlKgXV6M20M3zBYKQR47dHWjB1410SaUTog2u6k11+LNanimYzsTQO+yq6ifBMAg ldiqJ0vtlj13JNA8J+71LJWfc60rUMsH0ZdI6Ib4+oI5xPyYEz/ey/t6klZ26zxVC6Lb 8msK0tYXo/ZKJWcipkklzDm22UexFbsXJakdagvD+n4Chl22Qg92VsZh46i3u9EYzBS7 6JmzKZfmi/QuDDQuS+xz6tQ8PHSRBFq+kFDA3OuatIrSJ5n0iathqpJCPnEMVy2QoTIe 1TzmO2B55KwsdmuZQmMSZ+BqMZrw0m4rK40Gw2VweWD3SWH/6dCFKqLuV25cZb4sJksP 38Sw== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si1033104eda.110.2020.12.09.07.24.29; Wed, 09 Dec 2020 07:24:52 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733105AbgLIOto (ORCPT + 99 others); Wed, 9 Dec 2020 09:49:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:50668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733107AbgLIOto (ORCPT ); Wed, 9 Dec 2020 09:49:44 -0500 From: trondmy@kernel.org Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-nfs@vger.kernel.org Subject: [PATCH 16/16] nfsd: Don't set eof on a truncated READ_PLUS Date: Wed, 9 Dec 2020 09:48:01 -0500 Message-Id: <20201209144801.700778-17-trondmy@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201209144801.700778-16-trondmy@kernel.org> References: <20201209144801.700778-1-trondmy@kernel.org> <20201209144801.700778-2-trondmy@kernel.org> <20201209144801.700778-3-trondmy@kernel.org> <20201209144801.700778-4-trondmy@kernel.org> <20201209144801.700778-5-trondmy@kernel.org> <20201209144801.700778-6-trondmy@kernel.org> <20201209144801.700778-7-trondmy@kernel.org> <20201209144801.700778-8-trondmy@kernel.org> <20201209144801.700778-9-trondmy@kernel.org> <20201209144801.700778-10-trondmy@kernel.org> <20201209144801.700778-11-trondmy@kernel.org> <20201209144801.700778-12-trondmy@kernel.org> <20201209144801.700778-13-trondmy@kernel.org> <20201209144801.700778-14-trondmy@kernel.org> <20201209144801.700778-15-trondmy@kernel.org> <20201209144801.700778-16-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust If the READ_PLUS operation was truncated due to an error, then ensure we clear the 'eof' flag. Signed-off-by: Trond Myklebust --- fs/nfsd/nfs4xdr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 26f6e277101d..5f5169b9c2e9 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -4736,14 +4736,15 @@ nfsd4_encode_read_plus(struct nfsd4_compoundres *resp, __be32 nfserr, if (nfserr && segments == 0) xdr_truncate_encode(xdr, starting_len); else { - tmp = htonl(eof); - write_bytes_to_xdr_buf(xdr->buf, starting_len, &tmp, 4); - tmp = htonl(segments); - write_bytes_to_xdr_buf(xdr->buf, starting_len + 4, &tmp, 4); if (nfserr) { xdr_truncate_encode(xdr, last_segment); nfserr = nfs_ok; + eof = 0; } + tmp = htonl(eof); + write_bytes_to_xdr_buf(xdr->buf, starting_len, &tmp, 4); + tmp = htonl(segments); + write_bytes_to_xdr_buf(xdr->buf, starting_len + 4, &tmp, 4); } return nfserr; -- 2.29.2