Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d417b49

Browse files
Matthew Wilcox (Oracle)torvalds
authored andcommitted
mm/filemap.c: remove bogus VM_BUG_ON
It is not safe to check page->index without holding the page lock. It can be changed if the page is moved between the swap cache and the page cache for a shmem file, for example. There is a VM_BUG_ON below which checks page->index is correct after taking the page lock. Link: https://lkml.kernel.org/r/[email protected] Fixes: 5c211ba ("mm: add and use find_lock_entries") Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reported-by: <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 61d0017 commit d417b49

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

mm/filemap.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,6 @@ unsigned find_lock_entries(struct address_space *mapping, pgoff_t start,
20932093
if (!xa_is_value(page)) {
20942094
if (page->index < start)
20952095
goto put;
2096-
VM_BUG_ON_PAGE(page->index != xas.xa_index, page);
20972096
if (page->index + thp_nr_pages(page) - 1 > end)
20982097
goto put;
20992098
if (!trylock_page(page))

0 commit comments

Comments
 (0)