From 7bfd448aed6e20757f94cc4ef74b3da763eb9c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 21 Feb 2015 02:43:29 +0100 Subject: [PATCH] Revert "xen/xenbus: Avoid synchronous wait on XenBus stalling shutdown/restart." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Organization: Invisible Things Lab Cc: Marek Marczykowski-Górecki This reverts commit 027bd7e89906a076225b23d1ca4b6702c84e72dc. Signed-off-by: Marek Marczykowski-Górecki --- drivers/xen/xenbus/xenbus_xs.c | 44 +++--------------------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index ba804f3..b6d5fff 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -50,7 +50,6 @@ #include #include #include "xenbus_comms.h" -#include "xenbus_probe.h" struct xs_stored_msg { struct list_head list; @@ -140,29 +139,6 @@ static int get_error(const char *errorstring) return xsd_errors[i].errnum; } -static bool xenbus_ok(void) -{ - switch (xen_store_domain_type) { - case XS_LOCAL: - switch (system_state) { - case SYSTEM_POWER_OFF: - case SYSTEM_RESTART: - case SYSTEM_HALT: - return false; - default: - break; - } - return true; - case XS_PV: - case XS_HVM: - /* FIXME: Could check that the remote domain is alive, - * but it is normally initial domain. */ - return true; - default: - break; - } - return false; -} static void *read_reply(enum xsd_sockmsg_type *type, unsigned int *len) { struct xs_stored_msg *msg; @@ -172,20 +148,9 @@ static void *read_reply(enum xsd_sockmsg_type *type, unsigned int *len) while (list_empty(&xs_state.reply_list)) { spin_unlock(&xs_state.reply_lock); - if (xenbus_ok()) - /* XXX FIXME: Avoid synchronous wait for response here. */ - wait_event_timeout(xs_state.reply_waitq, - !list_empty(&xs_state.reply_list), - msecs_to_jiffies(500)); - else { - /* - * If we are in the process of being shut-down there is - * no point of trying to contact XenBus - it is either - * killed (xenstored application) or the other domain - * has been killed or is unreachable. - */ - return ERR_PTR(-EIO); - } + /* XXX FIXME: Avoid synchronous wait for response here. */ + wait_event(xs_state.reply_waitq, + !list_empty(&xs_state.reply_list)); spin_lock(&xs_state.reply_lock); } @@ -250,9 +215,6 @@ void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg) mutex_unlock(&xs_state.request_mutex); - if (IS_ERR(ret)) - return ret; - if ((msg->type == XS_TRANSACTION_END) || ((req_msg.type == XS_TRANSACTION_START) && (msg->type == XS_ERROR))) -- 1.8.3.1