File corruption again

Jeremy Allison jeremy at valinux.com
Mon Jun 4 22:40:13 GMT 2001


On Tue, Jun 05, 2001 at 12:18:18AM +0200, Juergen Hasch wrote:
> Welcome back :-)

Thanks. 

> I have been testing this with NT4 server + workstation with SP6a as well
> as Win2K pro. The tests were performed with Samba running under 
> Linux/Solaris/Aix, the results remain the same.
> 
> With NT4 the vwv9 field has "strange" values. It's mostly set to 6,
> but can get almost any onther value. Usually these values are small
> and below 0x20.
> I could not find any pattern, the values aren't size related.
> Win2K works OK, vwv9 is alway 0 or 1. 
> 
> But wait - it's getting even stranger. Turning oplocks off I get
> no corruption under NT4 any more.
> 
> Also, when running Samba under Linux and creating a share
> on a tmpfs (shm) filesystem, I can only copy files up to 65535 bytes
> to the share using Win2K. Larger files fail.
> Removing CAP_LARGE_ from negprot.c let's me copy any file to the tmpfs
> share.
> I looked at the logs, but I didn't see any obvious error message. It's
> looks like it's not vwv9 related.

I'd definately like to see the debug level 10 for this.
In the meantime, can you try applying this patch which
should fix the NT4.x problems.

Jeremy.

Index: smbd/reply.c
===================================================================
RCS file: /data/cvs/samba/source/smbd/reply.c,v
retrieving revision 1.240.2.32
diff -u -r1.240.2.32 reply.c
--- smbd/reply.c        29 May 2001 03:30:55 -0000      1.240.2.32
+++ smbd/reply.c        4 Jun 2001 22:37:28 -0000
@@ -2660,7 +2660,7 @@
 {
   files_struct *fsp = file_fsp(inbuf,smb_vwv2);
   SMB_OFF_T startpos = IVAL(inbuf,smb_vwv3);
-  size_t numtowrite =
   SVAL(inbuf,smb_vwv10)|(((size_t)SVAL(inbuf,smb_vwv9))<<16);
+  size_t numtowrite = SVAL(inbuf,smb_vwv10);
   BOOL write_through = BITSETW(inbuf+smb_vwv7,0);
   ssize_t nwritten = -1;
   unsigned int smb_doff = SVAL(inbuf,smb_vwv11);
@@ -2677,6 +2677,10 @@
   CHECK_FSP(fsp,conn);
   CHECK_WRITE(fsp);
   CHECK_ERROR(fsp);
+
+  /* Deal with possible LARGE_WRITEX */
+  if (smblen > 0xFFFF)
+    numtowrite |= ((((size_t)SVAL(inbuf,smb_vwv9)) & 1 )<<16);
						  
   if(smb_doff > smblen || (smb_doff + numtowrite > smblen)) {
     END_PROFILE(SMBwriteX);

-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------




More information about the samba-technical mailing list