[Samba] Time out failure with mvfs on Linux - FIXED

Nick THOMPSON nickthompson at agere.com
Mon Jul 26 14:31:53 GMT 2004


Well, worked around. It seems statfs returns a zero value for the block
size, which is then passed to adjust_blocks in the fromsize parameter.
This causes a divide by zero exception. I have modified the function to
check for the zero value and assume a reasonable default.

I have reported the issue to Rational, for a real fix, but I guess Samba
should protect itself anyway and prevent the exception if it can.

fsusage.c:

static SMB_BIG_UINT adjust_blocks(SMB_BIG_UINT blocks, SMB_BIG_UINT
fromsize, SMB_BIG_UINT tosize)
{
    if (fromsize == tosize)	{/* e.g., from 512 to 512 */
        return blocks;
    } else if (fromsize > tosize) {	/* e.g., from 2048 to 512 */
        return blocks * (fromsize / tosize);
    } else	{			/* e.g., from 256 to 512 */
        if (fromsize == 0) fromsize = tosize;  // cludge for ClearCase
MVFS
        return (blocks + 1) / (tosize / fromsize);
    }
}

Nick.

On Mon, 2004-07-26 at 14:37, Nick THOMPSON wrote:
> Hmm,
> 
> corresponding log from server side:
> 
> t2_rep: params_sent_thistime = 10, data_sent_thistime = 1280,
> useable_space = 131010
> t2_rep: params_to_send = 10, data_to_send = 1280, paramsize = 10,
> datasize = 1280
> write_socket(22,1352)
> write_socket(22,1352) wrote 1352
> SMBtrans2 mask=* directory=./ dirtype=22 numentries=12
> got smb length of 35
> got message type 0x0 of len 0x23
> Transaction 7 of length 39
> size=35
> smb_com=0x80
> smb_rcls=0
> smb_reh=0
> smb_err=0
> smb_flg=8
> smb_flg2=51201
> smb_tid=1
> smb_pid=9866
> smb_uid=100
> smb_mid=8
> smt_wct=0
> smb_bcc=0
> switch message SMBdskattr (pid 2866)
> change_to_user: Skipping user change - already user
> Floating point exception
> 
> So the SMB service dies with a floating point exception. Weird. Any
> ideas?
> 
> Nick.
> 
> 
> On Mon, 2004-07-26 at 11:43, Nick THOMPSON wrote:
> > I have tried Samba 3.0.2a and 3.0.4. We use Active directory. The server
> > is running on RHEL3.
> > 
> > When I connect to the server on a share that is acutally an ext3 or NFS
> > file system, I have no known problems. We use ClearCase on Linux and I
> > am trying to access my workspace (view) as I have done many times before
> > on Solaris, but now we are running on Linux and with a newer version of
> > ClearCase (2003.06.00). The file system involved is IBM/Rational MVFS.
> > 
> > I can connect to the relevant share successfully and when I do an 'ls',
> > I see all the files I expect to see. But I also get an error:
> > 
> > Error in dskattr: Call returned zero bytes (EOF)
> > 
> > Running with smbclient -d 10 ... I see the following:
> > 
> > smb: \> ls
> > <snipped stuff that looks okay>
> > received 12 entries (eos=1)
> > lang_tdb_init: /opt/samba/3.0.4/lib/en_US.iso885915.msg: No such file or
> > directory
> >   .                       D        0  Fri Jul 16 12:50:10 2004
> >   ..                      D        0  Mon Jul 26 11:09:07 2004
> >   cpumon                  D        0  Mon Dec 21 15:48:30 1998
> >   gsmcpu                  D        0  Fri Jul 16 16:42:57 2004
> >   logapp                  D        0  Wed Nov 17 10:31:33 1999
> >   sceptre3                D        0  Fri Jul 16 12:50:10 2004
> >   matlab                  D        0  Thu Feb 17 16:40:22 2000
> >   cossap                  D        0  Wed Dec 16 15:58:42 1998
> >   wizard                  D        0  Fri Jul 16 12:50:10 2004
> >   zeus                    D        0  Fri Jul 16 12:50:10 2004
> >   gollum                  D        0  Fri Oct 25 11:45:05 2002
> >   cocentric               D        0  Tue Nov 12 10:54:06 2002
> > write_socket(5,39)
> > write_socket(5,39) wrote 39
> > read_socket_with_timeout: timeout read. EOF from client.
> > receive_smb_raw: length < 0!
> > client_receive_smb failed
> > size=0
> > smb_com=0x0
> > smb_rcls=0
> > smb_reh=0
> > smb_err=0
> > smb_flg=0
> > smb_flg2=0
> > smb_tid=0
> > smb_pid=0
> > smb_uid=0
> > smb_mid=0
> > smt_wct=0
> > smb_bcc=0
> > Error in dskattr: Call returned zero bytes (EOF)
> > Total bytes listed: 0
> > 
> > Another 'ls' now displays only the error. Reconnecting to the share,
> > gets me back to the same starting point.
> > 
> > Any ideas what I can look at? It looks like a file system related issue,
> > but as the file system is working fine locally on the server for normal
> > Linux operations, it a bit difficult to call it a Rational bug at this
> > point.
> > 
> > Thanks,
> > Nick.



More information about the samba mailing list