summaryrefslogtreecommitdiff
path: root/.gitattributes
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-05-28 16:30:22 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-06-01 21:16:28 -0700
commit9b6506b756a606d00a6c9c0d0c11bd0788f15451 (patch)
tree990ada16df7486df3e98b593880e9bb22f21883d /.gitattributes
parent5355c984a2b76afbad8398986ded547a9c0370b4 (diff)
xfs: redesign the reflink remap loop to fix blkres depletion crash
The existing reflink remapping loop has some structural problems that need addressing: The biggest problem is that we create one transaction for each extent in the source file without accounting for the number of mappings there are for the same range in the destination file. In other words, we don't know the number of remap operations that will be necessary and we therefore cannot guess the block reservation required. On highly fragmented filesystems (e.g. ones with active dedupe) we guess wrong, run out of block reservation, and fail. The second problem is that we don't actually use the bmap intents to their full potential -- instead of calling bunmapi directly and having to deal with its backwards operation, we could call the deferred ops xfs_bmap_unmap_extent and xfs_refcount_decrease_extent instead. This makes the frontend loop much simpler. A third (and more minor) problem is that we aren't even clever enough to skip the whole remapping thing if the source and destination ranges point to the same physical extents. Solve all of these problems by refactoring the remapping loops so that we only perform one remapping operation per transaction, and each operation only tries to remap a single extent from source to dest. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions