Commit a9129faf authored by Pavel Shilovsky's avatar Pavel Shilovsky

Update 3.0 sources from stable (v3.0.101)

parent 6454195c
...@@ -3520,13 +3520,12 @@ CIFSSMBSetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid, ...@@ -3520,13 +3520,12 @@ CIFSSMBSetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid,
int rc = 0; int rc = 0;
int bytes_returned = 0; int bytes_returned = 0;
SET_SEC_DESC_REQ *pSMB = NULL; SET_SEC_DESC_REQ *pSMB = NULL;
NTRANSACT_RSP *pSMBr = NULL; void *pSMBr;
setCifsAclRetry: setCifsAclRetry:
rc = smb_init(SMB_COM_NT_TRANSACT, 19, tcon, (void **) &pSMB, rc = smb_init(SMB_COM_NT_TRANSACT, 19, tcon, (void **) &pSMB, &pSMBr);
(void **) &pSMBr);
if (rc) if (rc)
return (rc); return rc;
pSMB->MaxSetupCount = 0; pSMB->MaxSetupCount = 0;
pSMB->Reserved = 0; pSMB->Reserved = 0;
...@@ -3554,9 +3553,8 @@ setCifsAclRetry: ...@@ -3554,9 +3553,8 @@ setCifsAclRetry:
pSMB->AclFlags = cpu_to_le32(CIFS_ACL_DACL); pSMB->AclFlags = cpu_to_le32(CIFS_ACL_DACL);
if (pntsd && acllen) { if (pntsd && acllen) {
memcpy((char *) &pSMBr->hdr.Protocol + data_offset, memcpy((char *)pSMBr + offsetof(struct smb_hdr, Protocol) +
(char *) pntsd, data_offset, pntsd, acllen);
acllen);
inc_rfc1001_len(pSMB, byte_count + data_count); inc_rfc1001_len(pSMB, byte_count + data_count);
} else } else
inc_rfc1001_len(pSMB, byte_count); inc_rfc1001_len(pSMB, byte_count);
...@@ -5338,7 +5336,8 @@ CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon, ...@@ -5338,7 +5336,8 @@ CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon,
param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4; param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4;
offset = param_offset + params; offset = param_offset + params;
data_offset = (char *) (&pSMB->hdr.Protocol) + offset; data_offset = (char *)pSMB +
offsetof(struct smb_hdr, Protocol) + offset;
count = sizeof(FILE_BASIC_INFO); count = sizeof(FILE_BASIC_INFO);
pSMB->MaxParameterCount = cpu_to_le16(2); pSMB->MaxParameterCount = cpu_to_le16(2);
...@@ -5607,7 +5606,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, ...@@ -5607,7 +5606,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon,
u16 fid, u32 pid_of_opener) u16 fid, u32 pid_of_opener)
{ {
struct smb_com_transaction2_sfi_req *pSMB = NULL; struct smb_com_transaction2_sfi_req *pSMB = NULL;
FILE_UNIX_BASIC_INFO *data_offset; char *data_offset;
int rc = 0; int rc = 0;
u16 params, param_offset, offset, byte_count, count; u16 params, param_offset, offset, byte_count, count;
...@@ -5629,8 +5628,9 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, ...@@ -5629,8 +5628,9 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon,
param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4; param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4;
offset = param_offset + params; offset = param_offset + params;
data_offset = (FILE_UNIX_BASIC_INFO *) data_offset = (char *)pSMB +
((char *)(&pSMB->hdr.Protocol) + offset); offsetof(struct smb_hdr, Protocol) + offset;
count = sizeof(FILE_UNIX_BASIC_INFO); count = sizeof(FILE_UNIX_BASIC_INFO);
pSMB->MaxParameterCount = cpu_to_le16(2); pSMB->MaxParameterCount = cpu_to_le16(2);
...@@ -5652,7 +5652,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, ...@@ -5652,7 +5652,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon,
inc_rfc1001_len(pSMB, byte_count); inc_rfc1001_len(pSMB, byte_count);
pSMB->ByteCount = cpu_to_le16(byte_count); pSMB->ByteCount = cpu_to_le16(byte_count);
cifs_fill_unix_set_info(data_offset, args); cifs_fill_unix_set_info((FILE_UNIX_BASIC_INFO *)data_offset, args);
rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
if (rc) if (rc)
......
...@@ -158,6 +158,7 @@ cifs_reconnect(struct TCP_Server_Info *server) ...@@ -158,6 +158,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
try_to_freeze(); try_to_freeze();
/* we should try only the port we connected to before */ /* we should try only the port we connected to before */
mutex_lock(&server->srv_mutex);
rc = generic_ip_connect(server); rc = generic_ip_connect(server);
if (rc) { if (rc) {
cFYI(1, "reconnect error %d", rc); cFYI(1, "reconnect error %d", rc);
...@@ -169,6 +170,7 @@ cifs_reconnect(struct TCP_Server_Info *server) ...@@ -169,6 +170,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
server->tcpStatus = CifsNeedNegotiate; server->tcpStatus = CifsNeedNegotiate;
spin_unlock(&GlobalMid_Lock); spin_unlock(&GlobalMid_Lock);
} }
mutex_unlock(&server->srv_mutex);
} while (server->tcpStatus == CifsNeedReconnect); } while (server->tcpStatus == CifsNeedReconnect);
return rc; return rc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment