Skip to contentSkip to conversation

drbd: fix test of unsigned in _drbd_fault_random()

PATCH In review [email protected] 3 participants 5 messages Dec 22, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/5 drbd: fix test of unsigned in _drbd_fault_random()

From: Roel Kluin <[email protected]>

rsp->count is unsigned so the test does not work.

Cc Lars Ellenberg <[email protected]>
Cc Philipp Reisner <[email protected]>
Cc Jens Axboe <[email protected]>

---

 drivers/block/drbd/drbd_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/drbd/drbd_main.c renamed from drivers/block/drbd/drbd_main.c~drbd-fix-test-of-unsigned-in-_drbd_fault_random +1 -1
diff -puN drivers/block/drbd/drbd_main.c~drbd-fix-test-of-unsigned-in-_drbd_fault_random drivers/block/drbd/drbd_main.c
@@ -3623,7 +3623,7 @@ _drbd_fault_random(struct fault_random_s
 {
 	long refresh;
 
-	if (--rsp->count < 0) {
+	if (!rsp->count--) {
 		get_random_bytes(&refresh, sizeof(refresh));
 		rsp->state += refresh;
 		rsp->count = FAULT_RANDOM_REFRESH;

_

maintainer
#1 lore raw

Am Dienstag, 22. Dezember 2009 01:27:52 schrieb [email protected]:

Quoted 5 lines

From: Roel Kluin <[email protected]>

rsp->count is unsigned so the test does not work.

[...]

This patch is on its way upstream
See http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=49829ea74f790d3be2e803a617e714f5b9a5ed50

and in the DRBD tree for old kernels...
http://git.drbd.org/?p=drbd-8.3.git;a=commit;h=f1cb8ce303a26e4763bbfb32660643322f4e228d

-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.
#2 lore raw
Quoted 5 lines · Philipp Reisner

Am Dienstag, 22. Dezember 2009 01:27:52 schrieb [email protected]:

Quoted 4 lines

From: Roel Kluin <[email protected]>

rsp->count is unsigned so the test does not work.

Quoted 8 lines
Quoted 1 line

[...]

This patch is on its way upstream
See http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=49829ea74f790d3be2e803a617e714f5b9a5ed50

and in the DRBD tree for old kernels...
http://git.drbd.org/?p=drbd-8.3.git;a=commit;h=f1cb8ce303a26e4763bbfb32660643322f4e228d

Indeed, it's been in my for-linus/next for a while, I'm guessing Andrew just hasn't updated his sources for some days.

Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 9 lines · On Tue, 22 Dec 2009 10:13:07 +0100 Jens Axboe <[email protected]> wrote:
Quoted 8 lines · Philipp Reisner

Am Dienstag, 22. Dezember 2009 01:27:52 schrieb [email protected]:

Quoted 5 lines

From: Roel Kluin <[email protected]>

rsp->count is unsigned so the test does not work.

[...]

Quoted 9 lines
Quoted 5 lines

This patch is on its way upstream
See http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=49829ea74f790d3be2e803a617e714f5b9a5ed50

and in the DRBD tree for old kernels...
http://git.drbd.org/?p=drbd-8.3.git;a=commit;h=f1cb8ce303a26e4763bbfb32660643322f4e228d

Indeed, it's been in my for-linus/next for a while, I'm guessing Andrew just hasn't updated his sources for some days.

I pull linux-next every day.

The above patch wasn't in the Dec 19 linux-next, and Stephen won't be doing another -next until Dec 29.

#4 lore raw
Quoted 17 lines · Andrew Morton
Quoted 15 lines · On Tue, 22 Dec 2009 10:13:07 +0100 Jens Axboe <[email protected]> wrote:
Quoted 13 lines · Philipp Reisner

Am Dienstag, 22. Dezember 2009 01:27:52 schrieb [email protected]:

Quoted 5 lines

From: Roel Kluin <[email protected]>

rsp->count is unsigned so the test does not work.

[...]

This patch is on its way upstream
See http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=49829ea74f790d3be2e803a617e714f5b9a5ed50

and in the DRBD tree for old kernels...
http://git.drbd.org/?p=drbd-8.3.git;a=commit;h=f1cb8ce303a26e4763bbfb32660643322f4e228d

Quoted 8 lines
Quoted 3 lines

Indeed, it's been in my for-linus/next for a while, I'm guessing Andrew just hasn't updated his sources for some days.

I pull linux-next every day.

The above patch wasn't in the Dec 19 linux-next, and Stephen won't be doing another -next until Dec 29.

Oh, so that's why. We/I used to have for-akpm, but with -next that has become more tricky (since you base on that).

Anyway, not an issue for me, the only change is having to notify about merged patches for the odd ball periods like now were Stephen isn't doing daily releases.

Signature · 1 line
Jens Axboe