mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-18 12:40:01 +10:00
xfs: Fix xfs_prepare_shift() range for RT
[ Upstream commit f23660f059
]
The RT extent range must be considered in the xfs_flush_unmap_range() call
to stabilize the boundary.
This code change is originally from Dave Chinner.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Acked-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e05d4d0641
commit
588d13c907
@ -1059,7 +1059,7 @@ xfs_prepare_shift(
|
||||
struct xfs_inode *ip,
|
||||
loff_t offset)
|
||||
{
|
||||
struct xfs_mount *mp = ip->i_mount;
|
||||
unsigned int rounding;
|
||||
int error;
|
||||
|
||||
/*
|
||||
@ -1077,11 +1077,13 @@ xfs_prepare_shift(
|
||||
* with the full range of the operation. If we don't, a COW writeback
|
||||
* completion could race with an insert, front merge with the start
|
||||
* extent (after split) during the shift and corrupt the file. Start
|
||||
* with the block just prior to the start to stabilize the boundary.
|
||||
* with the allocation unit just prior to the start to stabilize the
|
||||
* boundary.
|
||||
*/
|
||||
offset = round_down(offset, mp->m_sb.sb_blocksize);
|
||||
rounding = xfs_inode_alloc_unitsize(ip);
|
||||
offset = rounddown_64(offset, rounding);
|
||||
if (offset)
|
||||
offset -= mp->m_sb.sb_blocksize;
|
||||
offset -= rounding;
|
||||
|
||||
/*
|
||||
* Writeback and invalidate cache for the remainder of the file as we're
|
||||
|
Loading…
Reference in New Issue
Block a user