mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
[CIFS] Fix byte range locking to Windows when Windows server returns
illegal RFC1001 length (which had caused the lock to block forever until killed).
This commit is contained in:
parent
0ae0efada3
commit
190fdeb844
4 changed files with 32 additions and 12 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
Version 1.38
|
||||||
|
------------
|
||||||
|
Fix tcp socket retransmission timeouts (e.g. on ENOSPACE from the socket)
|
||||||
|
to be smaller at first (but increasing) so large write performance performance
|
||||||
|
over GigE is better. Do not hang thread on illegal byte range lock response
|
||||||
|
from Windows (Windows can send an RFC1001 size which does not match smb size) by
|
||||||
|
allowing an SMBs TCP length to be up to a few bytes longer than it should be.
|
||||||
|
wsize and rsize can now be larger than negotiated buffer size if server
|
||||||
|
supports large readx/writex, even when directio mount flag not specified.
|
||||||
|
Write size will in many cases now be 16K instead of 4K which greatly helps
|
||||||
|
file copy performance on lightly loaded networks.
|
||||||
|
|
||||||
Version 1.37
|
Version 1.37
|
||||||
------------
|
------------
|
||||||
Fix readdir caching when unlink removes file in current search buffer,
|
Fix readdir caching when unlink removes file in current search buffer,
|
||||||
|
|
|
@ -294,8 +294,8 @@ A partial list of the supported mount options follows:
|
||||||
during the local client kernel build will be used.
|
during the local client kernel build will be used.
|
||||||
If server does not support Unicode, this parameter is
|
If server does not support Unicode, this parameter is
|
||||||
unused.
|
unused.
|
||||||
rsize default read size
|
rsize default read size (usually 16K)
|
||||||
wsize default write size
|
wsize default write size (usually 16K, 32K is often better over GigE)
|
||||||
rw mount the network share read-write (note that the
|
rw mount the network share read-write (note that the
|
||||||
server may still consider the share read-only)
|
server may still consider the share read-only)
|
||||||
ro mount network share read-only
|
ro mount network share read-only
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
version 1.36 September 6, 2005
|
version 1.37 October 9, 2005
|
||||||
|
|
||||||
A Partial List of Missing Features
|
A Partial List of Missing Features
|
||||||
==================================
|
==================================
|
||||||
|
@ -38,8 +38,8 @@ by unlocking all known byte range locks that we locked on the file.
|
||||||
i) quota support (needs minor kernel change since quota calls
|
i) quota support (needs minor kernel change since quota calls
|
||||||
to make it to network filesystems or deviceless filesystems)
|
to make it to network filesystems or deviceless filesystems)
|
||||||
|
|
||||||
j) finish writepages support (multi-page write behind for improved
|
j) investigate sync behavior (including syncpage) and check
|
||||||
performance) and syncpage. Started by Shaggy.
|
for proper behavior of intr/nointr
|
||||||
|
|
||||||
k) hook lower into the sockets api (as NFS/SunRPC does) to avoid the
|
k) hook lower into the sockets api (as NFS/SunRPC does) to avoid the
|
||||||
extra copy in/out of the socket buffers in some cases.
|
extra copy in/out of the socket buffers in some cases.
|
||||||
|
|
|
@ -420,6 +420,7 @@ int
|
||||||
checkSMB(struct smb_hdr *smb, __u16 mid, int length)
|
checkSMB(struct smb_hdr *smb, __u16 mid, int length)
|
||||||
{
|
{
|
||||||
__u32 len = smb->smb_buf_length;
|
__u32 len = smb->smb_buf_length;
|
||||||
|
__u32 clc_len; /* calculated length */
|
||||||
cFYI(0,
|
cFYI(0,
|
||||||
("Entering checkSMB with Length: %x, smb_buf_length: %x ",
|
("Entering checkSMB with Length: %x, smb_buf_length: %x ",
|
||||||
length, len));
|
length, len));
|
||||||
|
@ -440,19 +441,26 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
|
||||||
cERROR(1,
|
cERROR(1,
|
||||||
("smb_buf_length greater than MaxBufSize"));
|
("smb_buf_length greater than MaxBufSize"));
|
||||||
cERROR(1,
|
cERROR(1,
|
||||||
("bad smb detected. Illegal length. The mid=%d",
|
("bad smb detected. Illegal length. mid=%d",
|
||||||
smb->Mid));
|
smb->Mid));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkSMBhdr(smb, mid))
|
if (checkSMBhdr(smb, mid))
|
||||||
return 1;
|
return 1;
|
||||||
|
clc_len = smbCalcSize_LE(smb);
|
||||||
if ((4 + len != smbCalcSize_LE(smb))
|
if ((4 + len != clc_len)
|
||||||
|| (4 + len != (unsigned int)length)) {
|
|| (4 + len != (unsigned int)length)) {
|
||||||
cERROR(1, ("smbCalcSize %x ", smbCalcSize_LE(smb)));
|
cERROR(1, ("Calculated size 0x%x vs actual length 0x%x",
|
||||||
cERROR(1,
|
clc_len, 4 + len));
|
||||||
("bad smb size detected. The Mid=%d", smb->Mid));
|
cERROR(1, ("bad smb size detected for Mid=%d", smb->Mid));
|
||||||
|
/* Windows XP can return a few bytes too much, presumably
|
||||||
|
an illegal pad, at the end of byte range lock responses
|
||||||
|
so we allow for up to eight byte pad, as long as actual
|
||||||
|
received length is as long or longer than calculated length */
|
||||||
|
if((4+len > clc_len) && (len <= clc_len + 3))
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue