On 2026-01-28 17:15:10, Christoph Hellwig wrote:
> +static inline const struct iomap_read_ops *
> +xfs_bio_read_ops(
> +     const struct xfs_inode          *ip)
> +{
> +     if (bdev_has_integrity_csum(xfs_inode_buftarg(ip)->bt_bdev))
> +             return &xfs_bio_read_integrity_ops;
> +     return &iomap_bio_read_ops;
> +}
> +
>  STATIC int
>  xfs_vm_read_folio(
> -     struct file             *unused,
> -     struct folio            *folio)
> +     struct file                     *file,
> +     struct folio                    *folio)
>  {
> -     iomap_bio_read_folio(folio, &xfs_read_iomap_ops);
> +     struct iomap_read_folio_ctx     ctx = {
> +             .cur_folio      = folio,
> +             .ops            = 
> xfs_bio_read_ops(XFS_I(file->f_mapping->host)),

Hmm, can we use folio->mapping->host here instead? Adding fsverity,
read_mapping_folio() will be called without file reference in
generic_read_merkle_tree_page() (from your patchset). This in turn
is called from fsverity_verify_bio() in the ioend callback, which
only has bio reference. 

> +     };
> +
> +     iomap_read_folio(&xfs_read_iomap_ops, &ctx);
>       return 0;
>  }

-- 
- Andrey


Reply via email to