mm/filemap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/filemap.c b/mm/filemap.c index f0ae9a6308cb..ee73d33465b6 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1150,6 +1150,12 @@ static inline int wait_on_page_bit_common(wait_queue_head_t *q, io_schedule(); if (behavior == EXCLUSIVE) { + /* + * Make sure we don't get any exclusive wakeups + * after this point! + */ + __set_current_state(TASK_RUNNING); + smp_mb__before_atomic(); if (!test_and_set_bit_lock(bit_nr, &page->flags)) break; } else if (behavior == SHARED) {