Skip to contentSkip to conversation

jiffies handling in md.c

PATCH New Michal Schmidt 1 participant 1 message Nov 28, 2004 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jiffies handling in md.c

Hello,
md_do_sync in md.c doesn't handle jiffies overflow correctly.
The attached patch fixes this by changing the comparison to use the time_after_eq macro. Only compile-tested.

drivers/md/md.c renamed from drivers/md/md.c.orig +1 -1
@@ -3394,7 +3394,7 @@ static void md_do_sync(mddev_t *mddev)
 			break;
 
 	repeat:
-		if (jiffies >= mark[last_mark] + SYNC_MARK_STEP ) {
+		if (time_after_eq(jiffies, mark[last_mark] + SYNC_MARK_STEP )) {
 			/* step marks */
 			int next = (last_mark+1) % SYNC_MARKS;