浏览代码

[PATCH] Fix Intel/Sharp command set erase suspend bug

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 <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Joakim Tjernlund 18 年之前
父节点
当前提交
967bf623e9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/mtd/chips/cfi_cmdset_0001.c

+ 1 - 1
drivers/mtd/chips/cfi_cmdset_0001.c

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