]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.160/xen-manage-don-t-complain-about-an-empty-value-in-control-sysrq-node.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.160 / xen-manage-don-t-complain-about-an-empty-value-in-control-sysrq-node.patch
CommitLineData
52734aa6
GKH
1From foo@baz Mon Oct 8 18:07:05 CEST 2018
2From: Vitaly Kuznetsov <vkuznets@redhat.com>
3Date: Thu, 6 Sep 2018 13:26:08 +0200
4Subject: xen/manage: don't complain about an empty value in control/sysrq node
5
6From: Vitaly Kuznetsov <vkuznets@redhat.com>
7
8[ Upstream commit 87dffe86d406bee8782cac2db035acb9a28620a7 ]
9
10When guest receives a sysrq request from the host it acknowledges it by
11writing '\0' to control/sysrq xenstore node. This, however, make xenstore
12watch fire again but xenbus_scanf() fails to parse empty value with "%c"
13format string:
14
15 sysrq: SysRq : Emergency Sync
16 Emergency Sync complete
17 xen:manage: Error -34 reading sysrq code in control/sysrq
18
19Ignore -ERANGE the same way we already ignore -ENOENT, empty value in
20control/sysrq is totally legal.
21
22Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
23Reviewed-by: Wei Liu <wei.liu2@citrix.com>
24Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
25Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
26Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27---
28 drivers/xen/manage.c | 6 ++++--
29 1 file changed, 4 insertions(+), 2 deletions(-)
30
31--- a/drivers/xen/manage.c
32+++ b/drivers/xen/manage.c
33@@ -280,9 +280,11 @@ static void sysrq_handler(struct xenbus_
34 /*
35 * The Xenstore watch fires directly after registering it and
36 * after a suspend/resume cycle. So ENOENT is no error but
37- * might happen in those cases.
38+ * might happen in those cases. ERANGE is observed when we get
39+ * an empty value (''), this happens when we acknowledge the
40+ * request by writing '\0' below.
41 */
42- if (err != -ENOENT)
43+ if (err != -ENOENT && err != -ERANGE)
44 pr_err("Error %d reading sysrq code in control/sysrq\n",
45 err);
46 xenbus_transaction_end(xbt, 1);