Commit 2a5992a6 authored by Dave Jones's avatar Dave Jones

[PATCH] Fix race in JFS

From Christoph Hellwig

http://oss.software.ibm.com/pipermail/jfs-patches/2002-March/000045.html
parent 7348d519
...@@ -2778,6 +2778,7 @@ int jfs_lazycommit(void) ...@@ -2778,6 +2778,7 @@ int jfs_lazycommit(void)
complete(&jfsIOwait); complete(&jfsIOwait);
do { do {
LAZY_LOCK(flags);
restart: restart:
WorkDone = 0; WorkDone = 0;
while ((tblk = TxAnchor.unlock_queue)) { while ((tblk = TxAnchor.unlock_queue)) {
...@@ -2789,7 +2790,6 @@ int jfs_lazycommit(void) ...@@ -2789,7 +2790,6 @@ int jfs_lazycommit(void)
*/ */
WorkDone = 1; WorkDone = 1;
LAZY_LOCK(flags);
/* /*
* Remove first transaction from queue * Remove first transaction from queue
*/ */
...@@ -2809,11 +2809,13 @@ int jfs_lazycommit(void) ...@@ -2809,11 +2809,13 @@ int jfs_lazycommit(void)
current->state = TASK_RUNNING; current->state = TASK_RUNNING;
schedule(); schedule();
} }
LAZY_LOCK(flags);
} }
if (WorkDone) if (WorkDone)
goto restart; goto restart;
LAZY_UNLOCK(flags);
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
schedule(); schedule();
} while (!jfs_thread_stopped()); } while (!jfs_thread_stopped());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment