On Wed, Mar 24, 2021 at 03:21:24PM +0100, Christoph Hellwig wrote:
The i_cowextsize field is only used for v3 inodes, and the i_flushiter
field is only used for v1/v2 inodes. Use a union to pack the inode a
littler better after adding a few missing guards around their usage.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Hmm, so this patch caused a regression on V4 filesystems xfs/051. It
looks like the flush iter gets set to zero and then log recovery forgets
to replay the inode(?)
The following patch fixes it for me, FWIW...
--D
xfs: fix regression in xfs/051 with this patch
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 205ee7da8fa5..795c23e5c655 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1525,11 +1525,12 @@ xfs_ioctl_setattr(
ip->i_extsize = fa->fsx_extsize >> mp->m_sb.sb_blocklog;
else
ip->i_extsize = 0;
- if (xfs_sb_version_has_v3inode(&mp->m_sb) &&
- (ip->i_d.di_flags2 & XFS_DIFLAG2_COWEXTSIZE))
- ip->i_cowextsize = fa->fsx_cowextsize >> mp->m_sb.sb_blocklog;
- else
- ip->i_cowextsize = 0;
+ if (xfs_sb_version_has_v3inode(&mp->m_sb)) {
+ if (ip->i_d.di_flags2 & XFS_DIFLAG2_COWEXTSIZE)
+ ip->i_cowextsize = XFS_B_TO_FSBT(mp, fa->fsx_cowextsize);
+ else
+ ip->i_cowextsize = 0;
+ }
error = xfs_trans_commit(tp);