RE:(2) [PATCH v2] xfs: check the disk address for hardware atomic writes

From: Daejun Park

Date: Fri Nov 13 2026 - 05:56:12 EST


On Thu, Nov 12, 2026 at 08:29:42AM +0000, John Garry wrote:
> On 11/12/26 00:41, Daejun Park via B4 Relay wrote:
[...]
> > - if (!IS_ALIGNED(imap->br_startblock, imap->br_blockcount))
>
> Is there anywhere else in which we do an alignment check on
> br_startblock that relies on the group size to be a multiple of the HW
> awu max?

No, I did not find another one. This is the only check of the start
block for the REQ_ATOMIC path. Two other places depend on the group
alignment, but neither checks br_startblock:

- xfs_get_atomic_write_max_opt() already caps max_opt at
xfs_calc_group_awu_align_max(), the largest power-of-two factor of
the group size (from ec8f62cc109a).
- The allocator aligns the AG block number, not the disk address,
for example for XFS_BMAPI_EXTSZALIGN in
xfs_atomic_write_cow_iomap_begin(). In an unaligned AG, that extent
can still be misaligned on disk. With this patch, the next atomic
write to it goes through COW instead of failing.

Best regards,
Daejun