On 07/05/2024 21:58, Darrick J. Wong wrote:
- rounding = max_t(xfs_off_t, mp->m_sb.sb_blocksize, PAGE_SIZE);
+ /*
+ * Make sure we extend the flush out to extent alignment
+ * boundaries so any extent range overlapping the start/end
+ * of the modification we are about to do is clean and idle.
+ */
+ rounding = max_t(xfs_off_t, xfs_inode_alloc_unitsize(ip), PAGE_SIZE);
start = round_down(offset, rounding);
round_down requires the divisor to be a power of two.
well spotted, and so the round_up() call, below, also needs fixing.
--D
end = round_up(offset + len, rounding) - 1;