From patchwork Tue Jun 16 02:58:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 1309939 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49mCZq5M5gz9sTD; Tue, 16 Jun 2020 12:58:59 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jl1oN-0000W3-VB; Tue, 16 Jun 2020 02:58:55 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jl1oK-0000V6-22 for kernel-team@lists.ubuntu.com; Tue, 16 Jun 2020 02:58:52 +0000 Received: from mail-qk1-f199.google.com ([209.85.222.199]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jl1oJ-000642-OJ for kernel-team@lists.ubuntu.com; Tue, 16 Jun 2020 02:58:51 +0000 Received: by mail-qk1-f199.google.com with SMTP id w14so15864236qkb.0 for ; Mon, 15 Jun 2020 19:58:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lI15V5+uhW5XTgKHLs6XTG2fQSXT2PdDf8uOqrYv/Lc=; b=O4T49E1TqygIJdzHc737VWXWHlxqL0KzUjuoS2JMpVRtrWYYWTJRDIk8cBHGshK2gf ZrsXdQbcieTocXa5VVzbzKPoNH2Yi1VocbjYiuOhOVXDWHO6QiChAjwvC8RjU89eNtF0 4sZcl40nlipz3r83RLdX/4isjku3+FO1RnUAqysX6Uu6bMnjrXRnVZm7b+HcdOEZpFgq ilyJwGippkz5paPReY/5tXaKklikitCeYZi9JKZMRHzDjjhlACmwpdPvgzZ2K73riu3B x8b9UVwArMNej+ocK4RiLU1zmdTkeCOeCrqJfjhm0cnw/IPdMKNsNCgUazdjxk9MQqWa sIJA== X-Gm-Message-State: AOAM533kcyoK0dfjDMj9YJt+YYYbCFSj7vjpxtUfqunKuL0JJ6NfOvQU ChkHPIy/46eJcb6qqfG/u2sOQqBjDtydv7bukUkflxe9WbJ8lWpEeIM7nfCmG96DTX25f0PU50t RuiYCEKa/0YEDs3y0/aIjdDhfx3+T3utbhwVtX24o X-Received: by 2002:ad4:528d:: with SMTP id v13mr258504qvr.90.1592276330490; Mon, 15 Jun 2020 19:58:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjvbRF+DnjQjgx2VcpHEwlH8Wc4Fn58YQIHMrE5FamKIY0IawGAXX/kUEhzo83SM+UL/zyWw== X-Received: by 2002:ad4:528d:: with SMTP id v13mr258484qvr.90.1592276330140; Mon, 15 Jun 2020 19:58:50 -0700 (PDT) Received: from gallifrey.lan ([2804:14c:4e6:18:74d9:26:da92:f043]) by smtp.gmail.com with ESMTPSA id i14sm12397109qkl.105.2020.06.15.19.58.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 19:58:49 -0700 (PDT) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [bionic:linux-azure-4.15][PATCH 2/9] Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer Date: Mon, 15 Jun 2020 23:58:35 -0300 Message-Id: <20200616025842.102415-3-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200616025842.102415-1-marcelo.cerri@canonical.com> References: <20200616025842.102415-1-marcelo.cerri@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Sunil Muthuswamy BugLink: http://bugs.launchpad.net/bugs/1875456 The code to support panic control message was checking the return was checking the return value from kmsg_dump_get_buffer as error value, which is not what the routine returns. This fixes it. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Signed-off-by: Sunil Muthuswamy Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman (cherry picked from commit ddcaf3ca4c3c87b955ad6f57952250030be77791) Signed-off-by: Marcelo Henrique Cerri --- drivers/hv/vmbus_drv.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index f7bf7281e3ea..c83b5c253e30 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1097,13 +1097,10 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper, * Write dump contents to the page. No need to synchronize; panic should * be single-threaded. */ - if (!kmsg_dump_get_buffer(dumper, true, hv_panic_page, - PAGE_SIZE, &bytes_written)) { - pr_err("Hyper-V: Unable to get kmsg data for panic\n"); - return; - } - - hyperv_report_panic_msg(panic_pa, bytes_written); + kmsg_dump_get_buffer(dumper, true, hv_panic_page, PAGE_SIZE, + &bytes_written); + if (bytes_written) + hyperv_report_panic_msg(panic_pa, bytes_written); } static struct kmsg_dumper hv_kmsg_dumper = {