Netdev List
 help / color / mirror / Atom feed
From: Ding Tianhong <dingtianhong@huawei.com>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: David Miller <davem@davemloft.net>, <pabeni@redhat.com>,
	<edumazet@google.com>, <hannes@stressinduktion.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	LinuxArm <linuxarm@huawei.com>
Subject: Re: [PATCH] iov_iter: don't revert if csum error
Date: Sat, 29 Apr 2017 10:12:45 +0800	[thread overview]
Message-ID: <1aa47008-d414-4731-e83b-39dbb9c2c2c3@huawei.com> (raw)
In-Reply-To: <20170428131631.GA22996@bistromath.localdomain>



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 <dingtianhong@huawei.com>
>> ---
>>  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
>>
> 

      parent reply	other threads:[~2017-04-29  2:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28 12:48 [PATCH] iov_iter: don't revert if csum error Ding Tianhong
2017-04-28 13:16 ` Sabrina Dubroca
2017-04-28 13:51   ` David Laight
2017-04-29  2:12   ` Ding Tianhong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1aa47008-d414-4731-e83b-39dbb9c2c2c3@huawei.com \
    --to=dingtianhong@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hannes@stressinduktion.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox