• Darrick J. Wong's avatar
    xfs: don't leak recovered attri intent items · 07bcbdf0
    Darrick J. Wong authored
    If recovery finds an xattr log intent item calling for the removal of an
    attribute and the file doesn't even have an attr fork, we know that the
    removal is trivially complete.  However, we can't just exit the recovery
    function without doing something about the recovered log intent item --
    it's still on the AIL, and not logging an attrd item means it stays
    there forever.
    
    This has likely not been seen in practice because few people use LARP
    and the runtime code won't log the attri for a no-attrfork removexattr
    operation.  But let's fix this anyway.
    
    Also we shouldn't really be testing the attr fork presence until we've
    taken the ILOCK, though this doesn't matter much in recovery, which is
    single threaded.
    
    Fixes: fdaf1bb3 ("xfs: ATTR_REPLACE algorithm with LARP enabled needs rework")
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    07bcbdf0
xfs_attr_item.c 23.8 KB