aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2010-09-03 04:33:42 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-06 21:12:57 -0400
commitd1fb62796cdac6899ebd4319e4a610684db063e9 (patch)
tree10cedaa8eb09b412bf229190d5c7089b8f2dd42b /net/tipc
parent9fbfca013176f9b90d186f3b446fd93e4d972b25 (diff)
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: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/eth_media.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 81253d0b24b9..673fdf0b3222 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -142,6 +142,16 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
142 struct eth_bearer *eb_ptr = &eth_bearers[0]; 142 struct eth_bearer *eb_ptr = &eth_bearers[0];
143 struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS]; 143 struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS];
144 char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1; 144 char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1;
145 int pending_dev = 0;
146
147 /* Find unused Ethernet bearer structure */
148
149 while (eb_ptr->dev) {
150 if (!eb_ptr->bearer)
151 pending_dev++;
152 if (++eb_ptr == stop)
153 return pending_dev ? -EAGAIN : -EDQUOT;
154 }
145 155
146 /* Find device with specified name */ 156 /* Find device with specified name */
147 157