From: green@linuxhacker.ru
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org,
Andreas Dilger <andreas.dilger@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Oleg Drokin <green@linuxhacker.ru>
Subject: [PATCH 4/4] staging/lustre: Don't call blocking funcitons when !RUNNABLE
Date: Sat, 7 Mar 2015 19:24:29 -0500 [thread overview]
Message-ID: <1425774269-25618-5-git-send-email-green@linuxhacker.ru> (raw)
In-Reply-To: <1425774269-25618-1-git-send-email-green@linuxhacker.ru>
From: Oleg Drokin <green@linuxhacker.ru>
Move setting of TASK_INTERRUPTIBLE just around schedule call in
libcfs_sock_accept.
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
index cd2fc01..f2462e7 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
@@ -543,19 +543,17 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
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);
if (rc == -EAGAIN) {
/* Nothing ready, so wait for activity */
+ set_current_state(TASK_INTERRUPTIBLE);
+ add_wait_queue(sk_sleep(sock->sk), &wait);
schedule();
+ remove_wait_queue(sk_sleep(sock->sk), &wait);
+ set_current_state(TASK_RUNNING);
rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
}
- remove_wait_queue(sk_sleep(sock->sk), &wait);
- set_current_state(TASK_RUNNING);
-
if (rc != 0)
goto failed;
--
2.1.0
prev parent reply other threads:[~2015-03-08 0:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-08 0:24 [PATCH 0/4] Lustre fixes green
2015-03-08 0:24 ` [PATCH 1/4] staging/lustre/libcfs: replace deprecated cpus_ calls with cpumask_ green
2015-03-08 0:24 ` [PATCH 2/4] staging/lustre/o2iblnd: Don't use cpus_weight green
2015-03-08 0:24 ` [PATCH 3/4] staging/lustre/llite: avoid nonatomic memory alloc under spinlock green
2015-03-08 0:24 ` green [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1425774269-25618-5-git-send-email-green@linuxhacker.ru \
--to=green@linuxhacker.ru \
--cc=andreas.dilger@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®