Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3931611imm; Mon, 8 Oct 2018 11:53:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV61s9/wUPJl8beG9sHoNiqjPOWPNNXdP7TM71CWAtdADle4YpPj84ypCqnv/h5lteFPkDKwy X-Received: by 2002:a17:902:7842:: with SMTP id e2-v6mr25302485pln.104.1539024838382; Mon, 08 Oct 2018 11:53:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024838; cv=none; d=google.com; s=arc-20160816; b=yjTX+TJx2KUR8SP9FERl1IjkdIp7N81xsqx8znP7nTVaVJb86f98ZQkNuIJYlBPLPa Dnxvp432NndBJvglVZPQivNrXj5RI+aiBKvWE2NrwmYj2e9lPyS/2hGGjt/enOs4GDxe 4oETKfQ5KH1RocIXuE2cmVFuo274gQS9oqvJBpQ6/BjGZ8kVkTVZOYefeWoQ+dpyDxi+ jlr92rKzuw79/znURyc0CHYqZbGyehFaNdr794rEK/bKzv/juGBnSPqlEUsamgjatn6u CMDXOUe+o9JBdGOLWR+alrQTa7MX1D/JraekZ8RdU7bYcZrByWhJPycCBRgvs8pkH3Ev urNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LmCAkMxHA/dLvivjDFqlqx+aAru5l6ZnmK9MiVRNeJ4=; b=jKCirJmH8iauYZTXyNf6kP4es7hEyqGepy4nZueFyHHwQIfNe9TilBFDR7RzAJkUl7 mYr6DYl9aFPYDJEcZJILVa6kvG+6ZP0IwCKPCPzglnM/fwYOt5/EzFMZaeGgDm++uLmx AAz0tYo5v765XSF0pzzr9VuJd0I13TqqJkkAg1acqzJii/xTILrbpWogwe317+b4UBGl iStgmH4uIEgXSL+tLE04xZVumBqK/RqB9rJXmF+mC5Dgdbhg/2J8PIin5q2/1bzl8qMU 5QFhx3z0JpQnpNYd+MlBZgwfeZGRqgp7BQt4781r34cmXQVRj2rpaBUyOHZ/G+pxbF8w vqZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZRkCjfPc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y34-v6si19121879plb.46.2018.10.08.11.53.43; Mon, 08 Oct 2018 11:53:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZRkCjfPc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732793AbeJICGq (ORCPT + 99 others); Mon, 8 Oct 2018 22:06:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:57174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732457AbeJICGp (ORCPT ); Mon, 8 Oct 2018 22:06:45 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D1B7B20645; Mon, 8 Oct 2018 18:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024817; bh=n0NPbI3ArivNS8jInFPihZlqoLKaLQdLIs7KfXNsYd4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZRkCjfPcGUJe6FDIG6J4Yvh2qkVZChDpOpwoRqIXUzzQ1IUa4AAM6OyPxAlhENm5j RNZazaZGz9w4AKANG2NLcmbenWcqajiC6pAOte+oBr1ZERBlvHJQFovDjV/QHLzHqo xDhtkGgMIUR3uRs6bN04E8gxCD2pm+MGFhWT8RwI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vitaly Kuznetsov , Wei Liu , Boris Ostrovsky , Sasha Levin Subject: [PATCH 4.18 140/168] xen/manage: dont complain about an empty value in control/sysrq node Date: Mon, 8 Oct 2018 20:32:00 +0200 Message-Id: <20181008175625.354467513@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vitaly Kuznetsov [ Upstream commit 87dffe86d406bee8782cac2db035acb9a28620a7 ] 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 Reviewed-by: Wei Liu Signed-off-by: Boris Ostrovsky Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/xen/manage.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -280,9 +280,11 @@ static void sysrq_handler(struct xenbus_ /* * The Xenstore watch fires directly after registering it and * after a suspend/resume cycle. So ENOENT is no error but - * might happen in those cases. + * might happen in those cases. ERANGE is observed when we get + * an empty value (''), this happens when we acknowledge the + * request by writing '\0' below. */ - if (err != -ENOENT) + if (err != -ENOENT && err != -ERANGE) pr_err("Error %d reading sysrq code in control/sysrq\n", err); xenbus_transaction_end(xbt, 1);