fstat st_size on open files on Parallels filesystem is wrong

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Nov 3 12:19:00 GMT 2015


On Nov  2 17:05, Jonathan Lennox wrote:
> On Monday, November 2 2015, "Corinna Vinschen" wrote to "cygwin@cygwin.com" saying:
> 
> > On Nov  2 08:08, Jonathan Lennox wrote:
> > > On Monday, November 2 2015, "Corinna Vinschen" wrote to "cygwin@cygwin.com" saying:
> > > > I added support for this filesystem (called prlfs in mount output) and
> > > > without hardlink support for now.  I uploaded a new developer snapshot
> > > > to https://cygwin.com/snapshots/ Please give it a try.
> > > 
> > > No, still seeing the failure in the snapshot:
> > > 
> > > $ ./stat-size-test.exe /cygdrive/y/foo ~/foo
> > > /cygdrive/y/foo: fstat: st_size=0
> > > /cygdrive/y/foo: stat: st_size=12
> > > /home/jonathan/foo: fstat: st_size=12
> > > /home/jonathan/foo: stat: st_size=12
> > 
> > Weird.  There should be no FileNetworkOpenInformation call anymore for
> > Netapp and the PrlSF filesystem.
> > 
> > Does Cygwin correctly recognize the FS?  What does `mount' print?  It
> > should print `type prlfs'.
> 
> $ mount
> C:/cygwin64/bin on /usr/bin type ntfs (binary,auto)
> C:/cygwin64/lib on /usr/lib type ntfs (binary,auto)
> C:/cygwin64 on / type ntfs (binary,auto)
> C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
> D: on /cygdrive/d type iso9660 (binary,posix=0,user,noumount,auto)
> E: on /cygdrive/e type iso9660 (binary,posix=0,user,noumount,auto)
> U: on /cygdrive/u type prlsf (binary,posix=0,user,noumount,auto)
> V: on /cygdrive/v type prlsf (binary,posix=0,user,noumount,auto)
> W: on /cygdrive/w type prlsf (binary,posix=0,user,noumount,auto)
> X: on /cygdrive/x type prlsf (binary,posix=0,user,noumount,auto)
> Y: on /cygdrive/y type prlsf (binary,posix=0,user,noumount,auto)
> Z: on /cygdrive/z type prlsf (binary,posix=0,user,noumount,auto)

"prlsf".  If Cygwin had recognized the FS, it would have printed
"prlfs".  I did this shuffle "sf" vs. "fs" on purpose.  But...

> > Can you please once again call `/usr/lib/csih/getVolInfo.exe Z:' and
> > `/usr/lib/csih/getVolInfo.exe Y:' and paste the output here?  I'm not
> > quite sure because the original getVolInfo call returned a filesystem
> > type of "PrlSF", not "PrlFS" as I had expected.  Cygwin now checks for
> > "PrlSF".
> > 
> 
> $ /usr/lib/csih/getVolInfo.exe /cygdrive/z
> Device Type        : 7
> Characteristics    : 10
> Volume Name        : <Shared Folders>
> Serial Number      : 0
> Max Filenamelength : 255
> Filesystemname     : <PrlSF>
> Flags              : 3
> [...]

...I don't understand *why* Cygwin doesn't recognize the FS.  It checks
explicitely for the "PrlSF" filesystem name.  I tried this locally
by faking the above information and it worked for me.

Btw., there's more than one problem here.  The fact that all drives
have the same volume name *and* a serial number of 0 leads to all
drives being identified as the same drive.  I have to add some code
creating a reproducible serial number from scratch if the original
serial number is 0, but for testing, I didn't implement this yet.

Talking about testing.  I created a test DLL which provides a lot
of output when stracing the calls.  I'll send you a private mail
with the URL to this DLL in a minute.  Please install it, and under
that DLL, run

  $ strace -o stat.trace ./stat-size-test.exe /cygdrive/y/foo

I'll need to have a look into that strace to (hopefully) see what's
going wrong.

>   FILE_READ_ONLY_VOLUME       : FALSE
>   FILE_SEQUENTIAL_WRITE_ONCE  : FALSE
>   FILE_SUPPORTS_TRANSACTIONS  : FALSE
> 
> (Note that the literal "/usr/lib/csih/getVolInfo.exe Z:" printed
> "NtOpenFile(\??\C:\cygwin64\home\jonathan\Z:) failed, c0000033", so I assume
> that's not what you want.)

Indeed. Sorry, I was thinking of one of my local test hacks using DOS
paths.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20151103/a6d9f82d/attachment.sig>


More information about the Cygwin mailing list