• Darrick J. Wong's avatar
    xfs: don't assert if cmap covers imap after cycling lock · 26870c3f
    Darrick J. Wong authored
    In xfs_reflink_fill_cow_hole, there's a debugging assertion that trips
    if (after cycling the ILOCK to get a transaction) the requeried cow
    mapping overlaps the start of the area being written.  IOWs, it trips if
    the hole in the cow fork that it's supposed to fill has been filled.
    
    This is trivially possible since we cycled ILOCK_EXCL.  If we trip the
    assertion, then we know that cmap is a delalloc extent because @found is
    false.  Fortunately, the bmapi_write call below will convert the
    delalloc extent to a real unwritten cow fork extent, so all we need to
    do here is remove the assertion.
    
    It turns out that generic/095 trips this pretty regularly with alwayscow
    mode enabled.
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    26870c3f
xfs_reflink.c 48.1 KB