diff options
| author | Chao Yu <yuchao0@huawei.com> | 2018-04-25 19:38:17 +0800 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-07-08 17:29:52 -0700 |
| commit | 03279ce90b4666931c32cebf089c49a223db0c09 (patch) | |
| tree | 5e5693870fa0f96f0c56e59e3d0f2e7fc9ac7605 /tools/perf/scripts/python | |
| parent | f46eddc4da48ec1b8fbee2a1f53356bfa67eec3d (diff) | |
f2fs: fix potential overflow
In build_sit_entries(), if valid_blocks in SIT block is smaller than
valid_blocks in journal, for below calculation:
sbi->discard_blks += old_valid_blocks - se->valid_blocks;
There will be two times potential overflow:
- old_valid_blocks - se->valid_blocks will overflow, and be a very
large number.
- sbi->discard_blks += result will overflow again, comes out a correct
result accidently.
Anyway, it should be fixed.
Fixes: d600af236da5 ("f2fs: avoid unneeded loop in build_sit_entries")
Fixes: 1f43e2ad7bff ("f2fs: introduce CP_TRIMMED_FLAG to avoid unneeded discard")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
