]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
xfs: fix partially uninitialized structure in xfs_reflink_remap_extent
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 12 Apr 2020 20:11:11 +0000 (13:11 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 25 May 2020 08:42:11 +0000 (10:42 +0200)
commit048c07c6b7fe757a6ec0ed5cde4bec0798ad7f53
tree2104578deb6544dd1afb870062012a7ee52aeb5f
parente57f71108e7233484c01ab34837a7ffe94452c8c
xfs: fix partially uninitialized structure in xfs_reflink_remap_extent

BugLink: https://bugs.launchpad.net/bugs/1876765
[ Upstream commit c142932c29e533ee892f87b44d8abc5719edceec ]

In the reflink extent remap function, it turns out that uirec (the block
mapping corresponding only to the part of the passed-in mapping that got
unmapped) was not fully initialized.  Specifically, br_state was not
being copied from the passed-in struct to the uirec.  This could lead to
unpredictable results such as the reflinked mapping being marked
unwritten in the destination file.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/xfs/xfs_reflink.c