Re: [PATCH 1/5] xfs: handle NULL open_zone for merged ioends in xfs_ioend_put_open_zones
"Darrick J. Wong" <[email protected]>
| Newsgroups | org.kernel.vger.linux-xfs |
|---|---|
| Message-ID | <20260810180946.GT3556460@frogsfrogsfrogs> |
On Mon, Aug 10, 2026 at 08:37:42AM -0700, Christoph Hellwig wrote:
> In theory we could fail multiple ioends before an open zoned was assigned
...an open zone...
> to them, and the iomap code could merge them. Check for NULL not only
> for the main ioend but also all merged ones on ->io_list to handle this
> case.
>
> Fixes: 058dd70c65ab ("xfs: implement buffered writes to zoned RT devices")
> Signed-off-by: Christoph Hellwig <[email protected]>
Seems reasonable to me.
Reviewed-by: "Darrick J. Wong" <[email protected]>
--D
> ---
> fs/xfs/xfs_aops.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index 2a0c54256e93..c80f05507373 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -89,8 +89,10 @@ xfs_ioend_put_open_zones(
> /*
> * Put the open zone for all ioends merged into this one (if any).
> */
> - list_for_each_entry(tmp, &ioend->io_list, io_list)
> - xfs_open_zone_put(tmp->io_private);
> + list_for_each_entry(tmp, &ioend->io_list, io_list) {
> + if (tmp->io_private)
> + xfs_open_zone_put(tmp->io_private);
> + }
>
> /*
> * The main ioend might not have an open zone if the submission failed
> --
> 2.53.0
>
>