提交 49829ea7 编写于 作者: R Roel Kluin 提交者: Philipp Reisner

drbd: Fix test of unsigned in _drbd_fault_random()

rsp->count is unsigned so the test does not work.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
上级 7d4e9d09
......@@ -3623,7 +3623,7 @@ _drbd_fault_random(struct fault_random_state *rsp)
{
long refresh;
if (--rsp->count < 0) {
if (!rsp->count--) {
get_random_bytes(&refresh, sizeof(refresh));
rsp->state += refresh;
rsp->count = FAULT_RANDOM_REFRESH;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册