Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30753337rwd; Thu, 6 Jul 2023 10:10:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlEgl2SXiNksNjccwrOsWDaB2RK7QCoZD5lzjXCGbX4J4JSkxBhfmzuPpa3SC0MSWOameBRb X-Received: by 2002:a17:90a:c85:b0:263:9e9b:5586 with SMTP id v5-20020a17090a0c8500b002639e9b5586mr1829426pja.44.1688663420362; Thu, 06 Jul 2023 10:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688663420; cv=none; d=google.com; s=arc-20160816; b=07niLBJqe/1XIuQN/Kqx/+H1dT9iOymN00y27wF2W0jWN5aDbr9iSH7lYmtug4Fd8M +STIjPqD/3hfLDn+d3MLC2XfIiUVc1weafc+n0gJtQPJtt7GS1aZyY6+g+JmdM1LIGyu IdWRRdQPCRowRjZJ/zZNxfL9Z/hDQT5D/QuqKdX9sZTrpCutrCYMNDgvUOMBStF0uV4H bQrbqQr2wfEn36NlWKg4/ypZ+AqVd1b7Xr/7zG6XrUGzsBGMoSPwrhgAF4eczJ6BbCK1 9ptXH0jT+l+Yei3Qwl5b4mUIRUN9CEZRu1essmOtkc4+NkWJH+5/+WBSkUgr10Sla7A9 KGpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JAiHhriZpvTS63ort7r8zwvuONWQrrwpaGdn7CXb3ds=; fh=LmSvGF8mKyhe+4SfmYOr3uCnhF0XAFkKvuoevTchCp0=; b=eF6A89C6MCyuN0pK2c7EtpBrSwgiOmRSy1oNST7Bak9TeKinTnTktE98BIm2+sYIz+ 68ZnTK/3KXdoNC/BkO4NZPlYbB6mHtelzfRXpXZFtPQIl4YuRcLC3jlkazebCIq8HP5m LmnP8M2Lfra26SZAh5rQPu6s7DZh+rv0tEsjqfLap3/QOQUzmrf4ToEbcR0HEN4Bpe0U kJ44D/EWryQTJM/cpgTIQQkL86m+Jrj8X5eMuikPJ9et+zcuSgtVSJG95+KBggJcr+jw 2anSdpecEuEUtcAKKZqGWZSn85BDpkqIN0cXOCWAaU7VZ1I2wOeHdKcAWjzCObrUaPPf iyGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GpY01BcJ; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bh20-20020a17090b049400b0026301cd4644si50466pjb.183.2023.07.06.10.10.06; Thu, 06 Jul 2023 10:10:20 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=GpY01BcJ; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232151AbjGFQza (ORCPT + 99 others); Thu, 6 Jul 2023 12:55:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbjGFQz3 (ORCPT ); Thu, 6 Jul 2023 12:55:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70A911FF0 for ; Thu, 6 Jul 2023 09:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688662461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JAiHhriZpvTS63ort7r8zwvuONWQrrwpaGdn7CXb3ds=; b=GpY01BcJaWxqkhsqUYIQUlR+gpG9nOcGkzZK3VPh9KWQ/TUDaO3oXdyv8unRRkdmwbDM2x 6LEinDOOdn6CCAfCkdoPXopPbCLX9zOIHKxNYjyyGypleFH62Ul9duD0VT4aXjTRxL7cxS 6V9fUIzVq7FG+72bXI75SyE3PYOQI8s= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-hF55TL8ROLa3eZ0TWubKBg-1; Thu, 06 Jul 2023 12:54:20 -0400 X-MC-Unique: hF55TL8ROLa3eZ0TWubKBg-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-993c24f3246so61647566b.1 for ; Thu, 06 Jul 2023 09:54:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688662459; x=1691254459; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JAiHhriZpvTS63ort7r8zwvuONWQrrwpaGdn7CXb3ds=; b=JVaOcfGsxktvAYAHJhXi+o4FskoFihLRqbMi3EO+xt9ikHRXbKLBkkZsbD41qE0hYI 7riCXNhuR1BPSr59Ii7YPnhyHipdQ4V1JpJ7iqnLly9HGvpE4aZyXnB30NBhJzyECira NzvTCgsaBfPWaM6fwKRXgO2+EhaGkfU2bTMgey9GTL1s+elDUMHA6nHI8NNk+oaowzcS zmNpRqP6V7lzoaH/TLXHd/ZCVhL3tgOlKZ4uo3pRG3xwvfiOF6t6tZKHbRFqWvz0UvSG 9yliaTTzfXeNBmtcZkVLTls2eY48DuZ2q59pmOb9WEHFWje2GzQG7R2zeyoVkXU0X2QJ 5JbA== X-Gm-Message-State: ABy/qLZEB/JXNB9ZZFlxrAu38jMtLgH0fP2vpK3+YDqocHpBBiNz0b0B jBICmuddO7tMU3nLR30fNexB/9vUvJuVktRvW7T0wW41XuQPOJgSQAGyYjAKZ0bQlFv1tLAoAip Xx55B9tCQhYAVcKD0CUeMIzgW X-Received: by 2002:a17:906:189:b0:978:8685:71d5 with SMTP id 9-20020a170906018900b00978868571d5mr2589622ejb.30.1688662459238; Thu, 06 Jul 2023 09:54:19 -0700 (PDT) X-Received: by 2002:a17:906:189:b0:978:8685:71d5 with SMTP id 9-20020a170906018900b00978868571d5mr2589600ejb.30.1688662458935; Thu, 06 Jul 2023 09:54:18 -0700 (PDT) Received: from sgarzare-redhat (host-79-46-200-163.retail.telecomitalia.it. [79.46.200.163]) by smtp.gmail.com with ESMTPSA id l10-20020a1709066b8a00b00992f2befcbcsm1023534ejr.180.2023.07.06.09.54.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 09:54:18 -0700 (PDT) Date: Thu, 6 Jul 2023 18:54:16 +0200 From: Stefano Garzarella To: Arseniy Krasnov Cc: Stefan Hajnoczi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Jason Wang , Bobby Eshleman , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@sberdevices.ru, oxffffaa@gmail.com Subject: Re: [RFC PATCH v5 06/17] vsock: fix EPOLLERR set on non-empty error queue Message-ID: References: <20230701063947.3422088-1-AVKrasnov@sberdevices.ru> <20230701063947.3422088-7-AVKrasnov@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20230701063947.3422088-7-AVKrasnov@sberdevices.ru> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 On Sat, Jul 01, 2023 at 09:39:36AM +0300, Arseniy Krasnov wrote: >If socket's error queue is not empty, EPOLLERR must be set. Otherwise, >reader of error queue won't detect data in it using EPOLLERR bit. >Currently for AF_VSOCK this is reproducible only with MSG_ZEROCOPY, as >this feature is the only user of an error queue of the socket. > >Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") Sorry if I confused you, but if without MSG_ZEROCOPY this is not an issue, then we can remove the Fixes tag. >Signed-off-by: Arseniy Krasnov >--- > Changelog: > v4 -> v5: > * Change commit message as Fix patch. Also add details that this > problem could be reproduced only with MSG_ZEROCOPY transmission > mode. > > net/vmw_vsock/af_vsock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >index efb8a0937a13..45fd20c4ed50 100644 >--- a/net/vmw_vsock/af_vsock.c >+++ b/net/vmw_vsock/af_vsock.c >@@ -1030,7 +1030,7 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, > poll_wait(file, sk_sleep(sk), wait); > mask = 0; > >- if (sk->sk_err) >+ if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue)) > /* Signify that there has been an error on this socket. */ > mask |= EPOLLERR; > >-- >2.25.1 >