diff options
| author | Kemeng Shi <[email protected]> | 2024-12-13 12:25:21 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-01-25 06:47:27 +0000 |
| commit | 97db889b961ef3f849813de34bd3ea5715813ed0 (patch) | |
| tree | d1fe988b325c970f0140fe70bf7e85df08f6c5f9 /lib/xarray.c | |
| parent | Xarray: move forward index correctly in xas_pause() (diff) | |
| download | kernel-97db889b961ef3f849813de34bd3ea5715813ed0.tar.gz kernel-97db889b961ef3f849813de34bd3ea5715813ed0.zip | |
Xarray: distinguish large entries correctly in xas_split_alloc()
We don't support large entries which expand two more level xa_node in
split. For case "xas->xa_shift + 2 * XA_CHUNK_SHIFT == order", we also
need two level of xa_node to expand. Distinguish entry as large entry in
case "xas->xa_shift + 2 * XA_CHUNK_SHIFT == order".
As max order of folio in pagecache (MAX_PAGECACHE_ORDER) is <=
(XA_CHUNK_SHIFT * 2 - 1), this change is more likely a cleanup...
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Kemeng Shi <[email protected]>
Cc: Mattew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/xarray.c')
| -rw-r--r-- | lib/xarray.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/xarray.c b/lib/xarray.c index 091e2c927915..ecd2e4f71aa8 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -1027,7 +1027,7 @@ void xas_split_alloc(struct xa_state *xas, void *entry, unsigned int order, unsigned int mask = xas->xa_sibs; /* XXX: no support for splitting really large entries yet */ - if (WARN_ON(xas->xa_shift + 2 * XA_CHUNK_SHIFT < order)) + if (WARN_ON(xas->xa_shift + 2 * XA_CHUNK_SHIFT <= order)) goto nomem; if (xas->xa_shift + XA_CHUNK_SHIFT > order) return; |
