On Tue, Apr 26, 2016 at 09:56:26PM -0400, Guoqing Jiang wrote: > Some code waits for a metadata update by: > > 1. flagging that it is needed (MD_CHANGE_DEVS or MD_CHANGE_CLEAN) > 2. setting MD_CHANGE_PENDING and waking the management thread > 3. waiting for MD_CHANGE_PENDING to be cleared > > If the first two are done without locking, the code in md_update_sb() > which checks if it needs to repeat might test if an update is needed > before step 1, then clear MD_CHANGE_PENDING after step 2, resulting > in the wait returning early. > > So make sure all places that set MD_CHANGE_PENDING are protected by > mddev->lock. > > Reviewed-by: NeilBrown <neilb@xxxxxxxx> > Signed-off-by: Guoqing Jiang <gqjiang@xxxxxxxx> > --- > V3 changes: > 1. use spin_lock_irqsave/spin_unlock_irqrestore in error funcs and > raid10's __make_request shouldn't other places use spin_lock_irq/spin_unlock_irq? interrupt can occur after you do spin_lock(), and if it's md_error, we deadlock. please resend the whole series. Thanks, Shaohua -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html