diff options
author | Jeff Layton <jlayton@redhat.com> | 2011-01-28 07:08:28 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-01-30 23:24:38 -0500 |
commit | 2db7c5815555d8daabf7d4ab1253ce690852c140 (patch) | |
tree | f93abfb6d900da8ebd851703784d45d2cd54600b /fs/cifs/transport.c | |
parent | 1be912dde772b77aaaa21770eeabb0a7a5e297a6 (diff) |
cifs: send an NT_CANCEL request when a process is signalled
Use the new send_nt_cancel function to send an NT_CANCEL when the
process is delivered a fatal signal. This is a "best effort" enterprise
however, so don't bother to check the return code. There's nothing we
can reasonably do if it fails anyway.
Reviewed-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 9b2d0373a8a7..bdaa4aa58b03 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -570,20 +570,25 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, | |||
570 | #endif | 570 | #endif |
571 | 571 | ||
572 | mutex_unlock(&ses->server->srv_mutex); | 572 | mutex_unlock(&ses->server->srv_mutex); |
573 | cifs_small_buf_release(in_buf); | ||
574 | 573 | ||
575 | if (rc < 0) | 574 | if (rc < 0) { |
575 | cifs_small_buf_release(in_buf); | ||
576 | goto out; | 576 | goto out; |
577 | } | ||
577 | 578 | ||
578 | if (long_op == CIFS_ASYNC_OP) | 579 | if (long_op == CIFS_ASYNC_OP) { |
580 | cifs_small_buf_release(in_buf); | ||
579 | goto out; | 581 | goto out; |
582 | } | ||
580 | 583 | ||
581 | rc = wait_for_response(ses->server, midQ); | 584 | rc = wait_for_response(ses->server, midQ); |
582 | if (rc != 0) { | 585 | if (rc != 0) { |
586 | send_nt_cancel(ses->server, in_buf, midQ); | ||
583 | spin_lock(&GlobalMid_Lock); | 587 | spin_lock(&GlobalMid_Lock); |
584 | if (midQ->midState == MID_REQUEST_SUBMITTED) { | 588 | if (midQ->midState == MID_REQUEST_SUBMITTED) { |
585 | midQ->callback = DeleteMidQEntry; | 589 | midQ->callback = DeleteMidQEntry; |
586 | spin_unlock(&GlobalMid_Lock); | 590 | spin_unlock(&GlobalMid_Lock); |
591 | cifs_small_buf_release(in_buf); | ||
587 | atomic_dec(&ses->server->inFlight); | 592 | atomic_dec(&ses->server->inFlight); |
588 | wake_up(&ses->server->request_q); | 593 | wake_up(&ses->server->request_q); |
589 | return rc; | 594 | return rc; |
@@ -591,6 +596,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, | |||
591 | spin_unlock(&GlobalMid_Lock); | 596 | spin_unlock(&GlobalMid_Lock); |
592 | } | 597 | } |
593 | 598 | ||
599 | cifs_small_buf_release(in_buf); | ||
600 | |||
594 | rc = sync_mid_result(midQ, ses->server); | 601 | rc = sync_mid_result(midQ, ses->server); |
595 | if (rc != 0) { | 602 | if (rc != 0) { |
596 | atomic_dec(&ses->server->inFlight); | 603 | atomic_dec(&ses->server->inFlight); |
@@ -734,6 +741,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, | |||
734 | 741 | ||
735 | rc = wait_for_response(ses->server, midQ); | 742 | rc = wait_for_response(ses->server, midQ); |
736 | if (rc != 0) { | 743 | if (rc != 0) { |
744 | send_nt_cancel(ses->server, in_buf, midQ); | ||
737 | spin_lock(&GlobalMid_Lock); | 745 | spin_lock(&GlobalMid_Lock); |
738 | if (midQ->midState == MID_REQUEST_SUBMITTED) { | 746 | if (midQ->midState == MID_REQUEST_SUBMITTED) { |
739 | /* no longer considered to be "in-flight" */ | 747 | /* no longer considered to be "in-flight" */ |
@@ -943,6 +951,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon, | |||
943 | 951 | ||
944 | rc = wait_for_response(ses->server, midQ); | 952 | rc = wait_for_response(ses->server, midQ); |
945 | if (rc) { | 953 | if (rc) { |
954 | send_nt_cancel(ses->server, in_buf, midQ); | ||
946 | spin_lock(&GlobalMid_Lock); | 955 | spin_lock(&GlobalMid_Lock); |
947 | if (midQ->midState == MID_REQUEST_SUBMITTED) { | 956 | if (midQ->midState == MID_REQUEST_SUBMITTED) { |
948 | /* no longer considered to be "in-flight" */ | 957 | /* no longer considered to be "in-flight" */ |