]>
Commit | Line | Data |
---|---|---|
52734aa6 GKH |
1 | From foo@baz Mon Oct 8 18:07:05 CEST 2018 |
2 | From: Vitaly Kuznetsov <vkuznets@redhat.com> | |
3 | Date: Thu, 6 Sep 2018 13:26:08 +0200 | |
4 | Subject: xen/manage: don't complain about an empty value in control/sysrq node | |
5 | ||
6 | From: Vitaly Kuznetsov <vkuznets@redhat.com> | |
7 | ||
8 | [ Upstream commit 87dffe86d406bee8782cac2db035acb9a28620a7 ] | |
9 | ||
10 | When guest receives a sysrq request from the host it acknowledges it by | |
11 | writing '\0' to control/sysrq xenstore node. This, however, make xenstore | |
12 | watch fire again but xenbus_scanf() fails to parse empty value with "%c" | |
13 | format string: | |
14 | ||
15 | sysrq: SysRq : Emergency Sync | |
16 | Emergency Sync complete | |
17 | xen:manage: Error -34 reading sysrq code in control/sysrq | |
18 | ||
19 | Ignore -ERANGE the same way we already ignore -ENOENT, empty value in | |
20 | control/sysrq is totally legal. | |
21 | ||
22 | Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> | |
23 | Reviewed-by: Wei Liu <wei.liu2@citrix.com> | |
24 | Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> | |
25 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
26 | Signed-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); |