summaryrefslogtreecommitdiffstats
path: root/.cocciconfig
diff options
context:
space:
mode:
authorKan Liang <kan.liang@intel.com>2018-01-18 13:26:17 -0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-02-15 09:51:57 -0300
commitdc6c35c679e96987dc83a003f30bc2cc33c84c00 (patch)
treea43e827f305b8aba9bfedca65fbeba16a433a75c /.cocciconfig
parent6888ff66c44ffa3077ed69e978902d0ff4b84ae1 (diff)
downloadlinux-dc6c35c679e96987dc83a003f30bc2cc33c84c00.tar.bz2
perf mmap: Recalculate size for overwrite mode
In perf_mmap__push(), the 'size' need to be recalculated, otherwise the invalid data might be pushed to the record in overwrite mode. The issue is introduced by commit 7fb4b407a124 ("perf mmap: Don't discard prev in backward mode"). When the ring buffer is full in overwrite mode, backward_rb_find_range() will be called to recalculate the 'start' and 'end'. The 'size' needs to be recalculated accordingly. Unconditionally recalculate the 'size', not just for full ring buffer in overwrite mode. Because: - There is no harmful to recalculate the 'size' for other cases. - The code of calculating 'start' and 'end' will be factored out later. The new function does not need to return 'size'. Signed-off-by: Kan Liang <kan.liang@intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Fixes: 7fb4b407a124 ("perf mmap: Don't discard prev in backward mode") Link: http://lkml.kernel.org/r/1516310792-208685-3-git-send-email-kan.liang@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to '.cocciconfig')
0 files changed, 0 insertions, 0 deletions