xfs: add missing error check in xfs_prepare_shift()
PATCH 1/1 xfs: add missing error check in xfs_prepare_shift()
xfs_prepare_shift() fails to check the error return from xfs_flush_unmap_range(). If the latter fails, that could lead to an insert/collapse range operation over a delalloc range, which is not supported.
Add an error check and return appropriately. This is reproduced rarely by generic/475.
--- fs/xfs/xfs_bmap_util.c | 2 ++ 1 file changed, 2 insertions(+)
fs/xfs/xfs_bmap_util.c +2 -0
@@ -1193,6 +1193,8 @@ xfs_prepare_shift(* about to shift down every extent from offset to EOF. */ error =xfs_flush_unmap_range (ip, offset,XFS_ISIZE (ip)); +if (error) +return error;/* * Clean out anything hanging around in the cow fork now that
Signature · 1 line
2.17.2
Quoted 9 lines · Brian Foster
xfs_prepare_shift()fails to check the error return fromxfs_flush_unmap_range(). If the latter fails, that could lead to an insert/collapse range operation over a delalloc range, which is not supported.Add an error check and return appropriately. This is reproduced rarely by generic/475.
Signed-off-by Brian Foster <[email protected]>
Looks ok,
--D
Quoted 20 lines
--- fs/xfs/xfs_bmap_util.c | 2 ++ 1 file changed, 2 insertions(+)fs/xfs/xfs_bmap_util.c +2
-0@@ -1193,6 +1193,8 @@ xfs_prepare_shift(* about to shift down every extent from offset to EOF. */ error =xfs_flush_unmap_range (ip, offset,XFS_ISIZE (ip)); +if (error) +return error;/* * Clean out anything hanging around in the cow fork now that Signature · 1 line
2.17.2
Looks ok to me. You can add my review:
Quoted 27 lines · Brian Foster
xfs_prepare_shift()fails to check the error return fromxfs_flush_unmap_range(). If the latter fails, that could lead to an insert/collapse range operation over a delalloc range, which is not supported.Add an error check and return appropriately. This is reproduced rarely by generic/475.
Signed-off-by Brian Foster <[email protected]>--- fs/xfs/xfs_bmap_util.c | 2 ++ 1 file changed, 2 insertions(+)fs/xfs/xfs_bmap_util.c +2
-0@@ -1193,6 +1193,8 @@ xfs_prepare_shift(* about to shift down every extent from offset to EOF. */ error =xfs_flush_unmap_range (ip, offset,XFS_ISIZE (ip)); +if (error) +return error;/* * Clean out anything hanging around in the cow fork now that
Quoted 18 lines · Brian Foster
xfs_prepare_shift()fails to check the error return fromxfs_flush_unmap_range(). If the latter fails, that could lead to an insert/collapse range operation over a delalloc range, which is not supported.Add an error check and return appropriately. This is reproduced rarely by generic/475.
Signed-off-by Brian Foster <[email protected]>--- fs/xfs/xfs_bmap_util.c | 2 ++ 1 file changed, 2 insertions(+)fs/xfs/xfs_bmap_util.c +0
-0
fs/xfs/xfs_bmap_util.c xfs_prepare_shift( · line 1197
Quoted 5 lines
fs/xfs/xfs_bmap_util.c +2
-0@@ -1193,6 +1193,8 @@ xfs_prepare_shift(* about to shift down every extent from offset to EOF. */ error =xfs_flush_unmap_range (ip, offset,XFS_ISIZE (ip)); +if (error) +return error;
Urk. My fault.
Not sure how I screwed up that simple change so obviously and didn't notice it.
Fix for the fix looks good.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]