| .. | .. |
|---|
| 312 | 312 | __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, |
|---|
| 313 | 313 | struct smb_rqst *rqst) |
|---|
| 314 | 314 | { |
|---|
| 315 | | - int rc = 0; |
|---|
| 315 | + int rc; |
|---|
| 316 | 316 | struct kvec *iov; |
|---|
| 317 | 317 | int n_vec; |
|---|
| 318 | 318 | unsigned int send_length = 0; |
|---|
| .. | .. |
|---|
| 323 | 323 | struct msghdr smb_msg = {}; |
|---|
| 324 | 324 | __be32 rfc1002_marker; |
|---|
| 325 | 325 | |
|---|
| 326 | + cifs_in_send_inc(server); |
|---|
| 326 | 327 | if (cifs_rdma_enabled(server)) { |
|---|
| 327 | 328 | /* return -EAGAIN when connecting or reconnecting */ |
|---|
| 328 | 329 | rc = -EAGAIN; |
|---|
| .. | .. |
|---|
| 331 | 332 | goto smbd_done; |
|---|
| 332 | 333 | } |
|---|
| 333 | 334 | |
|---|
| 335 | + rc = -EAGAIN; |
|---|
| 334 | 336 | if (ssocket == NULL) |
|---|
| 335 | | - return -EAGAIN; |
|---|
| 337 | + goto out; |
|---|
| 336 | 338 | |
|---|
| 339 | + rc = -ERESTARTSYS; |
|---|
| 337 | 340 | if (fatal_signal_pending(current)) { |
|---|
| 338 | 341 | cifs_dbg(FYI, "signal pending before send request\n"); |
|---|
| 339 | | - return -ERESTARTSYS; |
|---|
| 342 | + goto out; |
|---|
| 340 | 343 | } |
|---|
| 341 | 344 | |
|---|
| 345 | + rc = 0; |
|---|
| 342 | 346 | /* cork the socket */ |
|---|
| 343 | 347 | tcp_sock_set_cork(ssocket->sk, true); |
|---|
| 344 | 348 | |
|---|
| .. | .. |
|---|
| 449 | 453 | rc); |
|---|
| 450 | 454 | else if (rc > 0) |
|---|
| 451 | 455 | rc = 0; |
|---|
| 452 | | - |
|---|
| 456 | +out: |
|---|
| 457 | + cifs_in_send_dec(server); |
|---|
| 453 | 458 | return rc; |
|---|
| 454 | 459 | } |
|---|
| 455 | 460 | |
|---|
| .. | .. |
|---|
| 826 | 831 | * I/O response may come back and free the mid entry on another thread. |
|---|
| 827 | 832 | */ |
|---|
| 828 | 833 | cifs_save_when_sent(mid); |
|---|
| 829 | | - cifs_in_send_inc(server); |
|---|
| 830 | 834 | rc = smb_send_rqst(server, 1, rqst, flags); |
|---|
| 831 | | - cifs_in_send_dec(server); |
|---|
| 832 | 835 | |
|---|
| 833 | 836 | if (rc < 0) { |
|---|
| 834 | 837 | revert_current_mid(server, mid->credits); |
|---|
| .. | .. |
|---|
| 1117 | 1120 | else |
|---|
| 1118 | 1121 | midQ[i]->callback = cifs_compound_last_callback; |
|---|
| 1119 | 1122 | } |
|---|
| 1120 | | - cifs_in_send_inc(server); |
|---|
| 1121 | 1123 | rc = smb_send_rqst(server, num_rqst, rqst, flags); |
|---|
| 1122 | | - cifs_in_send_dec(server); |
|---|
| 1123 | 1124 | |
|---|
| 1124 | 1125 | for (i = 0; i < num_rqst; i++) |
|---|
| 1125 | 1126 | cifs_save_when_sent(midQ[i]); |
|---|
| .. | .. |
|---|
| 1356 | 1357 | |
|---|
| 1357 | 1358 | midQ->mid_state = MID_REQUEST_SUBMITTED; |
|---|
| 1358 | 1359 | |
|---|
| 1359 | | - cifs_in_send_inc(server); |
|---|
| 1360 | 1360 | rc = smb_send(server, in_buf, len); |
|---|
| 1361 | | - cifs_in_send_dec(server); |
|---|
| 1362 | 1361 | cifs_save_when_sent(midQ); |
|---|
| 1363 | 1362 | |
|---|
| 1364 | 1363 | if (rc < 0) |
|---|
| .. | .. |
|---|
| 1495 | 1494 | } |
|---|
| 1496 | 1495 | |
|---|
| 1497 | 1496 | midQ->mid_state = MID_REQUEST_SUBMITTED; |
|---|
| 1498 | | - cifs_in_send_inc(server); |
|---|
| 1499 | 1497 | rc = smb_send(server, in_buf, len); |
|---|
| 1500 | | - cifs_in_send_dec(server); |
|---|
| 1501 | 1498 | cifs_save_when_sent(midQ); |
|---|
| 1502 | 1499 | |
|---|
| 1503 | 1500 | if (rc < 0) |
|---|