]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: don't create overlapping extents in xfs_bmap_add_extent_delay_real
authorChristoph Hellwig <hch@lst.de>
Fri, 3 Nov 2017 17:34:38 +0000 (10:34 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 6 Nov 2017 19:53:38 +0000 (11:53 -0800)
commite2ec5a14fc28d3cd5e674e3ae23494115d117f4f
treeca5e5871cf639baa91acc37860726b89648adb83
parent94af865d672efd8e961f7a6f63b0464ceb9634b8
xfs: don't create overlapping extents in xfs_bmap_add_extent_delay_real

Two cases in xfs_bmap_add_extent_delay_real currently insert a new
extent before updating the existing one that is being split.  While
this works fine with a simple extent list, a more complex tree can't
easily cope with overlapping extent.  Reshuffle the code a bit to update
the slot of the existing delalloc extent to the new real extent before
inserting the shortened delalloc extent before or after it.  This
avoids the overlapping extents while still allowing to update the
br_startblock field of the delalloc extent with the updated indirect
block reservation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-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>
fs/xfs/libxfs/xfs_bmap.c