Received: by 10.213.65.68 with SMTP id h4csp1677448imn; Mon, 19 Mar 2018 10:18:03 -0700 (PDT) X-Google-Smtp-Source: AG47ELvkf4bP/BIFB+L46pGbiB4I6EsvT+eFKtZEuskr6RMIomS+5xFF41AOjrbL2pfXMu72QRE6 X-Received: by 10.101.75.12 with SMTP id r12mr379948pgq.36.1521479883854; Mon, 19 Mar 2018 10:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521479883; cv=none; d=google.com; s=arc-20160816; b=msvHKHneaUHoJYfl7shoUSvzb7uU/uPav17zdRacr6wEdDDj3/8jfASJ4FqC/ovpoj UU71AbnrhTL4eHtvf3CcAA0Uk5D1+lXMX4qvz9LVZyi/LChNCmbtwcW6UEsUYeUYmtMQ zy8dvy9P+j9o7nTk3IPdy6GI6XRL9nu9Qe/6TOvb4F6NVmMdOS/JsnQ1sc4LErlih4ZQ RI5Dh1Zwb0QqUE0/9n5FZM8r88WsgYppAYB4gWCpemQ4zThDA3Zyge7dQknts43pE9La 0m604wnOYucFUtBp0mzqWrMN8W410eVvHVs4+wlifDcbhW8Xzz5Lu6oG9KkAZiCsgFd8 9dAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Kb99AtzmlRi2cGKxZR08hOyvDv9dSnQqoUq8wlkY+aQ=; b=PdcJGA9KzHLSUSxWHuaiGTLcxO6Up0AKTeR+is/JY3Pe8sXbCLxH/RKLgZt5VBCLNY 5Pb+dqKb2k+MCyIThCOXEjkTcRc2hW/4SVgc2zEv4ibRlX6sb/7nsaI7bZ0kPUiYWjj/ GQMrXjSXgImPZAJ80sTvl0mALKXFhxjq+l+jLAhn/3qaWNuUwcHhN4yygGUVFQ++YKrq 68MkVJhLVjZk/G3R0eVk9w90qvIUZkOulXX6pIUho+O6+EwBUg9BbSpIVzXFRQe8nf1V ZIIBq9fGlgCJ0Fl6lGIA7bzH8ZsXZwVkBbXSGXKuVwbYZ8G7TnyrYBZir7R40z9dSVq/ EcyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=A0cYYxt4; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t14si225430pgr.277.2018.03.19.10.17.49; Mon, 19 Mar 2018 10:18:03 -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=@microsoft.com header.s=selector1 header.b=A0cYYxt4; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967852AbeCSRPK (ORCPT + 99 others); Mon, 19 Mar 2018 13:15:10 -0400 Received: from mail-by2nam01on0091.outbound.protection.outlook.com ([104.47.34.91]:17618 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966567AbeCSQKI (ORCPT ); Mon, 19 Mar 2018 12:10:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Kb99AtzmlRi2cGKxZR08hOyvDv9dSnQqoUq8wlkY+aQ=; b=A0cYYxt4jktZQCRKxQSRgsDmj97Tcw4oaW1w108HlOhWuRY+I2dhwD+RuJ8yAMgtR+pFK6nugU5GOngRGXb0UsS3h8dzF+fssDZhmehwL01w3e0bLeFyonA3qIVSav52eWDO+Doo/2208ZvsH3ZJhQYlPKhTMyoHFmkXD7QRI3A= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0919.namprd21.prod.outlook.com (52.132.132.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 16:10:00 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:10:00 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Michael Ellerman , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 113/167] powerpc/spufs: Fix coredump of SPU contexts Thread-Topic: [PATCH AUTOSEL for 4.4 113/167] powerpc/spufs: Fix coredump of SPU contexts Thread-Index: AQHTv5xpZTrW+DDEU02bROyS6fogsQ== Date: Mon, 19 Mar 2018 16:07:43 +0000 Message-ID: <20180319160513.16384-113-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0919;7:IcaV+FSKW+rdqk7gDNAvxI2BrJrmN2IQujLP171NfPrJier79364KgUr1C9Ow31JADertqeotirUzWFdE1vI2zqMIrSRaS59Iu83bJOl7FGK7qg0T8tMJfX+oR9jBJIKS30boA3HLm2I2WbdK5xBtRKJlxhEFgXzjnX2etqfnDirbpwoomSOEpAOOBwjCChkqP6Hse9n/Yvz0PTIW78Cz8Hlq/FY4AH9XQ+V7LffVeIcPQnj2K3ycm/EsL1KzX1e;20:iPc3CYeAvfkBpBqp+a+HR7lXHI4iIk+VT2+/ay8oJPsaQpCPMJtVrczNTgq0aIjp7XL+W11YGP3Bs2f51aVJdSN0TVqNgooTC+0bCxHiNdS/2+MuPekQlCH8aK50f1JJkcYCyMGcSwbQNP2nZI0D6FEcRRRSrbo9rz0SYydwK4Q= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 60624ba4-8d88-499b-f6e3-08d58db3ddaf x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0919; x-ms-traffictypediagnostic: DM5PR2101MB0919: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0919;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0919; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39380400002)(396003)(39860400002)(376002)(366004)(199004)(189003)(66066001)(575784001)(2906002)(86362001)(10290500003)(105586002)(8676002)(305945005)(110136005)(478600001)(4326008)(7736002)(81166006)(3280700002)(6506007)(97736004)(107886003)(5660300001)(36756003)(8936002)(53936002)(86612001)(14454004)(59450400001)(1076002)(2501003)(6116002)(10090500001)(76176011)(186003)(3846002)(5250100002)(6512007)(99286004)(102836004)(106356001)(72206003)(81156014)(2950100002)(6666003)(54906003)(3660700001)(22452003)(68736007)(6486002)(25786009)(26005)(316002)(2900100001)(6436002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0919;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: xxgk4Nqdg/dRrcpa7KqF3AiUwti7VKpn+l3UfKBNXsHhVIzgPcjj6Zs3Xn4BP+oGHXsr3TZDJXT2lXrEvXF6qz6Cu2i20aZhLUj5mlk1W/O8xaES9Cu4+PrDOKitSUJr4Eyksa9lxs0WUAqFa1ec+/5/JWmB7sy6U8sjm979m0FNp/pJMbLPnRq1leY2lykGk8rU4FK4FLmfJs1GjJolvYu9ycM1eHMqG3ni1xdWmRMWpxGb4XsZGYvet69BHZwsO+fgy39zefULf+RwGXz6ZyJOaNyH/3BVZTLK1eBGsgiQZPKe1+UoGsTltatYjdUaCxIRFKcyempJZihUXrZpwQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60624ba4-8d88-499b-f6e3-08d58db3ddaf X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:07:43.7756 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0919 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Ellerman [ Upstream commit 99acc9bede06bbb2662aafff51f5b9e529fa845e ] If a process dumps core while it has SPU contexts active then we have code to also dump information about the SPU contexts. Unfortunately it's been broken for 3 1/2 years, and we didn't notice. In commit 7b1f4020d0d1 ("spufs: get rid of dump_emit() wrappers") the nread variable was removed and rc used instead. That means when the loop exits successfully, rc has the number of bytes read, but it's then used as the return value for the function, which should return 0 on success. So fix it by setting rc =3D 0 before returning in the success case. Fixes: 7b1f4020d0d1 ("spufs: get rid of dump_emit() wrappers") Signed-off-by: Michael Ellerman Acked-by: Jeremy Kerr Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/platforms/cell/spufs/coredump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/pl= atforms/cell/spufs/coredump.c index be6212ddbf06..7e42e3ec2142 100644 --- a/arch/powerpc/platforms/cell/spufs/coredump.c +++ b/arch/powerpc/platforms/cell/spufs/coredump.c @@ -174,6 +174,8 @@ static int spufs_arch_write_note(struct spu_context *ct= x, int i, if (!dump_skip(cprm, roundup(cprm->written - total + sz, 4) - cprm->written)) goto Eio; + + rc =3D 0; out: free_page((unsigned long)buf); return rc; --=20 2.14.1