[Samba] FINDNEXT problem, w2k and linux smbfs

vlads at sympatico.ca vlads at sympatico.ca
Tue Jun 18 11:36:03 GMT 2002

 I have inconsistent directory listing on share mounted on linux from windows 2k.
Some time not all files appear in the directory listing.

 If reading directory listing multiple times (60-200 times) files listed originally would have one or two files missing in one of consecutive lists. The same problem appear as well if you are making backup of Windows files from multiple directories, there are chance that not all files would be listed and some files would be copied.

 Some time even first directory read will have missing file!

 Problem do not appear if tested on windows to windows or windows to Linux connections.
Directories I'm having a problems with have 70 to 250 files.
Average File name length 40 char.
rw and ro have the same problems.
stetting ttl argument have also no affect on this problem it only dellays it.

Also tested share from windows 98 - no problems!
For short directories ~ 30 files there are no problems as well!

Connection: Windows 2000 Pro (file server) -> 100TX -> Linux (client)

mount -t smbfs -o username=xxx,password=xxx,uid=0,gid=0,rw  //w2k/c  /mnt/w2kc
samba        2.2.4
mount.smbfs  2.2.4
Linux kernel 2.4.18

problem also exists
on samba-2.0.7 and kernel-2.4.2  (redhat-7.1)

# Shell test 
count1=`ls -l | wc -l`
while true ; do
    count2=`ls -l | wc -l`
    if [ $count2 != $count1 ]; then
       echo "Error: $count2 != $count1"
    cnt=`expr ${cnt} + 1`
    echo "Test : $cnt"

/* also java prog I used to test this problem on w2k and Linux 

import java.util.*;
import java.io.*;
public class SMBtest {
public static void main(String args[]) {
String directory = args[0];
File orig_dir = new File(directory);
File orig_fl[] = orig_dir.listFiles();
int orig_len = orig_fl.length;
int cnt = 0;
int er_cnt = 0;
do {
   	File new_dir = new File(directory);
   	File new_fl[] = new_dir.listFiles();
   	int new_len = new_fl.length;
   	cnt ++;
   	if (new_len != orig_len) {
   		er_cnt ++;
   	  	System.out.print(" new:" + new_len + "!= old:" + orig_len + "  ");
   	new_dir = null;
   	new_fl = null;
   	System.out.println(er_cnt + "-cnt" + cnt);
} while (er_cnt <= 8);

More information about the samba mailing list