Received: by 10.213.65.68 with SMTP id h4csp1618982imn; Mon, 19 Mar 2018 08:54:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELtmHncq6fyCQZ3PEJXG2cicRu6A1JH4QsFPDhu2dFlV7Rx3q/lBolQ7nTa72Xf2pn98hdia X-Received: by 2002:a17:902:e5:: with SMTP id a92-v6mr12751031pla.26.1521474896543; Mon, 19 Mar 2018 08:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521474896; cv=none; d=google.com; s=arc-20160816; b=UdNiHJK8ptPe4H+bsl2fXFFzvitn75mDCVu/U5ED0L7mV6ruULEEVbE3rcZKjshhV4 FV9wZIFt7efuSOfu8ZCw5AFD+oFGyDRN4ca9yyPx3HSUvi3CO7ykTpVv8Ax0m8/MKsoX 6j3IKqXdunMwElbZKdTvcG5p3t9VKuitlRHza2MNdBHIhnix3g20D+KuSx8Fyh0RtCyN mGbt0rNKBia7z9sSuOYfmY6Bua6yAJ9f2Q2Ss54VNad+5Q26C8hSUi8K0bOgpz3N28T0 i0aPE5MlkX5hB4QvoleLaLpQ0rx3G/tDmwrVj/iP43Dlfl+/AY04EqNZUHxgq5rfSTM6 vqPA== 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=c/g/XTzwtK+vkaTDK2Fbcbb2BGmaxVvdjkOSyCkJILg=; b=jwav88Iwmo05OJB5uT+LHBfikRuPXtvwISFU7kF8qMZI9ogJ6c16seMaWGvrceEpNy H3x6grM2OJIIqbhWmxi633yWIRg1Y1nt/irTao4p7n2/275OC8G8cq83j0tTqKFZHiB6 GJ/nNKJp1MCahLwfNwBsUJN1VPNEHcIY1dmqzNoWWQjU8dhoNWRl5UJnFr+ZEpXPeCSE RoXSa8BOcK2QputuxAszWeus6gKG89G9H5SFDLvOWBuRCur+rirqcith539xI4oW81Qd aQjoIKeBRnkPEW7wX9HLg21P5hlKnK3KjdohQquIS2fE6wTH8we0Y3mNUtYRW8XLOFI5 PTVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=N/Qn2e1z; 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 z13si154379pgp.602.2018.03.19.08.54.41; Mon, 19 Mar 2018 08:54:56 -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=N/Qn2e1z; 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 S934162AbeCSPxD (ORCPT + 99 others); Mon, 19 Mar 2018 11:53:03 -0400 Received: from mail-by2nam01on0114.outbound.protection.outlook.com ([104.47.34.114]:57771 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934075AbeCSPuR (ORCPT ); Mon, 19 Mar 2018 11:50:17 -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=c/g/XTzwtK+vkaTDK2Fbcbb2BGmaxVvdjkOSyCkJILg=; b=N/Qn2e1zZ8kY1A5KxZQs5KoZvGy28ehD+17OhGNnggzpAhy1/Phd85TGO7nca6M6z9FRaBa9pOvHTqG8AA+w2yWSCG/TvirtbEsVV/EmVrBb0+L7P8jzPA8bHM5gQCI8x+lu7++F19zmCwTfXIyVMFDp7vLBu4ERUineXXnIWlg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1109.namprd21.prod.outlook.com (52.132.130.19) 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 15:50:05 +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 15:50:05 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Jiri Olsa , Alexander Shishkin , Andi Kleen , David Ahern , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 117/124] perf tools: Fix copyfile_offset update of output offset Thread-Topic: [PATCH AUTOSEL for 4.15 117/124] perf tools: Fix copyfile_offset update of output offset Thread-Index: AQHTv5nTbHKKsryms0eLaTrAmNk10Q== Date: Mon, 19 Mar 2018 15:49:13 +0000 Message-ID: <20180319154645.11350-117-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-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;DM5PR2101MB1109;7:yZTattNsLoWhEQDgCRHiScdxOnHufsscztP3b2ymPTQ+4IiGCuvO9Ak+lIFSrs/vZLU+wEyCNfmSSCSsUYrrXeuDHFIMITbih7+FosSD474JYUmsloR41jGhdxPVFjp6ejFDkLdafC+KxzmGfqFQpPBmQYeim9hrfxNk9N79fxTbDanD48t2d5MzPBySGJxOk4CBXNo/ln2tVbZuoPlzARdT6MnYD6inIxW3khPaxJVFwUy1XdSzrgZjR/wwlrIg;20:afKqco97LHn+CkEOoId4XD1e+8YzEYTwMO/ewdzdh5xmHx3L3hsRT9BeV1VfvyexEpUKAcADAFjH5qqmWlyFR/OgT7ww6Kb2OADxs7FcO6CifAe4ZCYnouPHcc19x3JaGf+2iKaz06NIBNyYAZ87vShyV/UF0t1Xg26YCN+zUXA= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: cb8d2afb-fc7c-4e45-8958-08d58db115b6 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1109; x-ms-traffictypediagnostic: DM5PR2101MB1109: 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)(85827821059158)(42068640409301)(228905959029699); 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:DM5PR2101MB1109;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1109; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(39380400002)(376002)(346002)(199004)(189003)(81166006)(10290500003)(107886003)(81156014)(106356001)(6506007)(8676002)(3846002)(36756003)(8936002)(97736004)(6116002)(1076002)(102836004)(68736007)(6666003)(3280700002)(2950100002)(3660700001)(478600001)(72206003)(59450400001)(2906002)(14454004)(966005)(76176011)(66066001)(6512007)(39060400002)(6306002)(5250100002)(10090500001)(2501003)(53936002)(6486002)(6436002)(26005)(316002)(22452003)(305945005)(7736002)(4326008)(25786009)(86362001)(575784001)(86612001)(5660300001)(2900100001)(99286004)(54906003)(186003)(105586002)(110136005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1109;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: uWzxf1ApvUICyrm6fv04y0u1IYECnnDs4FKP7uGkqkVEhxUJ9FIaxI2f1wtTQBDopG4ltu0gMGA5bKn4p/Gbm0VzqNCTeuDrz1XKu4oKtkAA6jaDqp8lCCGkdDh1GChp627eQDQLUXqjhK7+EpKiQNLzSM4KuwwWqcsD488iYnpGjIJsjglotX9na0o9/ZvoIUZzEJ3EWQgpQGjz0mVb8kbm5w/X9YC7iyKsoVCL3y5/fYsylgHC2NLPXIFSRRD2A/TEpLpNCUf8djC0CfbQ5eq8MuTVxescpJS5Omu0VGnyAYmTtrVT3Y+MaDEPDzVEOX2+EIE68gtsh8VKbDbBYQ== 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: cb8d2afb-fc7c-4e45-8958-08d58db115b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:49:13.2679 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- tools/perf/util/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index a789f952b3e9..443892dabedb 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -210,7 +210,7 @@ static int copyfile_offset(int ifd, loff_t off_in, int = ofd, loff_t off_out, u64 =20 size -=3D ret; off_in +=3D ret; - off_out -=3D ret; + off_out +=3D ret; } munmap(ptr, off_in + size); =20 --=20 2.14.1