]> git.baikalelectronics.ru Git - kernel.git/commit
XArray: Update the LRU list in xas_split()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 31 Mar 2022 12:27:09 +0000 (08:27 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 31 Mar 2022 12:52:57 +0000 (08:52 -0400)
commit32b6ce1eb128dfc4f43683d24f4b765264c79fb4
tree0f74eca6af6a307a4a4ea604a759a71e82086ef2
parentdf9f993e61f22c8e64769a94aa61e43c22aa33f1
XArray: Update the LRU list in xas_split()

When splitting a value entry, we may need to add the new nodes to the LRU
list and remove the parent node from the LRU list.  The WARN_ON checks
in shadow_lru_isolate() catch this oversight.  This bug was latent
until we stopped splitting folios in shrink_page_list() with commit
7e8d117f46b5 ("mm/vmscan: Free non-shmem folios without splitting them").
That allows the creation of large shadow entries, and subsequently when
trying to page in a small page, we will split the large shadow entry
in __filemap_add_folio().

Fixes: 675da2af170c ("XArray: add xas_split")
Reported-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
lib/xarray.c