aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-10-10 14:48:26 -0400
committerSteve French <sfrench@us.ibm.com>2005-10-10 14:48:26 -0400
commit190fdeb84499a2dc046adae2eebfdda49e315e96 (patch)
treea8a84acaeabf0e92d965faf415702a3c37646fe7 /fs
parent0ae0efada36219024e4e3008f16c993d5d091280 (diff)
[CIFS] Fix byte range locking to Windows when Windows server returns
illegal RFC1001 length (which had caused the lock to block forever until killed).
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/CHANGES12
-rw-r--r--fs/cifs/README4
-rw-r--r--fs/cifs/TODO6
-rw-r--r--fs/cifs/misc.c22
4 files changed, 32 insertions, 12 deletions
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 535177238020..1c249a2abae3 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,3 +1,15 @@
1Version 1.38
2------------
3Fix tcp socket retransmission timeouts (e.g. on ENOSPACE from the socket)
4to be smaller at first (but increasing) so large write performance performance
5over GigE is better. Do not hang thread on illegal byte range lock response
6from Windows (Windows can send an RFC1001 size which does not match smb size) by
7allowing an SMBs TCP length to be up to a few bytes longer than it should be.
8wsize and rsize can now be larger than negotiated buffer size if server
9supports large readx/writex, even when directio mount flag not specified.
10Write size will in many cases now be 16K instead of 4K which greatly helps
11file copy performance on lightly loaded networks.
12
1Version 1.37 13Version 1.37
2------------ 14------------
3Fix readdir caching when unlink removes file in current search buffer, 15Fix readdir caching when unlink removes file in current search buffer,
diff --git a/fs/cifs/README b/fs/cifs/README
index 3b610d08dc1e..5d9a953888d9 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -294,8 +294,8 @@ A partial list of the supported mount options follows:
294 during the local client kernel build will be used. 294 during the local client kernel build will be used.
295 If server does not support Unicode, this parameter is 295 If server does not support Unicode, this parameter is
296 unused. 296 unused.
297 rsize default read size 297 rsize default read size (usually 16K)
298 wsize default write size 298 wsize default write size (usually 16K, 32K is often better over GigE)
299 rw mount the network share read-write (note that the 299 rw mount the network share read-write (note that the
300 server may still consider the share read-only) 300 server may still consider the share read-only)
301 ro mount network share read-only 301 ro mount network share read-only
diff --git a/fs/cifs/TODO b/fs/cifs/TODO
index 0593f6447319..c909298d11ed 100644
--- a/fs/cifs/TODO
+++ b/fs/cifs/TODO
@@ -1,4 +1,4 @@
1version 1.36 September 6, 2005 1version 1.37 October 9, 2005
2 2
3A Partial List of Missing Features 3A Partial List of Missing Features
4================================== 4==================================
@@ -38,8 +38,8 @@ by unlocking all known byte range locks that we locked on the file.
38i) quota support (needs minor kernel change since quota calls 38i) quota support (needs minor kernel change since quota calls
39to make it to network filesystems or deviceless filesystems) 39to make it to network filesystems or deviceless filesystems)
40 40
41j) finish writepages support (multi-page write behind for improved 41j) investigate sync behavior (including syncpage) and check
42performance) and syncpage. Started by Shaggy. 42for proper behavior of intr/nointr
43 43
44k) hook lower into the sockets api (as NFS/SunRPC does) to avoid the 44k) hook lower into the sockets api (as NFS/SunRPC does) to avoid the
45extra copy in/out of the socket buffers in some cases. 45extra copy in/out of the socket buffers in some cases.
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 8a0edd695f84..eba1de917f2a 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -420,6 +420,7 @@ int
420checkSMB(struct smb_hdr *smb, __u16 mid, int length) 420checkSMB(struct smb_hdr *smb, __u16 mid, int length)
421{ 421{
422 __u32 len = smb->smb_buf_length; 422 __u32 len = smb->smb_buf_length;
423 __u32 clc_len; /* calculated length */
423 cFYI(0, 424 cFYI(0,
424 ("Entering checkSMB with Length: %x, smb_buf_length: %x ", 425 ("Entering checkSMB with Length: %x, smb_buf_length: %x ",
425 length, len)); 426 length, len));
@@ -440,20 +441,27 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
440 cERROR(1, 441 cERROR(1,
441 ("smb_buf_length greater than MaxBufSize")); 442 ("smb_buf_length greater than MaxBufSize"));
442 cERROR(1, 443 cERROR(1,
443 ("bad smb detected. Illegal length. The mid=%d", 444 ("bad smb detected. Illegal length. mid=%d",
444 smb->Mid)); 445 smb->Mid));
445 return 1; 446 return 1;
446 } 447 }
447 448
448 if (checkSMBhdr(smb, mid)) 449 if (checkSMBhdr(smb, mid))
449 return 1; 450 return 1;
450 451 clc_len = smbCalcSize_LE(smb);
451 if ((4 + len != smbCalcSize_LE(smb)) 452 if ((4 + len != clc_len)
452 || (4 + len != (unsigned int)length)) { 453 || (4 + len != (unsigned int)length)) {
453 cERROR(1, ("smbCalcSize %x ", smbCalcSize_LE(smb))); 454 cERROR(1, ("Calculated size 0x%x vs actual length 0x%x",
454 cERROR(1, 455 clc_len, 4 + len));
455 ("bad smb size detected. The Mid=%d", smb->Mid)); 456 cERROR(1, ("bad smb size detected for Mid=%d", smb->Mid));
456 return 1; 457 /* Windows XP can return a few bytes too much, presumably
458 an illegal pad, at the end of byte range lock responses
459 so we allow for up to eight byte pad, as long as actual
460 received length is as long or longer than calculated length */
461 if((4+len > clc_len) && (len <= clc_len + 3))
462 return 0;
463 else
464 return 1;
457 } 465 }
458 return 0; 466 return 0;
459} 467}