xfs: zero inode fork buffer at allocation
authorDave Chinner <dchinner@redhat.com>
Wed, 4 May 2022 01:44:55 +0000 (11:44 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 4 May 2022 01:44:55 +0000 (11:44 +1000)
commitcb512c921639613ce03f87e62c5e93ed9fe8c84d
tree1b639239a3010248ec1f1dd0ba1f8cec49a0bb8e
parenta44a027a8b2a20fec30e0e9c99b0eb41c03e7420
xfs: zero inode fork buffer at allocation

When we first allocate or resize an inline inode fork, we round up
the allocation to 4 byte alingment to make journal alignment
constraints. We don't clear the unused bytes, so we can copy up to
three uninitialised bytes into the journal. Zero those bytes so we
only ever copy zeros into the journal.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_inode_fork.c