Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3281624pxu; Tue, 15 Dec 2020 03:15:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeVuW/zPUDsvYzHxzjQp8lrfWExyvONyMRv+bP9gGBnaOm+e4Ea46qtf7IU5qzykXjFruH X-Received: by 2002:a05:6402:30ac:: with SMTP id df12mr30081523edb.175.1608030908109; Tue, 15 Dec 2020 03:15:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608030908; cv=none; d=google.com; s=arc-20160816; b=XoAq/YsBYatdNQaUnVxZ8wHFbU8MzFCIezc1Qr7N0XJa/vAKWtbqS6GKRBfUhPWM5k s/Mgj0TH4FBKnKTdjMLdBlJ0sQZnz+SijykM9lV3KnithiQ5pgIY1wpxeuiN+mY65Y/8 cFkqc2D2lhPfvhNgLudnE1UgpoKEucMXf3j9vxX82tk/liadRdGNkE8bhsFUg7EDNgfl zhx1xp8CPF5ghxQ2BACbubJjyAbjozHDOnRowNPdXyYAmLoAI/YORhsRiJIoM7O32vbb aV9Z+G46AibXzIUrKGAOUJ589bUQr8TgrqS0yX7BEaDD44wcXSUkzE4Se7Akf7ZSl3VK 1xnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Yx7SevcBUttZRGBUgn4zpJi1UCc9qXZWWCyxJCQZZZI=; b=QXQ/yNAFOBzfpkv6SW9OOz6I+JvUky4VV8uJ2nD40izgYmBpR0GG5OPbl4G8si0Ps6 g7OZzLxJveel2NlnZFNHi/U0X4L9vquesNcqN3i8I3ZVDN7kQQ2yXWmcKecBpcTEkn42 pIfOy6vkBo98UWM0lnai2dJ1D3v0ayV+lCiVDOyeXEl4J+B9s69NFt/HVXVL3ToW7cN5 4atFIaeSjqVd3CWtuAbQRmeYW51ejtbBKpqInarpiR7yoXTLf09cbDKaCU8f/mmPm262 shnskqNtqfNLSImZuiTjbxnHrWNVWbuHHZ+XPm3OsJMj3cVd6ZiPilBmjz3XJZ+Ot00N 2spQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=NV7BwIrw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si703383ejb.157.2020.12.15.03.14.44; Tue, 15 Dec 2020 03:15:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=NV7BwIrw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727985AbgLOLLp (ORCPT + 99 others); Tue, 15 Dec 2020 06:11:45 -0500 Received: from mx2.suse.de ([195.135.220.15]:49714 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727406AbgLOLLo (ORCPT ); Tue, 15 Dec 2020 06:11:44 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1608030658; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Yx7SevcBUttZRGBUgn4zpJi1UCc9qXZWWCyxJCQZZZI=; b=NV7BwIrwiGRFQaAQ96DIiW1UlD6Hby+vHIu/rM2INcEJ1fag87Bf4iwtbi51xV/LVwhL4h 8vQ2G9q4P3cv2r+JkeedQ6A/lETc6SGYmEbelS/G9TIUSq5fWDNBu0M8Hiqz3azUYnoYa2 yLUH8ytqC/GKmzvACYDQwY9AVnV1Yxw= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BF0FAAC7F; Tue, 15 Dec 2020 11:10:58 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini Subject: [PATCH v2] xen/xenbus: make xs_talkv() interruptible Date: Tue, 15 Dec 2020 12:10:55 +0100 Message-Id: <20201215111055.3810-1-jgross@suse.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case a process waits for any Xenstore action in the xenbus driver it should be interruptible by signals. Signed-off-by: Juergen Gross --- V2: - don't special case SIGKILL as libxenstore is handling -EINTR fine --- drivers/xen/xenbus/xenbus_xs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 3a06eb699f33..17c8f8a155fd 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -205,8 +205,15 @@ static bool test_reply(struct xb_req_data *req) static void *read_reply(struct xb_req_data *req) { + int ret; + do { - wait_event(req->wq, test_reply(req)); + ret = wait_event_interruptible(req->wq, test_reply(req)); + + if (ret == -ERESTARTSYS && signal_pending(current)) { + req->msg.type = XS_ERROR; + return ERR_PTR(-EINTR); + } if (!xenbus_ok()) /* -- 2.26.2