diff options
Diffstat (limited to 'drivers/block/drbd/drbd_worker.c')
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index eee017dd6d7d..e8448712b958 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -1536,21 +1536,21 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) | |||
1536 | } | 1536 | } |
1537 | 1537 | ||
1538 | if (current == mdev->tconn->worker.task) { | 1538 | if (current == mdev->tconn->worker.task) { |
1539 | /* The worker should not sleep waiting for drbd_state_lock(), | 1539 | /* The worker should not sleep waiting for state_mutex, |
1540 | that can take long */ | 1540 | that can take long */ |
1541 | if (test_and_set_bit(CLUSTER_ST_CHANGE, &mdev->flags)) { | 1541 | if (!mutex_trylock(&mdev->state_mutex)) { |
1542 | set_bit(B_RS_H_DONE, &mdev->flags); | 1542 | set_bit(B_RS_H_DONE, &mdev->flags); |
1543 | mdev->start_resync_timer.expires = jiffies + HZ/5; | 1543 | mdev->start_resync_timer.expires = jiffies + HZ/5; |
1544 | add_timer(&mdev->start_resync_timer); | 1544 | add_timer(&mdev->start_resync_timer); |
1545 | return; | 1545 | return; |
1546 | } | 1546 | } |
1547 | } else { | 1547 | } else { |
1548 | drbd_state_lock(mdev); | 1548 | mutex_lock(&mdev->state_mutex); |
1549 | } | 1549 | } |
1550 | clear_bit(B_RS_H_DONE, &mdev->flags); | 1550 | clear_bit(B_RS_H_DONE, &mdev->flags); |
1551 | 1551 | ||
1552 | if (!get_ldev_if_state(mdev, D_NEGOTIATING)) { | 1552 | if (!get_ldev_if_state(mdev, D_NEGOTIATING)) { |
1553 | drbd_state_unlock(mdev); | 1553 | mutex_unlock(&mdev->state_mutex); |
1554 | return; | 1554 | return; |
1555 | } | 1555 | } |
1556 | 1556 | ||
@@ -1639,7 +1639,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) | |||
1639 | drbd_md_sync(mdev); | 1639 | drbd_md_sync(mdev); |
1640 | } | 1640 | } |
1641 | put_ldev(mdev); | 1641 | put_ldev(mdev); |
1642 | drbd_state_unlock(mdev); | 1642 | mutex_unlock(&mdev->state_mutex); |
1643 | } | 1643 | } |
1644 | 1644 | ||
1645 | static int _worker_dying(int vnr, void *p, void *data) | 1645 | static int _worker_dying(int vnr, void *p, void *data) |