diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-02-21 19:56:08 +0300 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2012-03-21 11:35:32 -0500 |
commit | 5bc594982f49220d33e927e3c9e028bf87b4745c (patch) | |
tree | 6e72c2937250744309d5f3d514c5a5b48a5f6663 /fs/cifs | |
parent | 2d86dbc97094ea4cfc2204fdefd7d07685496189 (diff) | |
download | linux-5bc594982f49220d33e927e3c9e028bf87b4745c.tar.bz2 |
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: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/transport.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index e5202ddef2fb..58b31da17fc5 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -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) { |