Skip to content

Commit

Permalink
JFS: call io_schedule() instead of schedule() to avoid deadlock
Browse files Browse the repository at this point in the history
The introduction of Jens Axboe's explicit i/o plugging patches introduced a
deadlock in jfs.  This was caused by the process initiating I/O not
unplugging the queue before waiting on the commit thread.  The commit
thread itself was waiting for that I/O to complete.  Calling io_schedule()
rather than schedule() unplugs the I/O queue avoiding the deadlock, and it
appears to be the right function to call in any case.

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
  • Loading branch information
Dave Kleikamp committed Jan 18, 2007
1 parent 82d5b9a commit 4aa0d23
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs/jfs/jfs_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ do { \
if (cond) \
break; \
unlock_cmd; \
schedule(); \
io_schedule(); \
lock_cmd; \
} \
current->state = TASK_RUNNING; \
Expand Down
2 changes: 1 addition & 1 deletion fs/jfs/jfs_metapage.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static inline void __lock_metapage(struct metapage *mp)
set_current_state(TASK_UNINTERRUPTIBLE);
if (metapage_locked(mp)) {
unlock_page(mp->page);
schedule();
io_schedule();
lock_page(mp->page);
}
} while (trylock_metapage(mp));
Expand Down
2 changes: 1 addition & 1 deletion fs/jfs/jfs_txnmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static inline void TXN_SLEEP_DROP_LOCK(wait_queue_head_t * event)
add_wait_queue(event, &wait);
set_current_state(TASK_UNINTERRUPTIBLE);
TXN_UNLOCK();
schedule();
io_schedule();
current->state = TASK_RUNNING;
remove_wait_queue(event, &wait);
}
Expand Down

0 comments on commit 4aa0d23

Please sign in to comment.