Commit 5bc59498 authored by Pavel Shilovsky's avatar Pavel Shilovsky Committed by Steve French

CIFS: Make wait_for_free_request killable

to let us kill the proccess if it hangs waiting for a credit when
the session is down and echo is disabled.
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarPavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 2d86dbc9
......@@ -257,6 +257,8 @@ smb_send(struct TCP_Server_Info *server, struct smb_hdr *smb_buffer,
static int
wait_for_free_request(struct TCP_Server_Info *server, const int long_op)
{
int rc;
spin_lock(&server->req_lock);
if (long_op == CIFS_ASYNC_OP) {
......@@ -271,8 +273,11 @@ wait_for_free_request(struct TCP_Server_Info *server, const int long_op)
if (server->credits <= 0) {
spin_unlock(&server->req_lock);
cifs_num_waiters_inc(server);
wait_event(server->request_q, has_credits(server));
rc = wait_event_killable(server->request_q,
has_credits(server));
cifs_num_waiters_dec(server);
if (rc)
return rc;
spin_lock(&server->req_lock);
} else {
if (server->tcpStatus == CifsExiting) {
......
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