• N
    md/raid5 - avoid deadlocks in get_active_stripe during reshape · a8c906ca
    NeilBrown 提交于
    md has functionality to 'quiesce' and array so that all pending
    IO completed and no new IO starts.  This is used to achieve a
    stable state before making internal changes.
    
    Currently this quiescing applies equally to normal IO, resync
    IO, and reshape IO.
    However there is a problem with applying it to reshape IO.
    Reshape can have multiple 'stripe_heads' that must be active together.
    If the quiesce come between allocating the first and the last of
    such a collection, then we deadlock, as the last will not be allocated
    until the quiesce is lifted, the quiesce will not be lifted until the
    first (which has been allocated) gets used, and that first cannot be
    used until the last is allocated.
    
    It is not necessary to inhibit reshape IO when a quiesce is
    requested.  Those places in the code that require a full quiesce will
    ensure the reshape thread is not running at all.
    
    So allow reshape requests to get access to new stripe_heads without
    being blocked by a 'quiesce'.
    
    This only affects in-place reshapes (i.e. where the array does not
    grow or shrink) and these are only newly supported.  So this patch is
    not needed in earlier kernels.
    Signed-off-by: NNeilBrown <neilb@suse.de>
    a8c906ca
raid5.c 149.1 KB