• Darrick J. Wong's avatar
    fs: wait for partially frozen filesystems · 59ba4fdd
    Darrick J. Wong authored
    Jan Kara suggested that when one thread is in the middle of freezing a
    filesystem, another thread trying to freeze the same fs but with a
    different freeze_holder should wait until the freezer reaches either end
    state (UNFROZEN or COMPLETE) instead of returning EBUSY immediately.
    
    Neither caller can do anything sensible with this race other than retry
    but they cannot really distinguish EBUSY as in "some other holder of the
    same type has the sb already frozen" from "freezing raced with holder of
    a different type".
    
    Plumb in the extra code needed to wait for the fs freezer to reach an
    end state and try the freeze again.
    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>
    Reviewed-by: default avatarJan Kara <jack@suse.cz>
    59ba4fdd
super.c 49.5 KB