Skip to content

Commit 3c85cc4

Browse files
committed
Revert "io_uring/rsrc: disallow multi-source reg buffers"
This reverts commit edd4782. There's really no specific need to disallow multiple sources of buffers, and io_uring really should not be mandating this by itself. We should be able to solely rely on GUP making these decisions. As this also stands in the way of a cleanup where io_uring is the odd one out, kill it. Link: https://lore.kernel.org/all/61ded378-51a8-1dcb-b631-fda1903248a9@gmail.com/ Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent ea97f6c commit 3c85cc4

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

io_uring/rsrc.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,17 +1053,14 @@ struct page **io_pin_pages(unsigned long ubuf, unsigned long len, int *npages)
10531053
pret = pin_user_pages(ubuf, nr_pages, FOLL_WRITE | FOLL_LONGTERM,
10541054
pages, vmas);
10551055
if (pret == nr_pages) {
1056-
struct file *file = vmas[0]->vm_file;
1057-
10581056
/* don't support file backed memory */
10591057
for (i = 0; i < nr_pages; i++) {
1060-
if (vmas[i]->vm_file != file) {
1061-
ret = -EINVAL;
1062-
break;
1063-
}
1064-
if (!file)
1058+
struct vm_area_struct *vma = vmas[i];
1059+
1060+
if (vma_is_shmem(vma))
10651061
continue;
1066-
if (!vma_is_shmem(vmas[i]) && !is_file_hugepages(file)) {
1062+
if (vma->vm_file &&
1063+
!is_file_hugepages(vma->vm_file)) {
10671064
ret = -EOPNOTSUPP;
10681065
break;
10691066
}

0 commit comments

Comments
 (0)