summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_extent_busy.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2017-02-13 22:48:30 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2017-02-16 17:20:12 -0800
commit75d65361cf3c0dae2af970c305e19c727b28a510 (patch)
tree9966e057017ba46f31d7ff653934290b1eb62e13 /fs/xfs/xfs_extent_busy.c
parent0e339ef8556d9e567aa7925f8892c263d79430d9 (diff)
xfs: split indlen reservations fairly when under reserved
Certain workoads that punch holes into speculative preallocation can cause delalloc indirect reservation splits when the delalloc extent is split in two. If further splits occur, an already short-handed extent can be split into two in a manner that leaves zero indirect blocks for one of the two new extents. This occurs because the shortage is large enough that the xfs_bmap_split_indlen() algorithm completely drains the requested indlen of one of the extents before it honors the existing reservation. This ultimately results in a warning from xfs_bmap_del_extent(). This has been observed during file copies of large, sparse files using 'cp --sparse=always.' To avoid this problem, update xfs_bmap_split_indlen() to explicitly apply the reservation shortage fairly between both extents. This smooths out the overall indlen shortage and defers the situation where we end up with a delalloc extent with zero indlen reservation to extreme circumstances. Reported-by: Patrick Dung <mpatdung@gmail.com> Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_extent_busy.c')
0 files changed, 0 insertions, 0 deletions