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>
This commit is contained in:
parent
1be912dde7
commit
2db7c58155
|
@ -570,20 +570,25 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mutex_unlock(&ses->server->srv_mutex);
|
mutex_unlock(&ses->server->srv_mutex);
|
||||||
|
|
||||||
|
if (rc < 0) {
|
||||||
cifs_small_buf_release(in_buf);
|
cifs_small_buf_release(in_buf);
|
||||||
|
|
||||||
if (rc < 0)
|
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (long_op == CIFS_ASYNC_OP)
|
if (long_op == CIFS_ASYNC_OP) {
|
||||||
|
cifs_small_buf_release(in_buf);
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
rc = wait_for_response(ses->server, midQ);
|
rc = wait_for_response(ses->server, midQ);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
|
send_nt_cancel(ses->server, in_buf, midQ);
|
||||||
spin_lock(&GlobalMid_Lock);
|
spin_lock(&GlobalMid_Lock);
|
||||||
if (midQ->midState == MID_REQUEST_SUBMITTED) {
|
if (midQ->midState == MID_REQUEST_SUBMITTED) {
|
||||||
midQ->callback = DeleteMidQEntry;
|
midQ->callback = DeleteMidQEntry;
|
||||||
spin_unlock(&GlobalMid_Lock);
|
spin_unlock(&GlobalMid_Lock);
|
||||||
|
cifs_small_buf_release(in_buf);
|
||||||
atomic_dec(&ses->server->inFlight);
|
atomic_dec(&ses->server->inFlight);
|
||||||
wake_up(&ses->server->request_q);
|
wake_up(&ses->server->request_q);
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -591,6 +596,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
|
||||||
spin_unlock(&GlobalMid_Lock);
|
spin_unlock(&GlobalMid_Lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cifs_small_buf_release(in_buf);
|
||||||
|
|
||||||
rc = sync_mid_result(midQ, ses->server);
|
rc = sync_mid_result(midQ, ses->server);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
atomic_dec(&ses->server->inFlight);
|
atomic_dec(&ses->server->inFlight);
|
||||||
|
@ -734,6 +741,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
|
||||||
|
|
||||||
rc = wait_for_response(ses->server, midQ);
|
rc = wait_for_response(ses->server, midQ);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
|
send_nt_cancel(ses->server, in_buf, midQ);
|
||||||
spin_lock(&GlobalMid_Lock);
|
spin_lock(&GlobalMid_Lock);
|
||||||
if (midQ->midState == MID_REQUEST_SUBMITTED) {
|
if (midQ->midState == MID_REQUEST_SUBMITTED) {
|
||||||
/* no longer considered to be "in-flight" */
|
/* no longer considered to be "in-flight" */
|
||||||
|
@ -943,6 +951,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
|
||||||
|
|
||||||
rc = wait_for_response(ses->server, midQ);
|
rc = wait_for_response(ses->server, midQ);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
|
send_nt_cancel(ses->server, in_buf, midQ);
|
||||||
spin_lock(&GlobalMid_Lock);
|
spin_lock(&GlobalMid_Lock);
|
||||||
if (midQ->midState == MID_REQUEST_SUBMITTED) {
|
if (midQ->midState == MID_REQUEST_SUBMITTED) {
|
||||||
/* no longer considered to be "in-flight" */
|
/* no longer considered to be "in-flight" */
|
||||||
|
|
Loading…
Reference in New Issue