projects
/
platform
/
kernel
/
linux-3.10.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1de6129
)
drbd: fix test of unsigned in _drbd_fault_random()
author
Roel Kluin
<roel.kluin@gmail.com>
Fri, 18 Dec 2009 11:38:11 +0000
(12:38 +0100)
committer
Jens Axboe
<jens.axboe@oracle.com>
Fri, 18 Dec 2009 11:38:11 +0000
(12:38 +0100)
rsp->count is unsigned so the test does not work.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
Cc: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/block/drbd/drbd_main.c
patch
|
blob
|
history
diff --git
a/drivers/block/drbd/drbd_main.c
b/drivers/block/drbd/drbd_main.c
index
157d1e4
..
c2594c1
100644
(file)
--- a/
drivers/block/drbd/drbd_main.c
+++ b/
drivers/block/drbd/drbd_main.c
@@
-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;