Commit 0d7aad27 authored by Steve French's avatar Steve French Committed by Steve French

retry socket write on EAGAIN. Fix oops in write when tcp session dead.

parent 3bae9dd8
Version 0.89
------------
Fix oops on write to dead tcp session.
Version 0.88
------------
Fix non-POSIX behavior on rename of open file and delete of open file by taking
advantage of trans2 SetFileInfo rename facility if available on target server.
Retry on ENOSPC and EAGAIN socket errors.
Version 0.87 Version 0.87
------------ ------------
Fix oops on big endian readdir. Set blksize to be even power of two (2**blkbits) to fix Fix oops on big endian readdir. Set blksize to be even power of two (2**blkbits) to fix
......
...@@ -526,6 +526,10 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon, ...@@ -526,6 +526,10 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon,
if (rc) if (rc)
return rc; return rc;
/* tcon and ses pointer are checked in smb_init */
if (tcon->ses->server == NULL)
return -ECONNABORTED;
pSMB->AndXCommand = 0xFF; /* none */ pSMB->AndXCommand = 0xFF; /* none */
pSMB->Fid = netfid; pSMB->Fid = netfid;
pSMB->OffsetLow = cpu_to_le32(lseek & 0xFFFFFFFF); pSMB->OffsetLow = cpu_to_le32(lseek & 0xFFFFFFFF);
...@@ -584,6 +588,9 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, ...@@ -584,6 +588,9 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon,
(void **) &pSMBr); (void **) &pSMBr);
if (rc) if (rc)
return rc; return rc;
/* tcon and ses pointer are checked in smb_init */
if (tcon->ses->server == NULL)
return -ECONNABORTED;
pSMB->AndXCommand = 0xFF; /* none */ pSMB->AndXCommand = 0xFF; /* none */
pSMB->Fid = netfid; pSMB->Fid = netfid;
......
...@@ -233,9 +233,9 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) ...@@ -233,9 +233,9 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
(checkSMBhdr (checkSMBhdr
(smb_buffer, smb_buffer->Mid))) { (smb_buffer, smb_buffer->Mid))) {
cERROR(1, cERROR(1,
(KERN_ERR ("Invalid size or format for SMB found with length %d and pdu_lenght %d",
"Invalid size or format for SMB found with length %d and pdu_lenght %d",
length, pdu_length)); length, pdu_length));
cifs_dump_mem("Received Data is: ",temp,sizeof(struct smb_hdr));
/* BB fix by finding next smb signature - and reading off data until next smb ? BB */ /* BB fix by finding next smb signature - and reading off data until next smb ? BB */
/* BB add reconnect here */ /* BB add reconnect here */
......
...@@ -51,7 +51,6 @@ build_path_from_dentry(struct dentry *direntry) ...@@ -51,7 +51,6 @@ build_path_from_dentry(struct dentry *direntry)
for (temp = direntry; !IS_ROOT(temp);) { for (temp = direntry; !IS_ROOT(temp);) {
namelen += (1 + temp->d_name.len); namelen += (1 + temp->d_name.len);
cFYI(1, (" len %d ", namelen));
temp = temp->d_parent; temp = temp->d_parent;
} }
namelen += 1; /* allow for trailing null */ namelen += 1; /* allow for trailing null */
......
...@@ -169,7 +169,7 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer, ...@@ -169,7 +169,7 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
temp_fs = get_fs(); /* we must turn off socket api parm checking */ temp_fs = get_fs(); /* we must turn off socket api parm checking */
set_fs(get_ds()); set_fs(get_ds());
rc = sock_sendmsg(ssocket, &smb_msg, smb_buf_length + 4); rc = sock_sendmsg(ssocket, &smb_msg, smb_buf_length + 4);
while(rc == -ENOSPC) { while((rc == -ENOSPC) || (rc == -EAGAIN)) {
schedule_timeout(HZ/2); schedule_timeout(HZ/2);
rc = sock_sendmsg(ssocket, &smb_msg, smb_buf_length + 4); rc = sock_sendmsg(ssocket, &smb_msg, smb_buf_length + 4);
} }
......
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