Commit 834fe2e1 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging/lustre: Don't call blocking funcitons when !RUNNABLE

Move setting of TASK_INTERRUPTIBLE just around schedule call in
libcfs_sock_accept.
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aac2e54f
...@@ -543,18 +543,16 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock) ...@@ -543,18 +543,16 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
newsock->ops = sock->ops; newsock->ops = sock->ops;
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(sk_sleep(sock->sk), &wait);
rc = sock->ops->accept(sock, newsock, O_NONBLOCK); rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
if (rc == -EAGAIN) { if (rc == -EAGAIN) {
/* Nothing ready, so wait for activity */ /* Nothing ready, so wait for activity */
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(sk_sleep(sock->sk), &wait);
schedule(); schedule();
rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
}
remove_wait_queue(sk_sleep(sock->sk), &wait); remove_wait_queue(sk_sleep(sock->sk), &wait);
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
}
if (rc != 0) if (rc != 0)
goto failed; goto failed;
......
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