bcachefs: check the invalid parameter for perf test
The perf_test does not check the number of iterations and threads when it is zero. If nr_thread is 0, the perf test will keep waiting for wakekup. If iteration is 0, it will cause exception of division by zero. This can be reproduced by: echo "rand_insert 0 1" > /sys/fs/bcachefs/${uuid}/perf_test or echo "rand_insert 1 0" > /sys/fs/bcachefs/${uuid}/perf_test Fixes: 1c6fdbd8 ("bcachefs: Initial commit") Signed-off-by:Hongbo Li <lihongbo22@huawei.com> Signed-off-by:
Kent Overstreet <kent.overstreet@linux.dev>
Loading
Please register or sign in to comment