Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2999859AbdD2CNd (ORCPT ); Fri, 28 Apr 2017 22:13:33 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:5900 "EHLO dggrg03-dlp.huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2999831AbdD2CNV (ORCPT ); Fri, 28 Apr 2017 22:13:21 -0400 Subject: Re: [PATCH] iov_iter: don't revert if csum error To: Sabrina Dubroca References: <080dafec-c57f-0546-4d2f-ce4a31222e25@huawei.com> <20170428131631.GA22996@bistromath.localdomain> CC: David Miller , , , , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , LinuxArm From: Ding Tianhong Message-ID: <1aa47008-d414-4731-e83b-39dbb9c2c2c3@huawei.com> Date: Sat, 29 Apr 2017 10:12:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170428131631.GA22996@bistromath.localdomain> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.23.32] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.5903F6A7.0038,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 8481cb03ddf205d04fc7554865d076f2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1239 Lines: 43 On 2017/4/28 21:16, Sabrina Dubroca wrote: > 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. > Yes, should not change the return value, thanks. Ding >> if (skb_copy_datagram_msg(skb, hlen, msg, chunk)) >> goto fault; >> } else { >> -- >> 1.8.3.1 >> >