All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/xenbus: make xs_talkv() interruptible for SIGKILL
@ 2020-12-09 10:11 Juergen Gross
  2020-12-09 12:33 ` boris.ostrovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2020-12-09 10:11 UTC (permalink / raw)
  To: xen-devel, linux-kernel
  Cc: Juergen Gross, Boris Ostrovsky, Stefano Stabellini

In case a process waits for any Xenstore action in the xenbus driver
it should be interruptible via SIGKILL.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 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..1f4d3593e89e 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 && fatal_signal_pending(current)) {
+			req->msg.type = XS_ERROR;
+			return ERR_PTR(-EINTR);
+		}
 
 		if (!xenbus_ok())
 			/*
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xen/xenbus: make xs_talkv() interruptible for SIGKILL
  2020-12-09 10:11 [PATCH] xen/xenbus: make xs_talkv() interruptible for SIGKILL Juergen Gross
@ 2020-12-09 12:33 ` boris.ostrovsky
  0 siblings, 0 replies; 2+ messages in thread
From: boris.ostrovsky @ 2020-12-09 12:33 UTC (permalink / raw)
  To: Juergen Gross, xen-devel, linux-kernel; +Cc: Stefano Stabellini


On 12/9/20 5:11 AM, Juergen Gross wrote:
> In case a process waits for any Xenstore action in the xenbus driver
> it should be interruptible via SIGKILL.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-09 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 10:11 [PATCH] xen/xenbus: make xs_talkv() interruptible for SIGKILL Juergen Gross
2020-12-09 12:33 ` boris.ostrovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.