fix missing unlock_page in mm/rmap.c
Subsystems (2)
PATCH 1/1 fix missing unlock_page in mm/rmap.c
Please apply.
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 Nick Piggin <[email protected]>
Signed-off-by Hugh Dickins <[email protected]>
---
linux-2.6-npiggin/mm/rmap.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
mm/rmap.c renamed from mm/rmap.c~mm-rmap-missing-unlock +3 -2
@@ -406,8 +406,9 @@ int page_referenced(struct page *page, i referenced +=page_referenced_file (page); else if (TestSetPageLocked(page)) referenced++; - else if (page->mapping) { - referenced +=page_referenced_file (page); + else { +if (page->mapping) + referenced +=page_referenced_file (page);unlock_page (page); } }
_
Quoted 8 lines · Nick Piggin
Please apply.
A requiredunlock_pagewill be missed in a very rare (but possible) race condition. Acked by Hugh, who says:
It'll be hard to hit because of the additionalpage_mappedtest above, with truncate unmapping ptes from mms before it advances to removing pages from cache; but nothing to prevent it happening.Signed-off-by Nick Piggin <[email protected]>Signed-off-by Hugh Dickins <[email protected]>
I've hit a missing unlock_page(). I'll see if this fixed it.
-- wli