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) PS # Shell test count1=`ls -l | wc -l` cnt=1 while true ; do count2=`ls -l | wc -l` if [ $count2 != $count1 ]; then echo "Error: $count2 != $count1" fi cnt=`expr ${cnt} + 1` echo "Test : $cnt" done /* 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); } }
Apparently There are OPEN bugs against this problem in smbfs PR#21407 and PR#24702 in http://bugs.samba.org/ Also this is smbclient problem as well. smbclient Version 2.2.4 Inconsistent directory listing on share mounted on linux from windows 2000. Some time not all files appear in the directory listing This is automated test: TDIR="YOURTESTDIR/LONGDIR90FILESORMORE" TDIR="WINDOWS" PASSWD=YourPWD w2kservice=//w2k/c dir_list() { smbclient ${w2kservice} ${PASSWD} -D "${TDIR}" <<EOF ls exit EOF } smbl=`dir_list` count1=`echo ${smbl} | wc -w` cnt=1 ercnt=0 while true ; do smbl=`dir_list` count2=`echo ${smbl} | wc -w` if [ $count2 != 23 ]; then # count 23 when could not connect initialy. Ignore if [ $count2 != $count1 ]; then echo "Error: $count2 != $count1" echo $smbl ercnt=`expr ${ercnt} + 1` fi cnt=`expr ${cnt} + 1` echo "Test : $cnt - ${ercnt} - $count2" if [ ${ercnt} -gt 3 ]; then exit fi fi done This is what it could make: #1052 is words count in directory listing Test : 1 - 0 - 1052 .... Test : 40 - 0 - 1052 #One file missing from lisisting Error: 1039 != 1052 Test : 41 - 1 - 1039 Error: 1039 != 1052 Test : 42 - 2 - 1039 Test : 43 - 2 - 1052 Test : 44 - 2 - 1052 Test : 45 - 2 - 1052 ....
On Tue, 18 Jun 2002 vlads@sympatico.ca wrote:> I have inconsistent directory listing on share mounted on linux from windows 2k. > Some time not all files appear in the directory listing.[snip]> 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.Running this for about an hour (on various looking directories) I have now seen it 3 times. It would help me if I was able to reproduce this more easily, so maybe you could test a few things for me: + With even longer filenames, does it happen more often? + Does more files add to the problem? + Does setting the ttl really low (ttl=10) or really high (ttl=100000) make any noticable difference? + Does smbclient also get missing files? I have never before been able to reproduce reports of missing files, but it is not a new problem and have been reported vs many different kernels. Ah, saw your followup. Yes, it's been reported before to samba-bugs as well as to this list. Someone tested the unicode patches for 2.4.18, available from: http://www.hojdpunkten.ac.se/054/samba/index.html and reported that the particular directory they were having problems with started to work. /Urban
Urban, I made a tcpdump files for each request. Look like windows do no return the missing file in any tcp packet.... Win returns a files by sets of 12 or 13 files. Than some packet exchange flows, Then anothr set of files. Missing files are the first in set if I look at dump that produce correct result. If two files are missing from list than they are in begining of diffrent sets. You could find the dumps on my website I've send to you. Hope you could find and fix the problem! Regards, Vlad