Commit d0e6983
mm: shmem: fix incorrect index alignment for within_size policy
With enabling the shmem per-size within_size policy, using an incorrect
'order' size to round_up() the index can lead to incorrect i_size checks,
resulting in an inappropriate large orders being returned.
Changing to use '1 << order' to round_up() the index to fix this issue.
Additionally, adding an 'aligned_index' variable to avoid affecting the
index checks.
Link: https://lkml.kernel.org/r/77d8ef76a7d3d646e9225e9af88a76549a68aab1.1734593154.git.baolin.wang@linux.alibaba.com
Fixes: e7a2ab7 ("mm: shmem: add mTHP support for anonymous shmem")
Signed-off-by: Baolin Wang <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent 1167324 commit d0e6983
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1689 | 1689 | | |
1690 | 1690 | | |
1691 | 1691 | | |
| 1692 | + | |
1692 | 1693 | | |
1693 | 1694 | | |
1694 | 1695 | | |
| |||
1723 | 1724 | | |
1724 | 1725 | | |
1725 | 1726 | | |
1726 | | - | |
| 1727 | + | |
1727 | 1728 | | |
1728 | | - | |
| 1729 | + | |
1729 | 1730 | | |
1730 | 1731 | | |
1731 | 1732 | | |
| |||
0 commit comments