Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit f23660f0 authored by John Garry's avatar John Garry Committed by Chandan Babu R
Browse files

xfs: Fix xfs_prepare_shift() range for RT


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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarJohn Garry <john.g.garry@oracle.com>
Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
parent d3b689d7
Branches
Tags
No related merge requests found
......@@ -902,7 +902,7 @@ xfs_prepare_shift(
struct xfs_inode *ip,
loff_t offset)
{
struct xfs_mount *mp = ip->i_mount;
unsigned int rounding;
int error;
/*
......@@ -920,11 +920,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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment