Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165434AbdD1NQw (ORCPT ); Fri, 28 Apr 2017 09:16:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56942 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S939820AbdD1NQg (ORCPT ); Fri, 28 Apr 2017 09:16:36 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EFC667072D Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=queasysnail.net Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=sd@queasysnail.net DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com EFC667072D Date: Fri, 28 Apr 2017 15:16:31 +0200 From: Sabrina Dubroca To: Ding Tianhong Cc: David Miller , pabeni@redhat.com, edumazet@google.com, hannes@stressinduktion.org, "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , LinuxArm Subject: Re: [PATCH] iov_iter: don't revert if csum error Message-ID: <20170428131631.GA22996@bistromath.localdomain> References: <080dafec-c57f-0546-4d2f-ce4a31222e25@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <080dafec-c57f-0546-4d2f-ce4a31222e25@huawei.com> User-Agent: Mutt/1.8.2 (2017-04-18) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 28 Apr 2017 13:16:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1109 Lines: 37 2017-04-28, 20:48:45 +0800, Ding Tianhong wrote: > The patch 3278682 (make skb_copy_datagram_msg() et.al. preserve > ->msg_iter on error) will revert the iov buffer if copy to iter > failed, but it looks no need to revert for csum error, so fix it. > > Fixes: 3278682 ("make skb_copy_datagram_msg() et.al. preserve->msg_iter on error") Please use 12 digits, ie 327868212381. > Signed-off-by: Ding Tianhong > --- > net/core/datagram.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/core/datagram.c b/net/core/datagram.c > index f4947e7..475a8e9 100644 > --- a/net/core/datagram.c > +++ b/net/core/datagram.c > @@ -760,7 +760,7 @@ int skb_copy_and_csum_datagram_msg(struct sk_buff *skb, > > if (msg_data_left(msg) < chunk) { > if (__skb_checksum_complete(skb)) > - goto csum_error; > + goto fault; With this patch, skb_copy_and_csum_datagram_msg() will return -EFAULT for an incorrect checksum, that doesn't seem right. > if (skb_copy_datagram_msg(skb, hlen, msg, chunk)) > goto fault; > } else { > -- > 1.8.3.1 > -- Sabrina