Commit 4a63b030 authored by Roel Kluin's avatar Roel Kluin Committed by Jens Axboe

drbd: fix test of unsigned in _drbd_fault_random()

rsp->count is unsigned so the test does not work.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
Cc: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 1de6129f
...@@ -3623,7 +3623,7 @@ _drbd_fault_random(struct fault_random_state *rsp) ...@@ -3623,7 +3623,7 @@ _drbd_fault_random(struct fault_random_state *rsp)
{ {
long refresh; long refresh;
if (--rsp->count < 0) { if (!rsp->count--) {
get_random_bytes(&refresh, sizeof(refresh)); get_random_bytes(&refresh, sizeof(refresh));
rsp->state += refresh; rsp->state += refresh;
rsp->count = FAULT_RANDOM_REFRESH; rsp->count = FAULT_RANDOM_REFRESH;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment