From: Milan Broz <[email-masked]>

Add cond_resched() to prevent monopolising CPU when
processing large bios.

dm-crypt processes encryption of bios in sector units.
If the bio request is big it can spend a long time in
the encryption call.

Signed-off-by: Milan Broz <[email-masked]>
Signed-off-by: Alasdair G Kergon <[email-masked]>
---
 drivers/md/dm-crypt.c |    1 +
 1 files changed, 1 insertion(+)

Index: linux-2.6.25-rc4/drivers/md/dm-crypt.c
===================================================================
--- linux-2.6.25-rc4.orig/drivers/md/dm-crypt.c	2008-03-07 16:01:49.000000000 +0000
+++ linux-2.6.25-rc4/drivers/md/dm-crypt.c	2008-03-07 16:01:52.000000000 +0000
@@ -432,6 +432,7 @@ static int crypt_convert(struct crypt_co
 			/* fall through*/
 		case 0:
 			ctx->sector++;
+			cond_resched();
 			continue;
 		}