On Thu, Dec 14, 2023 at 01:47:18PM -0800, Darrick J. Wong wrote: > On Fri, Dec 15, 2023 at 08:40:35AM +1100, Dave Chinner wrote: > > diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c > > index 157ae90d3d52..0287918c03dc 100644 > > --- a/fs/xfs/xfs_inode_item.c > > +++ b/fs/xfs/xfs_inode_item.c > > @@ -557,6 +557,9 @@ xfs_inode_to_log_dinode( > > memset(to->di_pad2, 0, sizeof(to->di_pad2)); > > uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid); > > to->di_v3_pad = 0; > > + > > + /* dummy value for initialisation */ > > + to->di_crc = 0; > > I wonder if the log should be using kzalloc instead of kmalloc for > buffers that will end up on disk? Kind of a nasty performance hit > just for the sake of paranoia, though. That's really only an issue for the xfs_log_dinode - it's really the only structure copy we do in log formating. For the rest of the structures we are simply doing memcpy of large ranges of data into the allocated space and there's really no point in zeroing memory ranges that we are just about to entirely copy over. Especially considering item formatting is the hottest part of the transaction commit path.... > Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx> Thanks! -Dave. -- Dave Chinner david@xxxxxxxxxxxxx