• Darrick J. Wong's avatar
    xfs: allow pausing of pending deferred work items · 4dffb2cb
    Darrick J. Wong authored
    Traditionally, all pending deferred work attached to a transaction is
    finished when one of the xfs_defer_finish* functions is called.
    However, online repair wants to be able to allocate space for a new data
    structure, format a new metadata structure into the allocated space, and
    commit that into the filesystem.
    
    As a hedge against system crashes during repairs, we also want to log
    some EFI items for the allocated space speculatively, and cancel them if
    we elect to commit the new data structure.
    
    Therefore, introduce the idea of pausing a pending deferred work item.
    Log intent items are still created for paused items and relogged as
    necessary.  However, paused items are pushed onto a side list before we
    start calling ->finish_item, and the whole list is reattach to the
    transaction afterwards.  New work items are never attached to paused
    pending items.
    
    Modify xfs_defer_cancel to clean up pending deferred work items holding
    a log intent item but not a log intent done item, since that is now
    possible.
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    4dffb2cb
xfs_trace.h 139 KB