diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2013-06-25 10:50:06 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-06-28 10:04:36 -0400 |
commit | 28e448bb30d0f3fc7daa652d2d3a30adaf9e171b (patch) | |
tree | a55a604af453136e8021e62f4ab9656e7a3da4ec /drivers/block/drbd/drbd_nl.c | |
parent | f9eb7bf424e766e00bbc6d69fd7eaaf4bd003cf9 (diff) |
drbd: Ignore the exit code of a fence-peer handler if it returns too late
In case the connection was established and lost again before
the a fence-peer handler returns, ignore the exit code of this
instance. (And use the exit code of the later started instance)
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/drbd/drbd_nl.c')
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 0936d6aabef9..e25803b447ff 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -417,6 +417,7 @@ static enum drbd_fencing_p highest_fencing_policy(struct drbd_tconn *tconn) | |||
417 | 417 | ||
418 | bool conn_try_outdate_peer(struct drbd_tconn *tconn) | 418 | bool conn_try_outdate_peer(struct drbd_tconn *tconn) |
419 | { | 419 | { |
420 | unsigned int connect_cnt; | ||
420 | union drbd_state mask = { }; | 421 | union drbd_state mask = { }; |
421 | union drbd_state val = { }; | 422 | union drbd_state val = { }; |
422 | enum drbd_fencing_p fp; | 423 | enum drbd_fencing_p fp; |
@@ -428,6 +429,10 @@ bool conn_try_outdate_peer(struct drbd_tconn *tconn) | |||
428 | return false; | 429 | return false; |
429 | } | 430 | } |
430 | 431 | ||
432 | spin_lock_irq(&tconn->req_lock); | ||
433 | connect_cnt = tconn->connect_cnt; | ||
434 | spin_unlock_irq(&tconn->req_lock); | ||
435 | |||
431 | fp = highest_fencing_policy(tconn); | 436 | fp = highest_fencing_policy(tconn); |
432 | switch (fp) { | 437 | switch (fp) { |
433 | case FP_NOT_AVAIL: | 438 | case FP_NOT_AVAIL: |
@@ -492,8 +497,14 @@ bool conn_try_outdate_peer(struct drbd_tconn *tconn) | |||
492 | here, because we might were able to re-establish the connection in the | 497 | here, because we might were able to re-establish the connection in the |
493 | meantime. */ | 498 | meantime. */ |
494 | spin_lock_irq(&tconn->req_lock); | 499 | spin_lock_irq(&tconn->req_lock); |
495 | if (tconn->cstate < C_WF_REPORT_PARAMS && !test_bit(STATE_SENT, &tconn->flags)) | 500 | if (tconn->cstate < C_WF_REPORT_PARAMS && !test_bit(STATE_SENT, &tconn->flags)) { |
496 | _conn_request_state(tconn, mask, val, CS_VERBOSE); | 501 | if (tconn->connect_cnt != connect_cnt) |
502 | /* In case the connection was established and droped | ||
503 | while the fence-peer handler was running, ignore it */ | ||
504 | conn_info(tconn, "Ignoring fence-peer exit code\n"); | ||
505 | else | ||
506 | _conn_request_state(tconn, mask, val, CS_VERBOSE); | ||
507 | } | ||
497 | spin_unlock_irq(&tconn->req_lock); | 508 | spin_unlock_irq(&tconn->req_lock); |
498 | 509 | ||
499 | return conn_highest_pdsk(tconn) <= D_OUTDATED; | 510 | return conn_highest_pdsk(tconn) <= D_OUTDATED; |