Skip to content

Commit

Permalink
firewire: core: retry on local errors in bus manager election
Browse files Browse the repository at this point in the history
When the candidate bus manager fails to do the lock request with which
it tries to become bus manager, it assumes that the current IRM is not
actually IRM capable and forces itself to become root.  However, if that
lock request failed because the local node itself was not able to send
it, then we cannot blame the current IRM and should not steal its
rootness.

In this case, RCODE_SEND_ERROR is likely to indicate a temporary error
condition such as exhausted tlabels or low memory, so we better try
again later.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
  • Loading branch information
Clemens Ladisch committed Jun 10, 2010
1 parent 153e397 commit bda3b8a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/firewire/core-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,16 @@ static void fw_card_bm_work(struct work_struct *work)
goto out;
}

if (rcode == RCODE_SEND_ERROR) {
/*
* We have been unable to send the lock request due to
* some local problem. Let's try again later and hope
* that the problem has gone away by then.
*/
fw_schedule_bm_work(card, DIV_ROUND_UP(HZ, 8));
goto out;
}

spin_lock_irqsave(&card->lock, flags);

if (rcode != RCODE_COMPLETE) {
Expand Down

0 comments on commit bda3b8a

Please sign in to comment.