Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4aa0d230 authored by Dave Kleikamp's avatar Dave Kleikamp
Browse files

JFS: call io_schedule() instead of schedule() to avoid deadlock



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: default avatarDave Kleikamp <shaggy@austin.ibm.com>
parent 82d5b9a7
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -42,7 +42,7 @@ do { \
		if (cond)				\
		if (cond)				\
			break;				\
			break;				\
		unlock_cmd;				\
		unlock_cmd;				\
		schedule();				\
		io_schedule();				\
		lock_cmd;				\
		lock_cmd;				\
	}						\
	}						\
	current->state = TASK_RUNNING;			\
	current->state = TASK_RUNNING;			\
+1 −1
Original line number Original line Diff line number Diff line
@@ -56,7 +56,7 @@ static inline void __lock_metapage(struct metapage *mp)
		set_current_state(TASK_UNINTERRUPTIBLE);
		set_current_state(TASK_UNINTERRUPTIBLE);
		if (metapage_locked(mp)) {
		if (metapage_locked(mp)) {
			unlock_page(mp->page);
			unlock_page(mp->page);
			schedule();
			io_schedule();
			lock_page(mp->page);
			lock_page(mp->page);
		}
		}
	} while (trylock_metapage(mp));
	} while (trylock_metapage(mp));
+1 −1
Original line number Original line Diff line number Diff line
@@ -135,7 +135,7 @@ static inline void TXN_SLEEP_DROP_LOCK(wait_queue_head_t * event)
	add_wait_queue(event, &wait);
	add_wait_queue(event, &wait);
	set_current_state(TASK_UNINTERRUPTIBLE);
	set_current_state(TASK_UNINTERRUPTIBLE);
	TXN_UNLOCK();
	TXN_UNLOCK();
	schedule();
	io_schedule();
	current->state = TASK_RUNNING;
	current->state = TASK_RUNNING;
	remove_wait_queue(event, &wait);
	remove_wait_queue(event, &wait);
}
}