Commit d64519bf authored by Zefan Li's avatar Zefan Li

Fix incomplete backport of commit 0f792cf9

Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
parent 6883832b
......@@ -2929,13 +2929,17 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
unlock_page(pagecache_page);
put_page(pagecache_page);
}
if (page != pagecache_page)
unlock_page(page);
put_page(page);
out_mutex:
mutex_unlock(&hugetlb_instantiation_mutex);
/*
* Generally it's safe to hold refcount during waiting page lock. But
* here we just wait to defer the next page fault to avoid busy loop and
* the page is not used after unlocked before returning from the current
* page fault. So we are safe from accessing freed page, even if we wait
* here without taking refcount.
*/
if (need_wait_lock)
wait_on_page_locked(page);
return ret;
}
......
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