Bug in reply_write_and_X?

jra at dp.samba.org jra at dp.samba.org
Sat Dec 7 18:37:01 GMT 2002


On Sat, Dec 07, 2002 at 01:42:18AM -0800, Conrad Minshall wrote:
> I'm testing my smb client against Samba on FreeBSD.  The server's 
> local filesystem has a maximum filesize of 16 Terabytes.  If my 
> client attempts a writex with an offset of exactly 16TB then I see 
> ERRnoaccess rather than ERRdiskfull.  Looking at some 3.0 sources, it 
> appears reply_write_and_X() assumes that if write_file() returns zero 
> (nwritten) then an access error is presumed and reported.  But if the 
> offset is 16TB minus 1 then one byte is written and ERRdiskfull comes 
> back.

Actually the line of code you're looking at is misleading :
I presume you're looking at :

        if(((nwritten == 0) && (numtowrite != 0))||(nwritten < 0)) {
                END_PROFILE(SMBwriteX);
                return(UNIXERROR(ERRDOS,ERRnoaccess));
        }

The code return(UNIXERROR(ERRDOS,ERRnoaccess));  doesn't always
mean return ERRnoaccess, this code actually calls a function
that checks the value of the unix errno and maps that to a
Windows error. If no mapping can be made then a default error
of ERRnoaccess is returned.

The interesting question would be, why is the write at 16Tb
not setting an errno that is seen by this code ?

I recently fixed a bug with sign extensions at large file
sizes so I'd be very interested if you could CVS update and
test again. If it still fails than a debug level 10 log would
be very useful here. Alternatively I could pop around to the
Apple campus one night and look into it with you (one of the
benefits of being local :-).

Cheers,

	Jeremy.



More information about the samba-technical mailing list