aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/compaction-times.py
diff options
context:
space:
mode:
authorColy Li <[email protected]>2019-06-09 22:13:35 +0000
committerJens Axboe <[email protected]>2019-06-13 09:09:15 +0000
commit1f0ffa67349c56ea54c03ccfd1e073c990e7411e (patch)
treee3fecad087a9cdac7eba72f96da496a3f29f814e /tools/perf/scripts/python/compaction-times.py
parentbcache: fix stack corruption by PRECEDING_KEY() (diff)
downloadkernel-1f0ffa67349c56ea54c03ccfd1e073c990e7411e.tar.gz
kernel-1f0ffa67349c56ea54c03ccfd1e073c990e7411e.zip
bcache: only set BCACHE_DEV_WB_RUNNING when cached device attached
When people set a writeback percent via sysfs file, /sys/block/bcache<N>/bcache/writeback_percent current code directly sets BCACHE_DEV_WB_RUNNING to dc->disk.flags and schedules kworker dc->writeback_rate_update. If there is no cache set attached to, the writeback kernel thread is not running indeed, running dc->writeback_rate_update does not make sense and may cause NULL pointer deference when reference cache set pointer inside update_writeback_rate(). This patch checks whether the cache set point (dc->disk.c) is NULL in sysfs interface handler, and only set BCACHE_DEV_WB_RUNNING and schedule dc->writeback_rate_update when dc->disk.c is not NULL (it means the cache device is attached to a cache set). This problem might be introduced from initial bcache commit, but commit 3fd47bfe55b0 ("bcache: stop dc->writeback_rate_update properly") changes part of the original code piece, so I add 'Fixes: 3fd47bfe55b0' to indicate from which commit this patch can be applied. Fixes: 3fd47bfe55b0 ("bcache: stop dc->writeback_rate_update properly") Reported-by: Bjørn Forsman <[email protected]> Signed-off-by: Coly Li <[email protected]> Reviewed-by: Bjørn Forsman <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/compaction-times.py')
0 files changed, 0 insertions, 0 deletions