mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
xfs: fix partially uninitialized structure in xfs_reflink_remap_extent
[ Upstream commit c142932c29
]
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>
This commit is contained in:
parent
99f7af9f5b
commit
27b8978b06
1 changed files with 1 additions and 0 deletions
|
@ -1125,6 +1125,7 @@ xfs_reflink_remap_extent(
|
|||
uirec.br_startblock = irec->br_startblock + rlen;
|
||||
uirec.br_startoff = irec->br_startoff + rlen;
|
||||
uirec.br_blockcount = unmap_len - rlen;
|
||||
uirec.br_state = irec->br_state;
|
||||
unmap_len = rlen;
|
||||
|
||||
/* If this isn't a real mapping, we're done. */
|
||||
|
|
Loading…
Reference in a new issue