Author: sfrench
Date: 2006-07-16 05:07:17 +0000 (Sun, 16 Jul 2006)
New Revision: 61

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=linux-cifs-client&rev=61

Log:
Merge with main git tree

Modified:
   branches/linux-converged-for-old-kernels/fs/cifs/CHANGES
   branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h
   branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h
   branches/linux-converged-for-old-kernels/fs/cifs/cifssmb.c
   branches/linux-converged-for-old-kernels/fs/cifs/connect.c
   branches/linux-converged-for-old-kernels/fs/cifs/transport.c


Changeset:
Modified: branches/linux-converged-for-old-kernels/fs/cifs/CHANGES
===================================================================
--- branches/linux-converged-for-old-kernels/fs/cifs/CHANGES    2006-07-16 
04:54:08 UTC (rev 60)
+++ branches/linux-converged-for-old-kernels/fs/cifs/CHANGES    2006-07-16 
05:07:17 UTC (rev 61)
@@ -1,3 +1,9 @@
+Version 1.45
+------------
+Do not time out lockw calls when using posix extensions. Do not
+time out requests if server still responding reasonably fast
+on requests on other threads
+
 Version 1.44
 ------------
 Rewritten sessionsetup support, including support for legacy SMB

Modified: branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h
===================================================================
--- branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h   2006-07-16 
04:54:08 UTC (rev 60)
+++ branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h   2006-07-16 
05:07:17 UTC (rev 61)
@@ -112,5 +112,5 @@
 extern ssize_t cifs_listxattr(struct dentry *, char *, size_t);
 extern int cifs_ioctl (struct inode * inode, struct file * filep,
                       unsigned int command, unsigned long arg);
-#define CIFS_VERSION   "1.44"
+#define CIFS_VERSION   "1.45"
 #endif                         /* _CIFSFS_H */

Modified: branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h
===================================================================
--- branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h 2006-07-16 
04:54:08 UTC (rev 60)
+++ branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h 2006-07-16 
05:07:17 UTC (rev 61)
@@ -159,8 +159,8 @@
        /* 16th byte of RFC1001 workstation name is always null */
        char workstation_RFC1001_name[SERVER_NAME_LEN_WITH_NULL];
        __u32 sequence_number; /* needed for CIFS PDU signature */
-       char mac_signing_key[CIFS_SESS_KEY_SIZE + 16]; 
-       unsigned long last_receive_time;
+       char mac_signing_key[CIFS_SESS_KEY_SIZE + 16];
+       unsigned long lstrp; /* when we got last response from this server */
 };
 
 /*

Modified: branches/linux-converged-for-old-kernels/fs/cifs/cifssmb.c
===================================================================
--- branches/linux-converged-for-old-kernels/fs/cifs/cifssmb.c  2006-07-16 
04:54:08 UTC (rev 60)
+++ branches/linux-converged-for-old-kernels/fs/cifs/cifssmb.c  2006-07-16 
05:07:17 UTC (rev 61)
@@ -1494,8 +1494,8 @@
        char *data_offset;
        struct cifs_posix_lock *parm_data;
        int rc = 0;
+       int timeout = 0;
        int bytes_returned = 0;
-       int timeout = 0;
        __u16 params, param_offset, offset, byte_count, count;
 
        cFYI(1, ("Posix Lock"));
@@ -1514,7 +1514,6 @@
        pSMB->MaxSetupCount = 0;
        pSMB->Reserved = 0;
        pSMB->Flags = 0;
-       pSMB->Timeout = 0;
        pSMB->Reserved2 = 0;
        param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4;
        offset = param_offset + params;
@@ -1542,9 +1541,11 @@
        parm_data->lock_type = cpu_to_le16(lock_type);
        if(waitFlag) {
                timeout = 3;  /* blocking operation, no timeout */
-               pSMB->Timeout = cpu_to_le32(-1);/* blocking - do not time out */
                parm_data->lock_flags = cpu_to_le16(1);
-       }
+               pSMB->Timeout = cpu_to_le32(-1);
+       } else
+               pSMB->Timeout = 0;
+
        parm_data->pid = cpu_to_le32(current->tgid);
        parm_data->start = cpu_to_le64(pLockData->fl_start);
        parm_data->length = cpu_to_le64(len);  /* normalize negative numbers */

Modified: branches/linux-converged-for-old-kernels/fs/cifs/connect.c
===================================================================
--- branches/linux-converged-for-old-kernels/fs/cifs/connect.c  2006-07-16 
04:54:08 UTC (rev 60)
+++ branches/linux-converged-for-old-kernels/fs/cifs/connect.c  2006-07-16 
05:07:17 UTC (rev 61)
@@ -609,10 +609,6 @@
 
                task_to_wake = NULL;
                spin_lock(&GlobalMid_Lock);
