perf tools: Fix copyfile_offset update of output offset
Jiri Olsa
reviewerPATCH 1/1 perf tools: Fix copyfile_offset update of output offset
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.
--- tools/perf/util/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/util.c +1 -1
@@ -210,7 +210,7 @@ static int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size -= ret; off_in += ret; - off_out -= ret; + off_out += ret; }munmap (ptr, off_in + size);
Signature · 1 line
2.13.6
Arnaldo Carvalho de Melo
maintainerEm Tue, Jan 09, 2018 at 02:39:23PM +0100, Jiri Olsa escreveu:
Quoted 6 lines
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.
Try adding these in the future:
Probably there are people tracking those to apply to older kernels :-)
- Arnaldo
Quoted 21 lines
Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/util/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/util.c +1
-1@@ -210,7 +210,7 @@ static int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size -= ret; off_in += ret; - off_out -= ret; + off_out += ret; }munmap (ptr, off_in + size);Signature · 1 line
2.13.6
tip-bot for Jiri Olsa
merge botperf tools: Fix copyfile_offset update of output offset
Commit-ID: fa1195ccc0af2d121abe0fe266a1caee8c265eea Gitweb: https://git.kernel.org/tip/fa1195ccc0af2d121abe0fe266a1caee8c265eea Author: Jiri Olsa <[email protected]> AuthorDate: Tue, 9 Jan 2018 14:39:23 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 12 Jan 2018 16:57:16 -0300
perf tools: Fix copyfile_offset update of output offset
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.
--- tools/perf/util/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/util.c +1 -1
@@ -210,7 +210,7 @@ static int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size -= ret; off_in += ret; - off_out -= ret; + off_out += ret; }munmap (ptr, off_in + size);