• L
    drbd: fix race on meta-data update, addendum · ee15b038
    Lars Ellenberg 提交于
    addendum to baa33ae4eaa4477b60af7c434c0ddd1d182c1ae7
    
    The race:
        drbd_md_sync()
    	if (!test_and_clear_bit(MD_DIRTY, &mdev->flags))
    		return;
        ==> RACE with drbd_md_mark_dirty() rearming the timer.
    	del_timer(&mdev->md_sync_timer);
    
        Fixed by moving the del_timer before the test_and_clear_bit.
    
    Additionally only rearm the timer in drbd_md_mark_dirty, if MD_DIRTY was
    not already set, reduce the grace period from five to one second, and
    add an ifdef'ed debuging aid to find code paths missing an explicit
    drbd_md_sync, if any, as those are the only relevant ones for this race.
    Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
    Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
    ee15b038
drbd_main.c 103.6 KB