Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3690720ybv; Mon, 10 Feb 2020 04:47:02 -0800 (PST) X-Google-Smtp-Source: APXvYqyvqnjM1ICe1wWSkVKmxi5Ou99TCoomS8mNKjkRsYr1HzOXHlpMMVCMJ1cfzOPtw4pzSVr7 X-Received: by 2002:a05:6808:289:: with SMTP id z9mr687779oic.48.1581338822068; Mon, 10 Feb 2020 04:47:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581338822; cv=none; d=google.com; s=arc-20160816; b=mAj9QEh0bqUmsqxqabGwrbegfgfM6bEsgGbA5tte0z79cKz/+i/OlUZ3xRQ2VCo/zD ZL7IIOsvGLb+lSltD+juc+jJG50vHmDOHTvX6vU0fNDvT/PjoQv3jBBTShCdG+57XA4K DP5zyNp9XbkeGZWEr5JR5oXMMrIkmfy0v4lypXsdnJt3HjUUaRFpqqoIPbhBMIK4Dzqy ZEXyVocPTDeJYi2P6YHWyUAZbwFVaPIfQU/yWEnPere+ZAx97S6pIeu31GlESqCACcL1 ZCJjc/lu/WrI3/Ymh5DPRpHEeaMyNv1LOQN7fO1QngfxrNfSbNVIdPTxZXz8ZGsF13q8 pPng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OnLWNjz+tQJHKC9m9vGW0jaxiVxtScAM3sOC59awGu8=; b=YfF3gnHIUtQ0Nam1BRwcs1uATOVoPfyCAzohhNOgMhB0mr/TdUM1PcKkm59BRZXJ+I OfmNDcg4Nvw+ghywUvPK+Dq5No627AAPS77qVS+16itpTJmHSe/xZqFu3eSfarQkoa4k w3e4ZWullqDqW7ZZ3AsCIaATv6MMhT31w7by56+FSLwdekYQ+HcSoH9t6JBBqknpVsHC lDFyC97mzK/Nr7OE3wj2Hhz3vIyIsdorh72MBHmTfHX2vLzyvYANUQDdstJv+APMpBWY EcFPLdlQhb3D9s+t2DLK6A/XShH5uytejFScP7P683dJPpjjVxNEA2i1NRurYt7J5frj Roiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iGsopIxg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si122863oii.37.2020.02.10.04.46.50; Mon, 10 Feb 2020 04:47:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iGsopIxg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730628AbgBJMqj (ORCPT + 99 others); Mon, 10 Feb 2020 07:46:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:44552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727710AbgBJMln (ORCPT ); Mon, 10 Feb 2020 07:41:43 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A1BC12051A; Mon, 10 Feb 2020 12:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338502; bh=mOBlwavlbau8vB+rE6PQapruNs+NJ/+2dgZdrnVFrF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iGsopIxg5d2rZHBnTkYuw57/WcUxr2Enm+02szQRIWgdMIWbgnh3j2ZE2LEj8D3nG ux7rDSbxvRr9im63jDeCcg9OtVdP6m/JrUqTA/sieIkOtzlDtkhv0uYkS9f1oPEMLa ZmaMmcQ1/gi61IKHFPpuhv4lSmJLq2qH94tjgfPo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , "J. Bruce Fields" Subject: [PATCH 5.5 300/367] nfsd: Return the correct number of bytes written to the file Date: Mon, 10 Feb 2020 04:33:33 -0800 Message-Id: <20200210122451.276054807@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Trond Myklebust commit 09a80f2aef06b7c86143f5c14efd3485e0d2c139 upstream. We must allow for the fact that iov_iter_write() could have returned a short write (e.g. if there was an ENOSPC issue). Fixes: d890be159a71 "nfsd: Add I/O trace points in the NFSv4 write path" Signed-off-by: Trond Myklebust Signed-off-by: J. Bruce Fields Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/vfs.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -975,6 +975,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, s host_err = vfs_iter_write(file, &iter, &pos, flags); if (host_err < 0) goto out_nfserr; + *cnt = host_err; nfsdstats.io_write += *cnt; fsnotify_modify(file);