From: Vishnu Dasa via Virtualization <virtualization@lists.linux-foundation.org>
To: Stefano Garzarella <sgarzare@redhat.com>,
Arseniy Krasnov <avkrasnov@sberdevices.ru>
Cc: Bobby Eshleman <bobby.eshleman@bytedance.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Pv-drivers <Pv-drivers@vmware.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux Virtualization <virtualization@lists.linux-foundation.org>,
Krasnov Arseniy <oxffffaa@gmail.com>,
Bryan Tan <bryantan@vmware.com>,
Eric Dumazet <edumazet@google.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
kernel <kernel@sberdevices.ru>, Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [RFC PATCH v2 2/3] vsock/vmci: convert VMCI error code to -ENOMEM
Date: Thu, 30 Mar 2023 15:35:12 +0000 [thread overview]
Message-ID: <554FE762-95AF-4D14-8BF8-BEC610937C77@vmware.com> (raw)
In-Reply-To: <wzkkagpfxfi7nioixpcmz4uscxojilwhuj4joslwevkm25m6h7@z4yl33oe7wqu>
> On Mar 30, 2023, at 1:19 AM, Stefano Garzarella <sgarzare@redhat.com> wrote:
>
> !! External Email
>
> On Thu, Mar 30, 2023 at 10:07:36AM +0300, Arseniy Krasnov wrote:
>> This adds conversion of VMCI specific error code to general -ENOMEM. It
>> is needed, because af_vsock.c passes error value returned from transport
>> to the user.
>>
>> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
>> ---
>> net/vmw_vsock/vmci_transport.c | 19 ++++++++++++++++---
>> 1 file changed, 16 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
>> index 36eb16a40745..45de3e75597f 100644
>> --- a/net/vmw_vsock/vmci_transport.c
>> +++ b/net/vmw_vsock/vmci_transport.c
>> @@ -1831,10 +1831,17 @@ static ssize_t vmci_transport_stream_dequeue(
>> size_t len,
>> int flags)
>> {
>> + int err;
>
> Please, use the same type returned by the function.
>
>> +
>> if (flags & MSG_PEEK)
>> - return vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len, 0);
>> + err = vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len, 0);
>> else
>> - return vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len, 0);
>> + err = vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len, 0);
>> +
>> + if (err < 0)
>> + err = -ENOMEM;
>> +
>> + return err;
>> }
>>
>> static ssize_t vmci_transport_stream_enqueue(
>> @@ -1842,7 +1849,13 @@ static ssize_t vmci_transport_stream_enqueue(
>> struct msghdr *msg,
>> size_t len)
>> {
>> - return vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0);
>> + int err;
>
> Ditto.
>
>> +
>> + err = vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0);
>> + if (err < 0)
>> + err = -ENOMEM;
>> +
>> + return err;
>> }
>
> @Vishnu: should we backport the change for
> vmci_transport_stream_enqueue() to stable branches?
>
> In this case I would split this patch and I would send the
> vmci_transport_stream_enqueue() change to the net branch including:
>
> Fixes: c43170b7e157 ("vsock: return errors other than -ENOMEM to socket")
Yes, good point. It would be better to do it this way for correctness.
Thanks,
Vishnu
>
> Thanks,
> Stefano
>
>
> !! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
prev parent reply other threads:[~2023-03-30 15:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <60abc0da-0412-6e25-eeb0-8e32e3ec21e7@sberdevices.ru>
[not found] ` <b910764f-a193-e684-a762-f941883a0745@sberdevices.ru>
2023-03-30 8:02 ` [RFC PATCH v2 1/3] vsock: return errors other than -ENOMEM to socket Stefano Garzarella
[not found] ` <94d33849-d3c1-7468-72df-f87f897bafd2@sberdevices.ru>
2023-03-30 8:19 ` [RFC PATCH v2 2/3] vsock/vmci: convert VMCI error code to -ENOMEM Stefano Garzarella
2023-03-30 15:35 ` Vishnu Dasa via Virtualization [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=554FE762-95AF-4D14-8BF8-BEC610937C77@vmware.com \
--to=virtualization@lists.linux-foundation.org \
--cc=Pv-drivers@vmware.com \
--cc=avkrasnov@sberdevices.ru \
--cc=bobby.eshleman@bytedance.com \
--cc=bryantan@vmware.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel@sberdevices.ru \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oxffffaa@gmail.com \
--cc=pabeni@redhat.com \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.com \
--cc=vdasa@vmware.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;
as well as URLs for NNTP newsgroup(s).