# Re: \[PATCH 09/17\] xfs: move PI generation into xfs\_submit\_zoned\_bio

- From: Christoph Hellwig \<hch@lst.de\>
- Date: 2026-09-07 05:51:18 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2026/09/17522706
- Thread: https://ratatoskr.run/linux-block/2026/08/17483040/t.md

```text
On Wed, Sep 02, 2026 at 11:52:21PM +0530, Anuj Gupta wrote:
> >  xfs_open_zone_free_rcu(
> > @@ -890,6 +891,8 @@ xfs_submit_zoned_bio(
> >  		xfs_mark_rtg_boundary(ioend);
> >  	}
> >  
> > +	if (ioend->io_flags & IOMAP_IOEND_INTEGRITY)
> > +		fs_bio_integrity_generate(&ioend->io_bio);
> >  	submit_bio(&ioend->io_bio);
> 
> It seems to me that IOMAP_IOEND_INTEGRITY might never be set here. The
> zoned write iomaps in xfs_zoned_map_blocks() and
> xfs_zoned_direct_write_iomap_begin() do not set IOMAP_F_INTEGRITY based
> on bdev_has_integrity_csum(). Should both paths set it? I didn't have a
> zoned device to confirm this so this is just from a bit of code reading
> only.
> 
> This looks like a pre-existing bug from 6bbb4d96f797 ("xfs: support T10
> protection information") which can be fixed with something like this?

Yeah.  I'm pretty sure I had a fix for this in the queue, but it looks
like that got lost when rebasing on top of xfs_iomap_set_anon_write,
which itself came from a Sashiko review for a trivial bug when
setting this flag.

> [PATCH] xfs: set IOMAP_F_INTEGRITY for zoned writes on integrity devices
> 
> Neither xfs_zoned_map_blocks() nor xfs_zoned_direct_write_iomap_begin()
> sets IOMAP_F_INTEGRITY based on bdev_has_integrity_csum(), so PI
> generation is silently skipped for zoned writes on integrity-enabled
> devices. Add the check in both paths.

This seems to be against a tree that doens't have
xfs_iomap_set_anon_write yet.  I've rebased it on top of that and
added it to my queue (keeping your attribution).

```
