-
Zhang Yi authored
Commit '943bc088 ("iomap: don't increase i_size if it's not a write operation")' breaks xfs with realtime device on generic/561, the problem is when unaligned truncate down a xfs realtime inode with rtextsize > 1 fs block, xfs only zero out the EOF block but doesn't zero out the tail blocks that aligned to rtextsize, so if we don't increase i_size in iomap_write_end(), it could expose stale data after we do an append write beyond the aligned EOF block. xfs should zero out the tail blocks when truncate down, but before we finish that, let's fix the issue by just revert the changes in iomap_write_end(). Fixes: 943bc088 ("iomap: don't increase i_size if it's not a write operation") Reported-by:
Chandan Babu R <chandanbabu@kernel.org> Link: https://lore.kernel.org/linux-xfs/0b92a215-9d9b-3788-4504-a520778953c2@huaweicloud.comSigned-off-by:
Zhang Yi <yi.zhang@huawei.com> Link: https://lore.kernel.org/r/20240603112222.2109341-1-yi.zhang@huaweicloud.comTested-by:
Chandan Babu R <chandanbabu@kernel.org> Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Christian Brauner <brauner@kernel.org>
0841ea4a