Received: by 10.192.165.156 with SMTP id m28csp65273imm; Tue, 10 Apr 2018 16:30:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/kB6O0zVWPcMe8G1eNydsZIXDY8Fkex/xgM/68Lsf3Qncf5BR3l+D3apsGGbQIhxf9mJq1 X-Received: by 10.101.92.138 with SMTP id a10mr1712429pgt.64.1523403058353; Tue, 10 Apr 2018 16:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523403058; cv=none; d=google.com; s=arc-20160816; b=CBQF0ZFH1QxelxOOEn3bs4T16As30cvxxZ6ktCmWDom6dqTmWhA9TET48qKo6g9tR5 y+ysOktC9X5TIjmnW9WEEboAoIX/zqeB8uV9QPq6h0sYEkF8unOtTTALuoP1zZx9FpSM l6Vc6fVJ6Zv6TBgoc+H3A58DTYorHm11Y2XRoOD6VjN+vrxhfzQ0IjNu03hf8ADao4N4 r+t0JRL7VGYlp42hTkYH4yQXyx6V3bfdu8CvvLw3NuWjVVhmmTY+OV7GymY2MlGc375g nufD/QUhj4goSB20nyssT94ofWzsu59xgNeDthNqcAA46rR3P6sjOQyQcxzNtCXTBUqU 8rbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XYCVb/7VIQkfyiroRnY6298hdiXDoItzcZV5U4Mmqi0=; b=xaz7grwCg6ZA2bIHCGAFAYevc+hN89c9KYi1ggd49gQlzdHLi3TYKlUQgwyTYAED8e iflc29l6c0DC3+e7HV+fiNpc+oBc1pCkQx6AECZr0V2plXcZoV/GA+rA3Yk0/3mLlnTd rl93AYNalO/121gjkC1ES/uRiY+oatESN+rQMHUwF2aiODzK5irRpzJ5bRZe3W7LyTbD vTRujqN86aY5iVIQ2MsscmaJytdbMV8S6sTisZUg5rdXNcWz/iNapj9mEUMk/w6vaA8M T5d7GwjlKmclPi18kxNbM7tnizRFTnqy760XRIgeUpWgKCtcjK2mjhvt+meU9a/OfvHv rxDA== ARC-Authentication-Results: i=1; mx.google.com; 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 c12-v6si3607829plo.216.2018.04.10.16.30.21; Tue, 10 Apr 2018 16:30: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; 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 S1754606AbeDJWad (ORCPT + 99 others); Tue, 10 Apr 2018 18:30:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40012 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754561AbeDJWa3 (ORCPT ); Tue, 10 Apr 2018 18:30:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BCC9ADE3; Tue, 10 Apr 2018 22:30:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Olsa , Alexander Shishkin , Andi Kleen , David Ahern , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.15 104/168] perf tools: Fix copyfile_offset update of output offset Date: Wed, 11 Apr 2018 00:24:06 +0200 Message-Id: <20180410212804.672473857@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiri Olsa [ Upstream commit fa1195ccc0af2d121abe0fe266a1caee8c265eea ] We need to increase output offset in each iteration, not decrease it as we currently do. I guess we were lucky to finish in most cases in first iteration, so the bug never showed. However it shows a lot when working with big (~4GB) size data. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Fixes: 9c9f5a2f1944 ("perf tools: Introduce copyfile_offset() function") Link: http://lkml.kernel.org/r/20180109133923.25406-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -210,7 +210,7 @@ static int copyfile_offset(int ifd, loff size -= ret; off_in += ret; - off_out -= ret; + off_out += ret; } munmap(ptr, off_in + size);