1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-13 10:05:39 +00:00
David Hildenbrand 80e7bb74d4 scatterlist: disallow non-contigous page ranges in a single SG entry
The expectation is that there is currently no user that would pass in
non-contigous page ranges: no allocator, not even VMA, will hand these
out.

The only problematic part would be if someone would provide a range
obtained directly from memblock, or manually merge problematic ranges.  If
we find such cases, we should fix them to create separate SG entries.

Let's check in sg_set_page() that this is really the case.  No need to
check in sg_set_folio(), as pages in a folio are guaranteed to be
contiguous.  As sg_set_page() gets inlined into modules, we have to export
the page_range_contiguous() helper -- use EXPORT_SYMBOL, there is nothing
special about this helper such that we would want to enforce GPL-only
modules.

We can now drop the nth_page() usage in sg_page_iter_page().

Link: https://lkml.kernel.org/r/20250901150359.867252-25-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-09-21 14:22:06 -07:00
..
2025-07-29 11:42:31 -07:00
2025-07-31 11:50:25 -07:00
2025-07-23 01:38:56 -04:00
2025-07-31 13:43:02 -07:00
2025-08-02 12:07:09 -07:00
2025-07-31 13:43:02 -07:00
2025-08-09 07:20:44 +03:00
2025-07-31 13:16:09 -07:00
2025-07-29 20:21:54 -07:00
2025-07-21 18:18:51 +01:00
2025-07-31 11:28:03 -04:00
2025-07-31 18:23:53 -07:00
2025-08-01 15:47:06 -07:00
2025-07-29 17:42:52 -07:00
2025-07-31 16:52:32 -07:00
2025-07-07 12:24:50 +02:00
2025-07-29 12:15:39 -07:00
2025-06-27 16:38:02 -07:00
2025-08-09 18:10:01 +03:00
2025-07-22 15:57:02 +00:00
2025-07-30 09:58:50 -07:00
2025-08-04 16:27:21 -07:00
2025-07-16 14:28:21 +02:00
2025-07-19 18:59:51 -07:00
2025-07-24 19:12:32 -07:00
2025-07-28 16:30:12 -07:00
2025-08-02 12:06:10 -07:00
2025-07-31 12:43:08 -07:00
2025-07-30 17:14:01 -07:00
2025-07-02 17:18:01 +01:00
2025-07-17 06:01:16 -06:00
2025-09-13 16:55:20 -07:00
2025-09-13 16:55:10 -07:00
2025-09-13 16:54:50 -07:00
2025-09-13 16:55:07 -07:00
2025-09-13 16:55:07 -07:00
2025-07-09 22:41:56 -07:00
2025-09-13 16:55:20 -07:00
2025-08-06 07:32:52 +03:00
2025-08-06 07:32:52 +03:00
2025-07-30 17:14:01 -07:00
2025-08-01 15:47:06 -07:00
2025-07-14 15:20:02 -07:00
2025-07-14 15:20:02 -07:00
2025-07-08 19:11:57 -04:00
2025-09-13 16:55:20 -07:00
2025-07-30 16:23:12 -07:00
2025-07-31 16:11:43 -05:00
2025-09-13 16:55:07 -07:00
2025-07-09 19:32:30 -07:00
2025-06-19 14:28:24 +02:00
2025-06-19 14:28:24 +02:00
2025-07-29 11:42:31 -07:00
2025-07-22 18:07:11 +02:00
2025-07-01 12:29:29 +02:00
2025-07-10 09:39:18 +02:00
2025-08-03 15:03:04 -07:00
2025-07-28 18:20:32 -07:00
2025-07-29 13:00:20 -07:00
2025-08-04 10:54:36 -07:00
2025-07-19 10:17:56 +05:30
2025-07-30 19:26:49 -07:00
2025-07-23 11:56:02 +02:00
2025-07-21 17:48:32 -07:00
2025-06-25 15:12:17 -07:00
Hi,
2025-07-28 18:18:16 -07:00
2025-06-26 09:44:45 -07:00
2025-08-01 14:17:48 -07:00
2025-07-17 11:26:56 +02:00
2025-09-13 16:55:14 -07:00
2025-08-02 12:01:37 -07:00