On Sun, Jun 19, 2022 at 05:01:29AM +0100, Al Viro wrote: > On Sat, Jun 18, 2022 at 06:35:37AM +0100, Al Viro wrote: > > > get_page(*p++ = page); > > - left -= size; > > Argh... > if (left <= PAGE_SIZE - off) > return maxsize; > > + left -= PAGE_SIZE - off; > > } > > if (!npages) > > return -EFAULT; > > - maxsize -= left; > > - iov_iter_advance(i, maxsize); > > - return maxsize; > > + return maxsize - left; > > } > > > > static ssize_t iter_xarray_populate_pages(struct page **pages, struct xarray *xa, > > -- > > 2.30.2 > > Might be better to have it return npages and let the caller do the usual min(maxsize, npages * PAGE_SIZE - offset) song and dance... Not sure. Anyway, with these fixes it seems to survive xfstests and ltp without regressions compared to mainline. Updated branch force-pushed...