From f380bc435d240d01ff360c9be66c37a86f54b7d0 Mon Sep 17 00:00:00 2001 From: Simon P. Graham Date: Wed, 30 Jan 2008 23:36:43 -0500 Subject: [PATCH] Make sure we dont send state if a cluster wide state change is in progress --- drbd/drbd_main.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c index d589bff..5541b05 100644 --- a/drbd/drbd_main.c +++ b/drbd/drbd_main.c @@ -1440,10 +1440,15 @@ int drbd_send_state(drbd_dev *mdev) { int ok; + /* Grab state lock so we wont send state if we're in the middle + * of a cluster wide state change on another thread */ + drbd_state_lock(mdev); + down(&mdev->data.mutex); ok = _drbd_send_state(mdev); up(&mdev->data.mutex); + drbd_state_unlock(mdev); return ok; } -- 1.5.4.rc1