Skip to content

Commit 4e14947

Browse files
vittyvkgregkh
authored andcommitted
xen/manage: don't complain about an empty value in control/sysrq node
[ Upstream commit 87dffe8 ] When guest receives a sysrq request from the host it acknowledges it by writing '\0' to control/sysrq xenstore node. This, however, make xenstore watch fire again but xenbus_scanf() fails to parse empty value with "%c" format string: sysrq: SysRq : Emergency Sync Emergency Sync complete xen:manage: Error -34 reading sysrq code in control/sysrq Ignore -ERANGE the same way we already ignore -ENOENT, empty value in control/sysrq is totally legal. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent dfb29d6 commit 4e14947

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/xen/manage.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path,
283283
/*
284284
* The Xenstore watch fires directly after registering it and
285285
* after a suspend/resume cycle. So ENOENT is no error but
286-
* might happen in those cases.
286+
* might happen in those cases. ERANGE is observed when we get
287+
* an empty value (''), this happens when we acknowledge the
288+
* request by writing '\0' below.
287289
*/
288-
if (err != -ENOENT)
290+
if (err != -ENOENT && err != -ERANGE)
289291
pr_err("Error %d reading sysrq code in control/sysrq\n",
290292
err);
291293
xenbus_transaction_end(xbt, 1);

0 commit comments

Comments
 (0)