xfs: rearrange code in xfs_inode_item_precommit
authorDave Chinner <dchinner@redhat.com>
Wed, 17 Sep 2025 22:12:53 +0000 (08:12 +1000)
committerCarlos Maiolino <cem@kernel.org>
Tue, 23 Sep 2025 13:12:37 +0000 (15:12 +0200)
commitbc7d684fea18cc48c3630d2b7f1789000ff2df5b
treef80a35e7f5a0e60fb53d7fc83739289db09d4c32
parentfc0d192303bd385ac24dc52eb31ceb6ca7e027d0
xfs: rearrange code in xfs_inode_item_precommit

There are similar extsize checks and updates done inside and outside
the inode item lock, which could all be done under a single top
level logic branch outside the ili_lock. The COW extsize fixup can
potentially miss updating the XFS_ILOG_CORE in ili_fsync_fields, so
moving this code up above the ili_fsync_fields update could also be
considered a fix.

Further, to make the next change a bit cleaner, move where we
calculate the on-disk flag mask to after we attach the cluster
buffer to the the inode log item.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_inode_item.c