Received: by 10.223.176.5 with SMTP id f5csp94855wra; Fri, 2 Feb 2018 17:36:00 -0800 (PST) X-Google-Smtp-Source: AH8x225j00dOmDtZiPuk3Q3R4DOSRVGc5vxVPNqXT4lGdezRBlXuF+l8hrHC6mP9ryh4uzw6jfoe X-Received: by 10.98.9.202 with SMTP id 71mr41989807pfj.122.1517621760226; Fri, 02 Feb 2018 17:36:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517621760; cv=none; d=google.com; s=arc-20160816; b=tAYal7IiSnN9WETI193UcrHJotDEB96qVp0BbHhUHHdr6gxh5M7Mrvlag+yVzLhoq8 H3xiuFkq87WG505eU5QtcTKiselEQUDoIurSWvdjX5RR7X5nHk001V3Ghh+nZgjcPPjY 1GSQTA3PM9ETFt6fUOrolBcxEhbWaVT79qUWFDdQeubrvY7pDbCB5dUh+4/ti4HlkdVH fX+mqIUsIeQq6ELC5q/jg4d6xg/nO5B5TQxPmhtXS1PDpLReMu6J0c+w3f6/b706lMyg 4qkSWTL3VTbVwUcz6+9SJNlUt1pKDGxvBeNVepaMYHCvRm5ddz41fanlcLdlaADFfdU2 1GuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date:dmarc-filter:arc-authentication-results; bh=mY7z8Hr52eiLEVL88bunFlMGbWXpWrRLChLZwgMN8bw=; b=TAUqyXOUI5vYSqT2BI8fc0GyrBNqHfFX4RhnVGLRZ2Ld/sMW/smF+eidKIhcu8gc9J E8lruTRsxZPhONqTuAGXsdv5P5mvNGsfhGirxObBxcKAsff8WgNAozZkA7O5oypD7cQV aZgJYnvi/rvpvaZlBtNyEztqeAo2tObeyxMOOFssA4/3RFts8TpbEXSMZG4K6e8ZZIga dC8IukYB2ZMz+yDiO1khyWou9iZHXn18jzlymIz5UTQ75IHVdl+hOiYCpKMdqCss0eIn gV7isgPRWR60VelHWgPZG3it8fE29SEJDwIcwh23pN81VOSLlLo6aS2PNMoelEMaMWhk cUNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3-v6si1209891pli.534.2018.02.02.17.35.44; Fri, 02 Feb 2018 17:36:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbeBCBeP (ORCPT + 99 others); Fri, 2 Feb 2018 20:34:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:42928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751468AbeBCBeL (ORCPT ); Fri, 2 Feb 2018 20:34:11 -0500 Received: from [10.135.48.227] (unknown [12.248.85.146]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4108821785; Sat, 3 Feb 2018 01:34:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4108821785 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=sstabellini@kernel.org Date: Fri, 2 Feb 2018 17:34:09 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: jgross@suse.com, boris.ostrovsky@oracle.com cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, sstabellini@kernel.org Subject: [PATCH] pvcalls-back: do not return error on inet_accept EAGAIN Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the client sends a regular blocking accept request, the backend is expected to return only when the accept is completed, simulating a blocking behavior, or return an error. Specifically, on EAGAIN from inet_accept, the backend shouldn't return "EAGAIN" to the client. Instead, it should simply continue the wait. Otherwise, the client will send another accept request, which will cause another EAGAIN to be sent back, which is a waste of resources and not conforming to the expected behavior. Change the behavior by turning the "goto error" into a return. Signed-off-by: Stefano Stabellini diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c index c7822d8..156e5ae 100644 --- a/drivers/xen/pvcalls-back.c +++ b/drivers/xen/pvcalls-back.c @@ -548,7 +548,7 @@ static void __pvcalls_back_accept(struct work_struct *work) ret = inet_accept(mappass->sock, sock, O_NONBLOCK, true); if (ret == -EAGAIN) { sock_release(sock); - goto out_error; + return; } map = pvcalls_new_active_socket(fedata,