The Samba-Bugzilla – Bug 7676
Files duplicated in directory listing
Last modified: 2010-12-22 10:55:16 UTC
Server: Nexenta Core Platform 3.0 (~OpenSolaris b134).
Client: Debian Lenny (5.0.6) GNU/Linux running kernel 2.6.26-2-686 (2.6.26-25) with cifs.ko version 1.53.
The mount options used are (I stripped authentication info): rw,username=userX,password=passwordX,uid=userX,gid=groupY,dir_mode=0775,file_mode=0774
The problem I notice is that on the client, files appear multiple times in directory as soon as they are more than 127 actual files in the directory (and it is reproducible at will). At 127 files, each one is shown 2x (twice), up to 128x in directories with more that a few thousands files.
Their inodes are identical (as shows "ls -li"). Listing the directory gets slower and slower with the number of files (and duplicates) in it.
On the server, everything is fine though.
Shell globbing is getting the duplicates.
I tried with kernel 2.6.32 (which has a newer cifs.ko) from backports.debian.org, and the problem is not present (fixed?).
I'm going to report the current bug to Debian's BTS too (linux-image-2.6.26).
In the past, it was possible to download the sources for latest cifs.ko separately, and apply it to an older kernel, but it no longer seems possible (or I did not found latest sources).
I'm pretty sure this was fixed in some of the readdir fixes that have gone in since 2.6.26. I'm going to go ahead and close this as FIXED.