[PATCH] Fix Intel/Sharp command set erase suspend bug
authorJoakim Tjernlund <[email protected]>
Tue, 28 Nov 2006 23:11:52 +0000 (23:11 +0000)
committerLinus Torvalds <[email protected]>
Wed, 29 Nov 2006 01:26:50 +0000 (17:26 -0800)
When we sleep and wait for a suspended operation to be resumed, go
back and check until it's ready -- don't just continue after the first
time we're woken. This can cause file system corruption.

Signed-off-by: Joakim Tjernlund <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/mtd/chips/cfi_cmdset_0001.c

index 7ea49a0d5ec32490633e27a3219e9b2335c3024b..296159ec5189eafc0e6c68d118bde8772725ac95 100644 (file)
@@ -1087,7 +1087,7 @@ static int inval_cache_and_wait_for_operation(
                }
                spin_lock(chip->mutex);
 
-               if (chip->state != chip_state) {
+               while (chip->state != chip_state) {
                        /* Someone's suspended the operation: sleep */
                        DECLARE_WAITQUEUE(wait, current);
                        set_current_state(TASK_UNINTERRUPTIBLE);