-
-               /* Note when we last received a reply - needed for timeout 
purposes. */
-               server->last_receive_time = jiffies;
-
                list_for_each(tmp, &server->pending_mid_q) {
                        mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
 
@@ -659,6 +655,10 @@
 #ifdef CONFIG_CIFS_STATS2
                                mid_entry->when_received = jiffies;
 #endif
+                               /* so we do not time out requests to  server
+                               which is still responding (since server could
+                               be busy but not dead) */
+                               server->lstrp = jiffies;
                                break;
                        }
                }
@@ -2047,21 +2047,22 @@
                                        cifs_sb->mnt_cifs_flags |= 
                                                CIFS_MOUNT_POSIX_PATHS;
                                }
-
-                               if (cap & CIFS_UNIX_FCNTL_CAP) {
-                                       cFYI(1,("negotiate posix fcntl 
locking"));
-                               } else {
-                                       cFYI(1,("posix fcntl locking not 
supported"));
-                                       cap &= ~CIFS_UNIX_FCNTL_CAP;
-                               }
                                        
                                cFYI(1,("Negotiate caps 0x%x",(int)cap));
-
+#ifdef CONFIG_CIFS_DEBUG2
+                               if(cap & CIFS_UNIX_FCNTL_CAP)
+                                       cFYI(1,("FCNTL cap"));
+                               if(cap & CIFS_UNIX_EXTATTR_CAP)
+                                       cFYI(1,("EXTATTR cap"));
+                               if(cap & CIFS_UNIX_POSIX_PATHNAMES_CAP)
+                                       cFYI(1,("POSIX path cap"));
+                               if(cap & CIFS_UNIX_XATTR_CAP)
+                                       cFYI(1,("XATTR cap"));
+                               if(cap & CIFS_UNIX_POSIX_ACL_CAP)
+                                       cFYI(1,("POSIX ACL cap"));
+#endif /* CIFS_DEBUG2 */
                                if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) {
                                        cFYI(1,("setting capabilities failed"));
-                               } else {
-                                       /* Remember the capabilities we set. */
-                                       tcon->fsUnixInfo.Capability = 
cpu_to_le64(cap);
                                }
                        }
                }

Modified: branches/linux-converged-for-old-kernels/fs/cifs/transport.c
===================================================================
--- branches/linux-converged-for-old-kernels/fs/cifs/transport.c        
2006-07-16 04:54:08 UTC (rev 60)
+++ branches/linux-converged-for-old-kernels/fs/cifs/transport.c        
2006-07-16 05:07:17 UTC (rev 61)
@@ -497,14 +497,20 @@
                                /* We timed out. Is the server still
                                   sending replies ? */
                                spin_lock(&GlobalMid_Lock);
-                               lrt = ses->server->last_receive_time;
+                               lrt = ses->server->lstrp;
                                spin_unlock(&GlobalMid_Lock);
 
-                               /* Calculate 15 seconds past last received 
time. */
-                               lrt += (15 * HZ);
+                               /* Calculate 10 seconds past last receive time.
+                               Although we prefer not to time out if the 
+                               server is still responding - we will time
+                               out if the server takes more than 15 (or 45 
+                               or 180) seconds to respond to this request
+                               and has not responded to any request from 
+                               other threads on the client within 10 seconds */
+                               lrt += (10 * HZ);
                                if (time_after(jiffies, lrt)) {
-                                       /* Server sent no replies for 15 
seconds. */    
-                                       cERROR(1,("Server idle for 15 seconds. 
Timing out"));
+                                       /* No replies for 10 seconds. */
+                                       cERROR(1,("server not responding"));
                                        break;
                                }
                        } else {
@@ -792,14 +798,14 @@
                                /* We timed out. Is the server still
                                   sending replies ? */
                                spin_lock(&GlobalMid_Lock);
-                               lrt = ses->server->last_receive_time;
+                               lrt = ses->server->lstrp;
                                spin_unlock(&GlobalMid_Lock);
 
-                               /* Calculate 15 seconds past last received 
time. */
-                               lrt += (15 * HZ);
+                               /* Calculate 10 seconds past last receive time*/
+                               lrt += (10 * HZ);
                                if (time_after(jiffies, lrt)) {
-                                       /* Server sent no replies for 15 
seconds. */    
-                                       cERROR(1,("Server idle for 15 seconds. 
Timing out"));
+                                       /* Server sent no reply in 10 seconds */
+                                       cERROR(1,("Server not responding"));
                                        break;
                                }
                        } else {

Reply via email to