aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorColy Li <[email protected]>2019-02-09 12:53:00 +0800
committerJens Axboe <[email protected]>2019-02-09 07:18:31 -0700
commitf54478c6e226bb1540a3e58366601039dfd778e2 (patch)
tree1a1ee0684bdad2647fbdb03a2ac479eec772a8e9 /tools/perf/scripts/python
parent596b5a5dd1bc2fa019fdaaae522ef331deef927f (diff)
bcache: fix input integer overflow of congested threshold
Cache set congested threshold values congested_read_threshold_us and congested_write_threshold_us can be set via sysfs interface. These two values are 'unsigned int' type, but sysfs interface uses strtoul to convert input string. So if people input a large number like 9999999999, the value indeed set is 1410065407, which is not expected behavior. This patch replaces sysfs_strtoul() by sysfs_strtoul_clamp() when convert input string to unsigned int value, and set value range in [0, UINT_MAX], to avoid the above integer overflow errors. Signed-off-by: Coly Li <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions