Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2910485iog; Mon, 27 Jun 2022 05:35:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tLJx2L9uvCNlCBYz2cnnJ7VS2hdR3mmopoNu/krQx5VoipLPipouL65Iss2+tJU0pEw6iq X-Received: by 2002:a17:907:9693:b0:726:372c:2c02 with SMTP id hd19-20020a170907969300b00726372c2c02mr12695088ejc.483.1656333315907; Mon, 27 Jun 2022 05:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333315; cv=none; d=google.com; s=arc-20160816; b=Jus9psc7RoNor7jAmytfJ6ezbcv8aCBtYaV+ymfQ/fKM59ujboOxZFEoMbSPQphmS4 BI5mLnmuIjSB4MOjthY6GH9vLWwVm+MTdA1sv/5ruGocsTuthAdu14Nbbo1vhJVkyrQX CTGp34IbvXStBxtTRIuDoRXIdoknKDdjI4mW5PUIoLUpK3Wwhb25SLBfdXm4epZJilVL lGsWbYcBv/1OAnxidzralvZ42MFTD5Kwp8m1vKu5hgK/J4Gorcf3yZZiXRLp3F/xSWRk UPaeUPuTaFObNfLo2ZlSlCqJ5aX12udhx8TY3tYBf8EVFk8x6wfQBV3SHwNc6ArcE77w Rz+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Q6UgtBsZ7jZmOEoi/g9YRxzG3riHkvcfjj/NW5TyydY=; b=GwfT5+fD1ZZ9+5WHn7FXTHJkBkEeRp+F46fNlBkI7jNhISPBgHBil0IhxQWHbmOZeJ 0jJC9LdqTMg0m5rQ+m41CIff65DKyPiBNpPP5i2w/zv7LKpy6E0pNjGADMmk7usKIuML 1IuzdwxJHIBRthkgYiwBsg85Pi+haBSu4DwdzlqiQpzLWZ6JUkBYnKIJgv5L/jAeipMD sqQzHO4GDzeSIRRuHXGAZYC1LUuIfevWLmsWLndkshYLyj1AhKmQikzuiyEunI30iigq Il3bCE3OYSNNzotX2ZRlINsgDk1eNQaq9443W9qtWYe6ZTsfdCxc/Ac9CANjlX4blzGG zxrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pgJwBWvE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa6-20020a170907868600b006ff47214f59si14196778ejc.515.2022.06.27.05.34.50; Mon, 27 Jun 2022 05:35:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pgJwBWvE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239323AbiF0L4d (ORCPT + 99 others); Mon, 27 Jun 2022 07:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237923AbiF0LtT (ORCPT ); Mon, 27 Jun 2022 07:49:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B61DD70; Mon, 27 Jun 2022 04:43:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D4390B80D32; Mon, 27 Jun 2022 11:43:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 069A1C3411D; Mon, 27 Jun 2022 11:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656330189; bh=qKL3sDgDBwWBiQCi7BtfyP3+QUW3gUvmmkQeEh0eHoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pgJwBWvE88p9eipfE08kdNmM+7kwFgyseSA9LJwJonNTBhjzVbHcIz9ooO9TprShA ZhG4g5X1RM91K9BDehtif6B3uJxmQ21BlTyxd9/FDE6GKKJmLKEgLK9ja1ZjnsUzyk niXGfZtHnRBICs+6zFw2jLVB7bfK4FVQs+4s29TY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Egorenkov , Alexander Gordeev , Sasha Levin Subject: [PATCH 5.18 114/181] s390/crash: make copy_oldmem_page() return number of bytes copied Date: Mon, 27 Jun 2022 13:21:27 +0200 Message-Id: <20220627111948.003910220@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111944.553492442@linuxfoundation.org> References: <20220627111944.553492442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Gordeev [ Upstream commit af2debd58bd769e38f538143f0d332e15d753396 ] Callback copy_oldmem_page() returns either error code or zero. Instead, it should return the error code or number of bytes copied. Fixes: df9694c7975f ("s390/dump: streamline oldmem copy functions") Reviewed-by: Alexander Egorenkov Tested-by: Alexander Egorenkov Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/crash_dump.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/arch/s390/kernel/crash_dump.c +++ b/arch/s390/kernel/crash_dump.c @@ -233,9 +233,10 @@ ssize_t copy_oldmem_page(struct iov_iter rc = copy_oldmem_user(iter->iov->iov_base, src, csize); else rc = copy_oldmem_kernel(iter->kvec->iov_base, src, csize); - if (!rc) - iov_iter_advance(iter, csize); - return rc; + if (rc < 0) + return rc; + iov_iter_advance(iter, csize); + return csize; } /*