Public bug reported:

Hi,

I have an smb share mounted via my /etc/fstab.  In my case, it is called
/mnt/duz_cdrive, type smbfs, share //mycomputer/c$.  I mounted it with
an administrator capable password to be sure that authority issues were
not a cause.

I built an slocate database over it, and when searching for known files,
they do not  always appear in the locate results.  Investigating
further, I ran the updatedb job with the -v flag, and I noted that it
did not traverse into some directories, even though I could easiy cd
into them, and sucessfully use the ls command.

I downloaded the source code to slocate and was unsure if the fts_*
routines, or perhaps the matching routine.  I built a simple program to
traverse and count all of the files on the share, and found that even
thought there are more than 300K files on the share, only 60K are
iterated over:

fts_count.c
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <time.h>
#include <fts.h>


/* Traverse the database */
/* This is basically the code used by slocate.c to find files and load them */
int main(int argc, char **argv)
{
        FTS *dir = NULL;
        FTSENT *file = NULL;
        int ret = 0;
        int count = 0;

        if (!(dir = fts_open(argv, FTS_PHYSICAL | FTS_NOSTAT, NULL))) {
                printf("fts_open: %s\n", strerror(errno));
        }

        /* Read all entries */
        while ((file = fts_read(dir))) {
                count++;
                if (file->fts_errno != 0) {
                        printf("%s - %s - %d - %s\n",   file->fts_path, 
                                                file->fts_name, 
                                                file->fts_errno,
                                                strerror(file->fts_errno));
                }
        }

        if(fts_close(dir) == -1) {
                printf( "fts_close(): Could not close fts: %s\n", 
strerror(errno));
        }       


        printf("Total: %d\n", count);
        return ret;
}

Many files are accessible, but some are not. The test program produces
some errors when it runs:

/mnt/duz_cdrive/Inprise - Inprise - 2 - No such file or directory
/mnt/duz_cdrive/mysql41 - mysql41 - 2 - No such file or directory
/mnt/duz_cdrive/Perl - Perl - 2 - No such file or directory
/mnt/duz_cdrive/Program Files - Program Files - 2 - No such file or directory
/mnt/duz_cdrive/RECYCLER - RECYCLER - 2 - No such file or directory
/mnt/duz_cdrive/ruby - ruby - 2 - No such file or directory

In reality, I can easily cd /mnt/duz_cdrive/ruby, and ls shows that
there are nine files and nine directories.   File operations appear to
work normally, as in cat ChangeLog.txt.

This is on Dapper.  I'm currently installing Edgy to see if it remains
an issue.

This is most likely repeatable via:

make a mount point:
mkdir -p /mnt/cdrive

Add an smb share to your /etc/fstab thusly:
//mycomputer/c$ /mnt/cdrive smbfs 
defaults,username=my_user_name,password=my_password,workgroup=MYWORKGROUP 0 0

reboot the system and log in.  The share should be accessible via the
gnome gui, as well as via the command line.

Then, slocate -v -U /mnt/cdrive and examine the list of directories that
are reported as the program runs.  Likely, you will notice that some
directories are not traversed.  In my case, the "C:\Program Files"
directory is one of the big missing directories.

I saw the following on google, but I am not clear on if this is the same issue 
or not:
http://www.mail-archive.com/bug-findutils@gnu.org/msg01212.html
 
Should you need further information, contact me at your convenience.

Thank you.

Regards,
Rich

** Affects: Ubuntu
     Importance: Undecided
         Status: Unconfirmed

-- 
slocate doesn't always locate on remote smbfs share
https://launchpad.net/bugs/71962

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to