From patchwork Tue Dec 20 07:18:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 34946 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2821336wrn; Mon, 19 Dec 2022 23:26:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXtOFoTlxuGH4zB1W8XOyZ0Wb1GnobKaWvtKjlaPG6/ooyNTHNfeiim5k7PTzk/C8zkNHHDp X-Received: by 2002:a17:907:6f09:b0:7c0:a877:1cf1 with SMTP id sy9-20020a1709076f0900b007c0a8771cf1mr1138373ejc.12.1671521215810; Mon, 19 Dec 2022 23:26:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671521215; cv=none; d=google.com; s=arc-20160816; b=yiV7r+alA6YlJxO6wXD7ZSqe0tVnrEMzV2lnMsS3Gdu9FvxhGmfVQas8Oj67jSFVm3 Q+hOYjfQdUhdlbnMar+I389vVj9y22ERic3mBkpzVSm/lYNSn4ia5xVfwppBTbd4YVuV LO+2S1eieRNEF50GC8ATR/br8ZZyFd1B/KHu+VlnDHgzrIBbop19Gytx9IUf/nnzzWFh tApxi50qSNSGokLU9m0rnVlp1CN6dsltYSD7mHg5e7tcK/C23XVAMf8V3IN9LoGoNE1/ /g8t66jLWgF1eelX7TLYCq5mVmCRMQk8teczEu270jdL0uWO8cYREdjdqsqHtaHfzcdS apyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=gfJ1Wma4/Hix29ezKPf1BskSsFg9wHKm3F+uGRcLIc8=; b=jf+3T++mX5zJLZXc5fGjO5YOudpumaV26yqj9yymY3evXWtjnCAjd8w52QTF+rNLXl yAcJAeMtc4bWTify9H/CUrA3YfBoM8GWLTwOoCVBq1gomCJ7MnR8M7v1yLelTVUyc8+d hmht7E+81cO2Bu+L/DVonfZ9yMD9tZJQgeWHV0RvGtehRpGDxSuCAAd0rg+TCAuFmfEW mxC3zWPxQzs3zG7vwOElB/3y6y9BUvC+E5lVZ3VVt3TxY8NAbpASZPy8s6iqB2KVWQ5e 7KvpS3ZsJqke7C7XzGylMkGfQKYwTwyVXptCCJQ9Md9SHIg3MzOFhCelGYwLvywPmzzF 81nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=PzvFDnta; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a1-20020a17090680c100b007b874abc9b6si9025532ejx.790.2022.12.19.23.26.32; Mon, 19 Dec 2022 23:26:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=PzvFDnta; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbiLTHTL (ORCPT + 99 others); Tue, 20 Dec 2022 02:19:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233015AbiLTHSw (ORCPT ); Tue, 20 Dec 2022 02:18:52 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FC40E36; Mon, 19 Dec 2022 23:18:50 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id D47015FD04; Tue, 20 Dec 2022 10:18:48 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1671520728; bh=gfJ1Wma4/Hix29ezKPf1BskSsFg9wHKm3F+uGRcLIc8=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=PzvFDntaH3xlMg9EKiv5JUBq5YjAv4vQnSQH+05tkDJKTwcfGe+n25mxou2kzlcnW sK3eHc98X+9Vam/cjPt8j05X5OPiJGL20LBdg/XKAxO03wl6/Cm1qKtwX/TDK9L72W tiEGELmQxBZkdUGa8Agn+EndYFH+5zPIrzJs7gh9Ri3hgnWS7nZ8J/1zKqYRCJqIa0 FM7BFF6oEYYO1fqfxSlPRNQU5IXEv6lpf2vSNl0CGjz5BOWSFgalcGvhVZtzByTnAO WAZqNL2ZLkCWEXxn/FuwFkZLj/l7AhzzFZvJ8IseiSan0JajjK1LM6N0KxDKuvYO6c Ku+UCzR4QhbFQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Tue, 20 Dec 2022 10:18:48 +0300 (MSK) From: Arseniy Krasnov To: Stefano Garzarella , "David S. Miller" , "edumazet@google.com" , "Paolo Abeni" , Jakub Kicinski CC: "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , kernel , Bobby Eshleman , Krasnov Arseniy , Arseniy Krasnov Subject: [RFC PATCH v5 1/4] vsock: return errors other than -ENOMEM to socket Thread-Topic: [RFC PATCH v5 1/4] vsock: return errors other than -ENOMEM to socket Thread-Index: AQHZFENNrsKIykYAGk6rMUuI0TO6ow== Date: Tue, 20 Dec 2022 07:18:48 +0000 Message-ID: In-Reply-To: Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-ID: <63ACCD85517FFA40975768490B61028C@sberdevices.ru> MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/12/20 03:38:00 #20687629 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752717030230302575?= X-GMAIL-MSGID: =?utf-8?q?1752717030230302575?= This removes behaviour, where error code returned from any transport was always switched to ENOMEM. For example when user tries to send too big message via SEQPACKET socket, transport layers return EMSGSIZE, but this error code was always replaced with ENOMEM and returned to user. Signed-off-by: Bobby Eshleman Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella --- net/vmw_vsock/af_vsock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index d593d5b6d4b1..19aea7cba26e 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1861,8 +1861,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg, written = transport->stream_enqueue(vsk, msg, len - total_written); } + if (written < 0) { - err = -ENOMEM; + err = written; goto out_err; }