• Darrick J. Wong's avatar
    xfs: use atomic extent swapping to fix user file fork data · 629fdaf5
    Darrick J. Wong authored
    Build on the code that was recently added to the temporary repair file
    code so that we can atomically switch the contents of any file fork,
    even if the fork is in local format.  The upcoming functions to repair
    xattrs, directories, and symlinks will need that capability.
    
    Repair can lock out access to these user files by holding IOLOCK_EXCL on
    these user files.  Therefore, it is safe to drop the ILOCK of both the
    file being repaired and the tempfile being used for staging, and cancel
    the scrub transaction.  We do this so that we can reuse the resource
    estimation and transaction allocation functions used by a regular file
    exchange operation.
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    629fdaf5
xfs_exchmaps.c 33.5 KB