Commit d5f416c
mm/mremap: catch invalid multi VMA moves earlier
Previously, any attempt to solely move a VMA would require that the
span specified reside within the span of that single VMA, with no gaps
before or afterwards.
After commit d23cb64 ("mm/mremap: permit mremap() move of multiple
VMAs"), the multi VMA move permitted a gap to exist only after VMAs.
This was done to provide maximum flexibility.
However, We have consequently permitted this behaviour for the move of
a single VMA including those not eligible for multi VMA move.
The change introduced here means that we no longer permit non-eligible
VMAs from being moved in this way.
This is consistent, as it means all eligible VMA moves are treated the
same, and all non-eligible moves are treated as they were before.
This change does not break previous behaviour, which equally would have
disallowed such a move (only in all cases).
[lorenzo.stoakes@oracle.com: do not incorrectly reference invalid VMA in VM_WARN_ON_ONCE()]
Link: https://lkml.kernel.org/r/b6dbda20-667e-4053-abae-8ed4fa84bb6c@lucifer.local
Link: https://lkml.kernel.org/r/2b5aad5681573be85b5b8fac61399af6fb6b68b6.1754218667.git.lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent 7c91e0b commit d5f416c
1 file changed
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1820 | 1820 | | |
1821 | 1821 | | |
1822 | 1822 | | |
1823 | | - | |
1824 | 1823 | | |
1825 | 1824 | | |
1826 | 1825 | | |
| 1826 | + | |
| 1827 | + | |
1827 | 1828 | | |
1828 | 1829 | | |
1829 | 1830 | | |
| |||
1836 | 1837 | | |
1837 | 1838 | | |
1838 | 1839 | | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
| 1840 | + | |
1842 | 1841 | | |
1843 | 1842 | | |
1844 | 1843 | | |
| |||
1867 | 1866 | | |
1868 | 1867 | | |
1869 | 1868 | | |
1870 | | - | |
1871 | | - | |
1872 | | - | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
1873 | 1878 | | |
1874 | 1879 | | |
1875 | 1880 | | |
| |||
1878 | 1883 | | |
1879 | 1884 | | |
1880 | 1885 | | |
1881 | | - | |
| 1886 | + | |
1882 | 1887 | | |
1883 | 1888 | | |
1884 | 1889 | | |
| |||
0 commit comments