drbd: Fix test of unsigned in _drbd_fault_random()
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 15 Dec 2009 21:55:44 +0000 (22:55 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Mon, 21 Dec 2009 12:37:29 +0000 (13:37 +0100)
rsp->count is unsigned so the test does not work.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
drivers/block/drbd/drbd_main.c

index af30ca9..ecc1612 100644 (file)
@@ -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;