Lines Matching refs:rc

213 	int rc = 0;
286 rc = cifs_wait_for_server_reconnect(server, tcon->retry);
287 if (rc)
288 return rc;
310 rc = -EHOSTDOWN;
326 rc = -EHOSTDOWN;
353 rc = cifs_negotiate_protocol(0, ses, server);
354 if (!rc) {
361 rc = cifs_chan_skip_or_disable(ses, server,
363 if (rc) {
369 rc = cifs_setup_session(0, ses, server, nls_codepage);
370 if ((rc == -EACCES) || (rc == -EKEYEXPIRED) || (rc == -EKEYREVOKED)) {
381 if ((rc == -EACCES) && !tcon->retry) {
383 rc = -EHOSTDOWN;
385 } else if (rc) {
403 rc = cifs_tree_connect(0, tcon, nls_codepage);
405 cifs_dbg(FYI, "reconnect tcon rc = %d\n", rc);
406 if (rc) {
409 cifs_dbg(VFS, "reconnect tcon failed rc = %d\n", rc);
422 if (!rc &&
431 rc = server->ops->query_server_interfaces(xid, tcon, false);
434 if (rc == -EOPNOTSUPP && ses->chan_count > 1) {
442 rc = cifs_chan_skip_or_disable(ses, server,
445 } else if (rc)
447 __func__, rc);
491 rc = -EAGAIN;
494 return rc;
560 int rc;
562 rc = smb2_reconnect(smb2_command, tcon, server, false);
563 if (rc)
564 return rc;
857 * on during tree connection will return proper rc, but if
915 int rc = 0;
948 rc = decode_encrypt_ctx(server,
961 if (rc)
967 return rc;
1050 int rc;
1064 rc = smb2_plain_req_init(SMB2_NEGOTIATE, NULL, server,
1066 if (rc)
1067 return rc;
1128 rc = cifs_send_recv(xid, ses, server,
1136 if (rc == -EOPNOTSUPP) {
1139 } else if (rc != 0)
1142 rc = -EIO;
1198 rc = 0;
1245 rc = cifs_enable_signing(server, ses->sign);
1246 if (rc)
1249 rc = decode_negTokenInit(security_blob, blob_length, server);
1250 if (rc == 1)
1251 rc = 0;
1252 else if (rc == 0)
1253 rc = -EIO;
1258 rc = smb311_decode_neg_context(rsp, server,
1265 return rc;
1270 int rc;
1351 rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
1355 if (rc == -EOPNOTSUPP) {
1361 rc = 0;
1363 } else if (rc != 0) {
1365 rc);
1366 rc = -EIO;
1370 rc = -EIO;
1394 rc = 0;
1404 return rc;
1452 int rc;
1459 rc = smb2_plain_req_init(SMB2_SESSION_SETUP, NULL, server,
1462 if (rc)
1463 return rc;
1540 int rc;
1555 rc = cifs_send_recv(sess_data->xid, sess_data->ses,
1561 if (rc == 0)
1563 else if ((rc == -EACCES) || (rc == -EKEYEXPIRED) || (rc == -EKEYREVOKED))
1568 return rc;
1574 int rc = 0;
1580 rc = server->ops->generate_signingkey(ses, server);
1581 if (rc) {
1585 return rc;
1595 return rc;
1602 int rc;
1610 rc = SMB2_sess_alloc_buffer(sess_data);
1611 if (rc)
1616 rc = PTR_ERR(spnego_key);
1617 if (rc == -ENOKEY)
1631 rc = -EKEYREJECTED;
1647 rc = -ENOMEM;
1656 rc = SMB2_sess_sendreceive(sess_data);
1657 if (rc)
1667 rc = SMB2_sess_establish_session(sess_data);
1671 if (rc) {
1677 sess_data->result = rc;
1697 int rc;
1712 rc = -ENOMEM;
1717 rc = SMB2_sess_alloc_buffer(sess_data);
1718 if (rc)
1721 rc = build_ntlmssp_smb3_negotiate_blob(&ntlmssp_blob,
1724 if (rc)
1730 rc = -EOPNOTSUPP;
1736 rc = SMB2_sess_sendreceive(sess_data);
1739 /* If true, rc here is expected and not an error */
1742 rc = 0;
1744 if (rc)
1751 rc = -EIO;
1754 rc = decode_ntlmssp_challenge(rsp->Buffer,
1756 if (rc)
1774 if (!rc) {
1782 sess_data->result = rc;
1789 int rc;
1799 rc = SMB2_sess_alloc_buffer(sess_data);
1800 if (rc)
1806 rc = build_ntlmssp_auth_blob(&ntlmssp_blob, &blob_length,
1809 if (rc) {
1810 cifs_dbg(FYI, "build_ntlmssp_auth_blob failed %d\n", rc);
1817 rc = -EOPNOTSUPP;
1823 rc = SMB2_sess_sendreceive(sess_data);
1824 if (rc)
1839 rc = SMB2_sess_establish_session(sess_data);
1860 sess_data->result = rc;
1898 int rc = 0;
1919 rc = SMB2_select_sec(sess_data);
1920 if (rc)
1934 rc = sess_data->result;
1937 return rc;
1945 int rc = 0;
1968 rc = smb2_plain_req_init(SMB2_LOGOFF, NULL, ses->server,
1970 if (rc)
1971 return rc;
1990 rc = cifs_send_recv(xid, ses, ses->server,
1999 return rc;
2026 int rc = 0;
2053 rc = smb2_plain_req_init(SMB2_TREE_CONNECT, tcon, server,
2055 if (rc) {
2057 return rc;
2097 rc = cifs_send_recv(xid, ses, server,
2101 trace_smb3_tcon(xid, tcon->tid, ses->Suid, tree, rc);
2102 if ((rc != 0) || (rsp == NULL)) {
2122 rc = -EOPNOTSUPP;
2142 rc = server->ops->validate_negotiate(xid, tcon);
2143 if (rc == 0) /* See MS-SMB2 2.2.10 and 3.2.5.5 */
2150 return rc;
2163 int rc = 0;
2188 rc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, server,
2191 if (rc)
2192 return rc;
2206 rc = cifs_send_recv(xid, ses, server,
2209 if (rc) {
2211 trace_smb3_tdis_err(xid, tcon->tid, ses->Suid, rc);
2215 return rc;
2817 int rc = 0;
2841 rc = -EIO;
2846 rc = smb2_plain_req_init(SMB2_CREATE, tcon, server,
2848 if (rc)
2881 rc = alloc_path_with_tree_prefix(&copy_path, &copy_size,
2884 if (rc)
2900 rc = -ENOMEM;
2918 rc = add_posix_context(iov, &n_iov, mode);
2919 if (rc)
2940 rc = cifs_send_recv(xid, ses, server,
2942 if (rc) {
2946 FILE_WRITE_ATTRIBUTES, rc);
2951 * Although unlikely to be possible for rsp to be null and rc not set,
2957 rc = -EIO;
2977 if (is_replayable_error(rc) &&
2981 return rc;
2997 int rc;
2999 rc = smb2_plain_req_init(SMB2_CREATE, tcon, server,
3001 if (rc)
3002 return rc;
3035 rc = alloc_path_with_tree_prefix(&copy_path, &copy_size,
3038 if (rc)
3039 return rc;
3070 rc = add_lease_context(server, req, iov, &n_iov,
3072 if (rc)
3073 return rc;
3077 rc = add_durable_context(iov, &n_iov, oparms,
3079 if (rc)
3080 return rc;
3084 rc = add_posix_context(iov, &n_iov, oparms->mode);
3085 if (rc)
3086 return rc;
3091 rc = add_twarp_context(iov, &n_iov, tcon->snapshot_time);
3092 if (rc)
3093 return rc;
3115 rc = add_sd_context(iov, &n_iov, oparms->mode, set_owner);
3116 if (rc)
3117 return rc;
3181 int rc = 0;
3203 rc = SMB2_open_init(tcon, server,
3205 if (rc)
3214 rc = cifs_send_recv(xid, ses, server,
3219 if (rc != 0) {
3228 oparms->create_options, oparms->desired_access, rc);
3229 if (rc == -EREMCHG) {
3262 rc = smb2_parse_contexts(server, &rsp_iov, &oparms->fid->epoch,
3268 if (is_replayable_error(rc) &&
3272 return rc;
3285 int rc;
3288 rc = smb2_ioctl_req_init(opcode, tcon, server,
3290 if (rc)
3291 return rc;
3394 int rc = 0;
3430 rc = SMB2_ioctl_init(tcon, server,
3433 if (rc)
3439 rc = cifs_send_recv(xid, ses, server,
3444 if (rc != 0)
3446 ses->Suid, 0, opcode, rc);
3448 if ((rc != 0) && (rc != -EINVAL) && (rc != -E2BIG)) {
3451 } else if (rc == -EINVAL) {
3457 } else if (rc == -E2BIG) {
3464 /* check if caller wants to look at return data or just return rc */
3469 * Although unlikely to be possible for rsp to be null and rc not set,
3474 rc = -EIO;
3486 rc = -EIO;
3494 rc = -EIO;
3501 rc = -ENOMEM;
3509 if (is_replayable_error(rc) &&
3513 return rc;
3524 int rc;
3531 rc = SMB2_ioctl(xid, tcon, persistent_fid, volatile_fid,
3537 cifs_dbg(FYI, "set compression rc %d\n", rc);
3539 return rc;
3550 int rc;
3552 rc = smb2_plain_req_init(SMB2_CLOSE, tcon, server,
3554 if (rc)
3555 return rc;
3588 int rc = 0;
3617 rc = SMB2_close_init(tcon, server,
3620 if (rc)
3626 rc = cifs_send_recv(xid, ses, server,
3630 if (rc != 0) {
3633 rc);
3650 if (is_interrupt_error(rc)) {
3660 if (is_replayable_error(rc) &&
3664 return rc;
3715 int rc;
3720 rc = smb2_validate_iov(offset, buffer_length, iov, minbufsize);
3721 if (rc)
3722 return rc;
3740 int rc;
3746 rc = smb2_plain_req_init(SMB2_QUERY_INFO, tcon, server,
3748 if (rc)
3749 return rc;
3788 int rc = 0;
3818 rc = SMB2_query_info_init(tcon, server,
3822 if (rc)
3831 rc = cifs_send_recv(xid, ses, server,
3835 if (rc) {
3838 ses->Suid, info_class, (__u32)info_type, rc);
3852 rc);
3854 rc = -ENOMEM;
3861 rc = smb2_validate_and_copy_iov(le16_to_cpu(rsp->OutputBufferOffset),
3864 if (rc && allocated) {
3874 if (is_replayable_error(rc) &&
3878 return rc;
3947 int rc;
3949 rc = smb2_plain_req_init(SMB2_CHANGE_NOTIFY, tcon, server,
3951 if (rc)
3952 return rc;
3985 int rc = 0;
4008 rc = SMB2_notify_init(xid, &rqst, tcon, server,
4011 if (rc)
4020 rc = cifs_send_recv(xid, ses, server,
4023 if (rc != 0) {
4026 (u8)watch_tree, completion_filter, rc);
4044 rc = -ENOMEM;
4055 if (is_replayable_error(rc) &&
4059 return rc;
4098 int rc;
4172 rc = smb2_reconnect(SMB2_INTERNAL_CMD, tcon, server, true);
4173 if (!rc)
4205 rc = smb2_reconnect(SMB2_INTERNAL_CMD, tcon, server, true);
4206 if (rc)
4227 int rc = 0;
4241 return rc;
4245 rc = smb2_plain_req_init(SMB2_ECHO, NULL, server,
4247 if (rc)
4248 return rc;
4255 rc = cifs_call_async(server, &rqst, NULL, smb2_echo_callback, NULL,
4257 if (rc)
4258 cifs_dbg(FYI, "Echo request failed: %d\n", rc);
4261 return rc;
4279 int rc;
4281 rc = smb2_plain_req_init(SMB2_FLUSH, tcon, server,
4283 if (rc)
4284 return rc;
4306 int rc = 0;
4326 rc = SMB2_flush_init(xid, &rqst, tcon, server,
4328 if (rc)
4336 rc = cifs_send_recv(xid, ses, server,
4339 if (rc != 0) {
4342 rc);
4351 if (is_replayable_error(rc) &&
4355 return rc;
4397 int rc = -EACCES;
4402 rc = smb2_plain_req_init(SMB2_READ, io_parms->tcon, server,
4404 if (rc)
4405 return rc;
4480 return rc;
4513 int rc;
4517 rc = smb2_verify_signature(&rqst, server);
4518 if (rc)
4520 rc);
4575 int rc, flags = 0;
4600 rc = smb2_new_read_req(
4602 if (rc)
4603 return rc;
4624 rc = adjust_credits(server, &rdata->credits, rdata->bytes);
4625 if (rc)
4632 rc = cifs_call_async(server, &rqst,
4636 if (rc) {
4642 io_parms.offset, io_parms.length, rc);
4647 return rc;
4655 int resp_buftype, rc;
4668 rc = smb2_new_read_req((void **)&req, &total_len, io_parms, NULL, 0, 0);
4669 if (rc)
4670 return rc;
4682 rc = cifs_send_recv(xid, ses, io_parms->server,
4686 if (rc) {
4687 if (rc != -ENODATA) {
4689 cifs_dbg(VFS, "Send error in read = %d\n", rc);
4694 rc);
4700 return rc == -ENODATA ? 0 : rc;
4714 rc = -EIO;
4728 return rc;
4822 int rc = -EACCES, flags = 0;
4852 rc = smb2_plain_req_init(SMB2_WRITE, tcon, server,
4854 if (rc)
4855 return rc;
4893 rc = -EAGAIN;
4947 rc = adjust_credits(server, &wdata->credits, io_parms->length);
4948 if (rc)
4955 rc = cifs_call_async(server, &rqst, NULL, smb2_writev_callback, NULL,
4958 if (rc) {
4965 rc);
4972 return rc;
4986 int rc = 0;
5007 return rc;
5009 rc = smb2_plain_req_init(SMB2_WRITE, io_parms->tcon, server,
5011 if (rc)
5012 return rc;
5045 rc = cifs_send_recv(xid, io_parms->tcon->ses, server,
5050 if (rc) {
5055 io_parms->offset, io_parms->length, rc);
5057 cifs_dbg(VFS, "Send error in write = %d\n", rc);
5070 if (is_replayable_error(rc) &&
5074 return rc;
5239 int len, rc;
5241 rc = smb2_plain_req_init(SMB2_QUERY_DIRECTORY, tcon, server,
5243 if (rc)
5244 return rc;
5313 int rc;
5337 rc = smb2_validate_iov(le16_to_cpu(rsp->OutputBufferOffset),
5340 if (rc) {
5342 return rc;
5389 int rc = 0;
5411 rc = SMB2_query_directory_init(xid, tcon, server,
5415 if (rc)
5421 rc = cifs_send_recv(xid, ses, server,
5425 if (rc) {
5426 if (rc == -ENODATA &&
5431 rc = 0;
5434 tcon->ses->Suid, index, 0, rc);
5440 rc = smb2_parse_query_directory(tcon, &rsp_iov, resp_buftype,
5442 if (rc) {
5444 tcon->ses->Suid, index, 0, rc);
5456 if (is_replayable_error(rc) &&
5460 return rc;
5473 int rc;
5475 rc = smb2_plain_req_init(SMB2_SET_INFO, tcon, server,
5477 if (rc)
5478 return rc;
5523 int rc = 0;
5552 rc = SMB2_set_info_init(tcon, server,
5556 if (rc) {
5558 return rc;
5564 rc = cifs_send_recv(xid, ses, server,
5570 if (rc != 0) {
5573 ses->Suid, info_class, (__u32)info_type, rc);
5579 if (is_replayable_error(rc) &&
5583 return rc;
5632 int rc;
5649 rc = smb2_plain_req_init(SMB2_OPLOCK_BREAK, tcon, server,
5651 if (rc)
5652 return rc;
5674 rc = cifs_send_recv(xid, ses, server,
5677 if (rc) {
5679 cifs_dbg(FYI, "Send error in Oplock Break = %d\n", rc);
5682 if (is_replayable_error(rc) &&
5686 return rc;
5726 int rc;
5735 rc = smb2_plain_req_init(SMB2_QUERY_INFO, tcon, server,
5737 if (rc)
5738 return rc;
5768 int rc = 0;
5781 rc = build_qfs_info_req(&iov, tcon, server,
5785 if (rc)
5786 return rc;
5798 rc = cifs_send_recv(xid, ses, server,
5801 if (rc) {
5809 rc = smb2_validate_iov(le16_to_cpu(rsp->OutputBufferOffset),
5812 if (!rc)
5818 if (is_replayable_error(rc) &&
5822 return rc;
5833 int rc = 0;
5846 rc = build_qfs_info_req(&iov, tcon, server,
5850 if (rc)
5851 return rc;
5863 rc = cifs_send_recv(xid, ses, server,
5866 if (rc) {
5874 rc = smb2_validate_iov(le16_to_cpu(rsp->OutputBufferOffset),
5877 if (!rc)
5883 if (is_replayable_error(rc) &&
5887 return rc;
5898 int rc = 0;
5928 rc = build_qfs_info_req(&iov, tcon, server,
5931 if (rc)
5932 return rc;
5944 rc = cifs_send_recv(xid, ses, server,
5947 if (rc) {
5955 rc = smb2_validate_iov(offset, rsp_len, &rsp_iov, min_len);
5956 if (rc)
5982 if (is_replayable_error(rc) &&
5986 return rc;
5995 int rc = 0;
6013 rc = smb2_plain_req_init(SMB2_LOCK, tcon, server,
6015 if (rc)
6016 return rc;
6043 rc = cifs_send_recv(xid, tcon->ses, server,
6047 if (rc) {
6048 cifs_dbg(FYI, "Send error in smb2_lockv = %d\n", rc);
6051 tcon->ses->Suid, rc);
6054 if (is_replayable_error(rc) &&
6058 return rc;
6083 int rc;
6096 rc = smb2_plain_req_init(SMB2_OPLOCK_BREAK, tcon, server,
6098 if (rc)
6099 return rc;
6120 rc = cifs_send_recv(xid, ses, server,
6126 if (rc) {
6129 ses->Suid, *please_key_low, *please_key_high, rc);
6130 cifs_dbg(FYI, "Send error in Lease Break = %d\n", rc);
6135 return rc;