drbd: Fix test of unsigned in _drbd_fault_random()
Subsystems (2)
PATCH 1/1 drbd: Fix test of unsigned in _drbd_fault_random()
rsp->count is unsigned so the test does not work.
Signed-off-by Roel Kluin <[email protected]>
---
Found using coccinelle: http://coccinelle.lip6.fr/
drivers/block/drbd/drbd_main.c +1 -1
@@ -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 ;
Philipp Reisner
maintainerAm Dienstag, 15. Dezember 2009 22:55:44 schrieb Roel Kluin:
Quoted 2 lines
rsp->countis unsigned so the test does not work.
Thanks. On its way upstream.
-Phil
Signature · 6 lines
: Dipl-Ing Philipp Reisner : LINBIT | Your Way to High Availability : Tel: +43-1-8178292-50, Fax: +43-1-8178292-82 : http://www.linbit.com DRBD(R) and LINBIT(R) are registered trademarks of LINBIT, Austria.