]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.15.17/perf-tools-fix-copyfile_offset-update-of-output-offset.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.15.17 / perf-tools-fix-copyfile_offset-update-of-output-offset.patch
1 From foo@baz Mon Apr 9 10:16:32 CEST 2018
2 From: Jiri Olsa <jolsa@kernel.org>
3 Date: Tue, 9 Jan 2018 14:39:23 +0100
4 Subject: perf tools: Fix copyfile_offset update of output offset
5
6 From: Jiri Olsa <jolsa@kernel.org>
7
8
9 [ Upstream commit fa1195ccc0af2d121abe0fe266a1caee8c265eea ]
10
11 We need to increase output offset in each iteration, not decrease it as
12 we currently do.
13
14 I guess we were lucky to finish in most cases in first iteration, so the
15 bug never showed. However it shows a lot when working with big (~4GB)
16 size data.
17
18 Signed-off-by: Jiri Olsa <jolsa@kernel.org>
19 Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
20 Cc: Andi Kleen <ak@linux.intel.com>
21 Cc: David Ahern <dsahern@gmail.com>
22 Cc: Namhyung Kim <namhyung@kernel.org>
23 Cc: Peter Zijlstra <peterz@infradead.org>
24 Fixes: 9c9f5a2f1944 ("perf tools: Introduce copyfile_offset() function")
25 Link: http://lkml.kernel.org/r/20180109133923.25406-1-jolsa@kernel.org
26 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
27 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 ---
30 tools/perf/util/util.c | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33 --- a/tools/perf/util/util.c
34 +++ b/tools/perf/util/util.c
35 @@ -210,7 +210,7 @@ static int copyfile_offset(int ifd, loff
36
37 size -= ret;
38 off_in += ret;
39 - off_out -= ret;
40 + off_out += ret;
41 }
42 munmap(ptr, off_in + size);
43