[linux-cifs-client] Re: Fw: patch for properly converting Japanese et al to utf8

David Wuertele dave-gnus at bfnet.com
Mon Oct 4 23:46:21 GMT 2004


Steve> You are solving the right problem, but the cifs_readdir code
Steve> needs more surgery than that (not just for that - but also to
Steve> workaround a netapp server bug as well in which the last entry
Steve> is set incorrectly by the server and to avoid an extra memcopy
Steve> and to fix search rewind).

Are some of those bugs already fixed in the newest version?  I would
like to look at what was done.  Is this available anywhere?

I have started running into bugs in cifs_readdir() that may be things
you have already fixed in the newest version.

For example, the following program will oops my kernel every time on
cifs, but on smbfs it has no problem:

  #include <stdio.h>
  #include <sys/types.h>
  #include <dirent.h>
  #include <sys/stat.h>

  #define MAXBUF 4096

  void print_tree (char *path)
  {
    struct dirent *entry;
    DIR *dir = opendir (path);

    while ((entry = readdir (dir)) != NULL) {
      struct stat info;
      char newpath[MAXBUF];
      if (strcmp (entry->d_name, "." ) == 0) continue;
      if (strcmp (entry->d_name, ".." ) == 0) continue;
      snprintf (newpath, MAXBUF, "%s/%s", path, entry->d_name);
      fprintf (stderr, "%s\n", newpath);
      stat (newpath, &info);
      if (S_ISDIR (info.st_mode)) print_tree (newpath);
    }

    closedir (dir);
  }

  int main (char argc, char *argv[]) { print_tree (argv[1]);  return 0; }

Dave



More information about the linux-cifs-client mailing list