From: Ding Tianhong <dingtianhong@huawei.com>
To: 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>,
"weiyongjun (A)" <weiyongjun1@huawei.com>,
Al Viro <viro@ZenIV.linux.org.uk>
Subject: Miss it//Re: [PATCH v3] iov_iter: don't revert iov buffer if csum error
Date: Wed, 3 May 2017 15:15:51 +0800 [thread overview]
Message-ID: <33b65653-6b83-6db2-4393-b306caae7d92@huawei.com> (raw)
In-Reply-To: <12d4d81f-40c7-c83d-11d6-290acc084695@huawei.com>
Miss it, it is already in the kernel tree, sorry for the noisy.
On 2017/5/3 15:02, Ding Tianhong wrote:
> The patch 327868212381 (make skb_copy_datagram_msg() et.al. preserve
> ->msg_iter on error) will revert the iov buffer if copy to iter
> failed, but it didn't copy any datagram if the skb_checksum_complete
> error, so no need to revert any data at this place.
>
> v2: Sabrina notice that return -EFAULT when checksum error is not correct
> here, it would confuse the caller about the return value, so fix it.
>
> v3: According AI's suggestion, directly return -EINVAL when __skb_checksum_complete()
> return error is a more simple solution.
>
> Fixes: 327868212381 ("make skb_copy_datagram_msg() et.al. preserve->msg_iter on error")
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@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 0306543..726bf8a 100644
> --- a/net/core/datagram.c
> +++ b/net/core/datagram.c
> @@ -719,7 +719,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;
> + return -EINVAL;
> if (skb_copy_datagram_msg(skb, hlen, msg, chunk))
> goto fault;
> } else {
>
prev parent reply other threads:[~2017-05-03 7:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 7:02 [PATCH v3] iov_iter: don't revert iov buffer if csum error Ding Tianhong
2017-05-03 7:07 ` Al Viro
2017-05-03 7:15 ` 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=33b65653-6b83-6db2-4393-b306caae7d92@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=viro@ZenIV.linux.org.uk \
--cc=weiyongjun1@huawei.com \
/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