Commit db119cd4 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] fix missing unlock_page in mm/rmap.c

A required unlock_page will be missed in a very rare (but possible) race
condition. Acked by Hugh, who says:

	It'll be hard to hit because of the additional page_mapped test above,
	with truncate unmapping ptes from mms before it advances to removing
	pages from cache; but nothing to prevent it happening.
Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a35ed119
...@@ -405,8 +405,9 @@ int page_referenced(struct page *page, int is_locked) ...@@ -405,8 +405,9 @@ int page_referenced(struct page *page, int is_locked)
referenced += page_referenced_file(page); referenced += page_referenced_file(page);
else if (TestSetPageLocked(page)) else if (TestSetPageLocked(page))
referenced++; referenced++;
else if (page->mapping) { else {
referenced += page_referenced_file(page); if (page->mapping)
referenced += page_referenced_file(page);
unlock_page(page); unlock_page(page);
} }
} }
......
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