Pull vfs iomap updates from Christian Brauner:
- Erofs page cache sharing preliminaries:
Plumb a void *private parameter through iomap_read_folio() and
iomap_readahead() into iomap_iter->private, matching iomap DIO. Erofs
uses this to replace a bogus kmap_to_page() call, as preparatory work
for page cache sharing.
- Fix for invalid folio access:
Fix an invalid folio access when a folio without iomap_folio_state
is fully submitted to the IO helper — the helper may call
folio_end_read() at any time, so ctx->cur_folio must be invalidated
after full submission.
* tag 'vfs-7.0-rc1.iomap' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
iomap: fix invalid folio access after folio_end_read()
erofs: hold read context in iomap_iter if needed
iomap: stash iomap read ctx in the private field of iomap_iter
if (!*bytes_submitted)
iomap_read_init(folio);
ret = ctx->ops->read_folio_range(iter, ctx, plen);
+ if (ret < 0)
+ fserror_report_io(iter->inode,
+ FSERR_BUFFERED_READ, pos,
+ plen, ret, GFP_NOFS);
if (ret)
return ret;
+
*bytes_submitted += plen;
+ /*
+ * If the entire folio has been read in by the IO
+ * helper, then the helper owns the folio and will end
+ * the read on it.
+ */
+ if (*bytes_submitted == folio_len)
+ ctx->cur_folio = NULL;
}
ret = iomap_iter_advance(iter, plen);