Call for testing Cygwin snapshot (problem with inode numbers)

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Dec 1 21:38:00 GMT 2005


On Dec  1 13:01, Peter Rehley wrote:
>   It only appears to be a problem  
> when I have a mac os x share mounted to a drive on windows.    When I  
> try with a windows share or a linux share I don't seem to have the  
> problem.
> 
> The problem that I'm seeing is that the inode value isn't unique when  
> listing a directory (or using any program that uses the inode value).

Do I understand you right that this only happens for directories?  The
normal file inodes are looking ok?

> The inode that comes back from doing a ls -li is first much shorter  
> that a normal inode.  I've included lists from my share when using  
> the 20051123 snapshot and then they 20051128 snapshot.  The only  
> change that I've done between the two is update cygwin using the  
> cygwin-inst snapshot file.

Yes, I have no Mac OS X handy.  I have attached two hacked test
applications, which you can simply build with `gcc -o foo foo.c'.

The first one, GetVolInfo, should get a Cygwin path to any file on the
Mac OS X share.  It prints the volume information returned from the
share.

The second one, GetFileInfo, should be called on a few directories and a
couple of files on the share.

The output of both tests might be helpful.

And another thing to try.  Could you please check (only with the latest
snapshot) if the resulting inode numbers are the same when running

 $ cd /local/cygwin/dir && ls -i //MacOSX/share/dir

and 

 $ cd //MacOSX/share && ls -i dir

?


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.
-------------- next part --------------
#include <stdio.h>
#include <string.h>
#include <sys/cygwin.h>
#define _WIN32_WINNT 0x0500
#include <windows.h>

#ifndef FILE_READ_ONLY_VOLUME
#define FILE_READ_ONLY_VOLUME 0x80000
#endif

int
main (int argc, char **argv)
{
  char winpath[256];
  char rootdir[256];
  char volname[256];
  char fsname[256];
  DWORD sernum = 0;
  DWORD maxlen = 0;
  DWORD flags = 0;

  if (argc < 2)
    {
      fprintf (stderr, "usage: %s path\n", argv[0]);
      return 1;
    }
  cygwin_conv_to_full_win32_path (argv[1], winpath);
  if (!GetVolumePathName(winpath, rootdir, 256))
    {
      fprintf (stderr, "GetVolumePathName: %d\n", GetLastError ());
      return 1;
    }
  printf ("rootdir: %s\n", rootdir);
  if (!GetVolumeInformation (rootdir, volname, 256, &sernum,
  			     &maxlen, &flags, fsname, 256))
    {
      fprintf (stderr, "GetVolumeInformation: %d\n", GetLastError ());
      return 1;
    }
  printf ("Volume Name        : <%s>\n", volname);
  printf ("Serial Number      : %lu\n", sernum);
  printf ("Max Filenamelength : %lu\n", maxlen);
  printf ("Filesystemname     : <%s>\n", fsname);
  printf ("Flags:\n");

  printf ("  FILE_CASE_SENSITIVE_SEARCH  : %s\n",
  	  (flags & FILE_CASE_SENSITIVE_SEARCH) ? "TRUE" : "FALSE");

  printf ("  FILE_CASE_PRESERVED_NAMES   : %s\n",
  	  (flags & FILE_CASE_PRESERVED_NAMES) ? "TRUE" : "FALSE");

  printf ("  FILE_UNICODE_ON_DISK        : %s\n",
  	  (flags & FILE_UNICODE_ON_DISK) ? "TRUE" : "FALSE");

  printf ("  FILE_PERSISTENT_ACLS        : %s\n",
  	  (flags & FILE_PERSISTENT_ACLS) ? "TRUE" : "FALSE");

  printf ("  FILE_FILE_COMPRESSION       : %s\n",
  	  (flags & FILE_FILE_COMPRESSION) ? "TRUE" : "FALSE");

  printf ("  FILE_VOLUME_QUOTAS          : %s\n",
  	  (flags & FILE_VOLUME_QUOTAS) ? "TRUE" : "FALSE");

  printf ("  FILE_SUPPORTS_SPARSE_FILES  : %s\n",
  	  (flags & FILE_SUPPORTS_SPARSE_FILES) ? "TRUE" : "FALSE");

  printf ("  FILE_SUPPORTS_REPARSE_POINTS: %s\n",
  	  (flags & FILE_SUPPORTS_REPARSE_POINTS) ? "TRUE" : "FALSE");

  printf ("  FILE_SUPPORTS_REMOTE_STORAGE: %s\n",
  	  (flags & FILE_SUPPORTS_REMOTE_STORAGE) ? "TRUE" : "FALSE");

  printf ("  FILE_VOLUME_IS_COMPRESSED   : %s\n",
  	  (flags & FILE_VOLUME_IS_COMPRESSED) ? "TRUE" : "FALSE");

  printf ("  FILE_SUPPORTS_OBJECT_IDS    : %s\n",
  	  (flags & FILE_SUPPORTS_OBJECT_IDS) ? "TRUE" : "FALSE");

  printf ("  FILE_SUPPORTS_ENCRYPTION    : %s\n",
  	  (flags & FILE_SUPPORTS_ENCRYPTION) ? "TRUE" : "FALSE");

  printf ("  FILE_NAMED_STREAMS          : %s\n",
  	  (flags & FILE_NAMED_STREAMS) ? "TRUE" : "FALSE");

  printf ("  FILE_READ_ONLY_VOLUME       : %s\n",
  	  (flags & FILE_READ_ONLY_VOLUME) ? "TRUE" : "FALSE");
  return 0;
}
-------------- next part --------------
#include <stdio.h>
#include <stdlib.h>
#include <sys/cygwin.h>
#include <windows.h>

int main(int argc, char **argv)
{
  HANDLE h;
  BY_HANDLE_FILE_INFORMATION local;
  char winpath[256];

  while (--argc > 0) {
    cygwin_conv_to_full_win32_path (*++argv, winpath);
    if (h = CreateFile(winpath, GENERIC_READ,
		       FILE_SHARE_READ | FILE_SHARE_WRITE,
		       NULL, OPEN_EXISTING,
		       FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS,
		       NULL)) {
      if (GetFileInformationByHandle (h, &local)) {
	printf("%s:\nFileAttributes: %20lx\n"
	       "VolumeSerialNo: %20lu       NumberOfLinks : %20lu\n"
	       "FileIndexHigh : %20lx       FileIndexLow  : %20lx\n",
	       winpath, local.dwFileAttributes,
	       local.dwVolumeSerialNumber, local.nNumberOfLinks, 
	       local.nFileIndexHigh, local.nFileIndexLow);
      }
      CloseHandle(h);
    }
  }

  return 0;
}

-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list