Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210580
b: refs/heads/master
c: 8df73ff
h: refs/heads/master
v: v3
  • Loading branch information
Tetsuo Handa authored and David S. Miller committed Sep 7, 2010
1 parent e4c6bd0 commit f33d6ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 32737e934a952c1b0c744f2a78d80089d15c7ee3
refs/heads/master: 8df73ff90f00f14d2c7ff7156f7ef153f7e9d3b7
15 changes: 12 additions & 3 deletions trunk/net/unix/af_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ static int unix_autobind(struct socket *sock)
static u32 ordernum = 1;
struct unix_address *addr;
int err;
unsigned int retries = 0;

mutex_lock(&u->readlock);

Expand All @@ -717,9 +718,17 @@ static int unix_autobind(struct socket *sock)
if (__unix_find_socket_byname(net, addr->name, addr->len, sock->type,
addr->hash)) {
spin_unlock(&unix_table_lock);
/* Sanity yield. It is unusual case, but yet... */
if (!(ordernum&0xFF))
yield();
/*
* __unix_find_socket_byname() may take long time if many names
* are already in use.
*/
cond_resched();
/* Give up if all names seems to be in use. */
if (retries++ == 0xFFFFF) {
err = -ENOSPC;
kfree(addr);
goto out;
}
goto retry;
}
addr->hash ^= sk->sk_type;
Expand Down

0 comments on commit f33d6ab

Please sign in to comment.