diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2011-01-20 04:47:53 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:47:55 -0500 |
commit | 54b956abef2c1ab339fd01792e69e4a921a5e487 (patch) | |
tree | e489b7742b99e8cfda55d75dc4675d3f00c40af0 /drivers/block | |
parent | 194bfb32dba8345a7e0f83e9b1ee965e14d4b679 (diff) |
drbd: don't pointlessly queue bitmap send, if we lost connection
This is a minor optimization and cleanup,
and also considerably reduces some harmless (but noisy) race with
the connection cleanup code.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 34ee8e44a751..1caced08a73e 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -1428,8 +1428,13 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, | |||
1428 | drbd_send_uuids(mdev); | 1428 | drbd_send_uuids(mdev); |
1429 | drbd_send_state(mdev); | 1429 | drbd_send_state(mdev); |
1430 | } | 1430 | } |
1431 | if (os.conn != C_WF_BITMAP_S && ns.conn == C_WF_BITMAP_S) | 1431 | /* No point in queuing send_bitmap if we don't have a connection |
1432 | drbd_queue_bitmap_io(mdev, &drbd_send_bitmap, NULL, "send_bitmap (WFBitMapS)"); | 1432 | * anymore, so check also the _current_ state, not only the new state |
1433 | * at the time this work was queued. */ | ||
1434 | if (os.conn != C_WF_BITMAP_S && ns.conn == C_WF_BITMAP_S && | ||
1435 | mdev->state.conn == C_WF_BITMAP_S) | ||
1436 | drbd_queue_bitmap_io(mdev, &drbd_send_bitmap, NULL, | ||
1437 | "send_bitmap (WFBitMapS)"); | ||
1433 | 1438 | ||
1434 | /* Lost contact to peer's copy of the data */ | 1439 | /* Lost contact to peer's copy of the data */ |
1435 | if ((os.pdsk >= D_INCONSISTENT && | 1440 | if ((os.pdsk >= D_INCONSISTENT && |