Commit d1fb6279 authored by Allan Stephens's avatar Allan Stephens Committed by David S. Miller

tipc: Fix misleading error code when enabling Ethernet bearers

Cause TIPC to return EAGAIN if it is unable to enable a new Ethernet
bearer because one or more recently disabled Ethernet bearers are
temporarily consuming resources during shut down.  (The previous error
code, EDQUOT, is now returned only if all available Ethernet bearer
data structures are fully enabled at the time the request to enable an
additional bearer is received.)
Signed-off-by: default avatarAllan Stephens <allan.stephens@windriver.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9fbfca01
...@@ -142,6 +142,16 @@ static int enable_bearer(struct tipc_bearer *tb_ptr) ...@@ -142,6 +142,16 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
struct eth_bearer *eb_ptr = &eth_bearers[0]; struct eth_bearer *eb_ptr = &eth_bearers[0];
struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS]; struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS];
char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1; char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1;
int pending_dev = 0;
/* Find unused Ethernet bearer structure */
while (eb_ptr->dev) {
if (!eb_ptr->bearer)
pending_dev++;
if (++eb_ptr == stop)
return pending_dev ? -EAGAIN : -EDQUOT;
}
/* Find device with specified name */ /* Find device with specified name */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment