From: Lars Ellenberg Date: Fri, 3 Sep 2010 08:00:09 +0000 (+0200) Subject: drbd: fix race on meta-data update, addendum X-Git-Tag: v2.6.37-rc1~167^2~32 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee15b038164fcf19b798021762dee3cf5cbc6433;p=pandora-kernel.git drbd: fix race on meta-data update, addendum 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: Philipp Reisner Signed-off-by: Lars Ellenberg --- Reading git-diff-tree failed