]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
mm/filemap.c: remove bogus VM_BUG_ON
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 5 Nov 2021 20:37:10 +0000 (13:37 -0700)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:33:44 +0000 (07:33 +0100)
commit151dc3ca54f621b787f421b3e20cb87336da1579
tree714680392e0e85a01a0cdc7b4b553c03820571a4
parent8324c381985e7c2a4b6f86ba671489e1432924f9
mm/filemap.c: remove bogus VM_BUG_ON

BugLink: https://bugs.launchpad.net/bugs/1951822
commit d417b49fff3e2f21043c834841e8623a6098741d upstream.

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/20210818144932.940640-1-willy@infradead.org
Fixes: 5c211ba29deb ("mm: add and use find_lock_entries")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reported-by: <syzbot+c87be4f669d920c76330@syzkaller.appspotmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
mm/filemap.c