X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=XIvbJ71V0OijyjV+EB2Rgn9FM2PMQiOFEfZavHITOiNghlBmmHm8k
	wb0JKHu+ZnC/Dpq02oCr0fvzuseIkmRC0+3jWm4KI20KWwz+eFXGja3YI/MF0sMd
	w56CLSV5mdI+ylzILDh9dzyFHe5G4y2GLXMjfeEoNLWtXufnzTjdTA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=L5QoTL1A3Jk7z0mlR9pCwWDEDpE=; b=T6nJNeMe0EsHnyfMlL8S7rhwDotr
	a15hlrMOKkZynR+knxoLZ/f3T3HugFwYrMxQonm/hfE5fImxNrNKWApNBJtaLbqg
	a3GR4zs0orN2vDjkflkgJVoiW+GPIEm0GXceRwXwjSG9Zj5L1PdZ8o6OmaQA/vd1
	o2UiwxompHt3S/M=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Tue, 3 Nov 2015 13:19:10 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: fstat st_size on open files on Parallels filesystem is wrong
Message-ID: <20151103121910.GB18567@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20140423084056.GJ2339@calimero.vinschen.de> <21335.61113.963950.516021@compute01.cs.columbia.edu> <20140423172413.GQ2339@calimero.vinschen.de> <22038.38637.802707.846218@compute03.cs.columbia.edu> <20151021110734.GO5319@calimero.vinschen.de> <22071.12068.858109.210047@compute03.cs.columbia.edu> <20151102112334.GC5319@calimero.vinschen.de> <22071.24647.434328.551494@compute03.cs.columbia.edu> <20151102140627.GA963@calimero.vinschen.de> <22071.56848.992859.797169@compute03.cs.columbia.edu>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;	protocol="application/pgp-signature"; boundary="1LKvkjL3sHcu1TtY"
Content-Disposition: inline
In-Reply-To: <22071.56848.992859.797169@compute03.cs.columbia.edu>
User-Agent: Mutt/1.5.23 (2014-03-12)

--1LKvkjL3sHcu1TtY
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Nov  2 17:05, Jonathan Lennox wrote:
> On Monday, November 2 2015, "Corinna Vinschen" wrote to "cygwin@cygwin.co=
m" saying:
>=20
> > On Nov  2 08:08, Jonathan Lennox wrote:
> > > On Monday, November 2 2015, "Corinna Vinschen" wrote to "cygwin@cygwi=
n.com" saying:
> > > > I added support for this filesystem (called prlfs in mount output) =
and
> > > > without hardlink support for now.  I uploaded a new developer snaps=
hot
> > > > to https://cygwin.com/snapshots/ Please give it a try.
> > >=20
> > > No, still seeing the failure in the snapshot:
> > >=20
> > > $ ./stat-size-test.exe /cygdrive/y/foo ~/foo
> > > /cygdrive/y/foo: fstat: st_size=3D0
> > > /cygdrive/y/foo: stat: st_size=3D12
> > > /home/jonathan/foo: fstat: st_size=3D12
> > > /home/jonathan/foo: stat: st_size=3D12
> >=20
> > Weird.  There should be no FileNetworkOpenInformation call anymore for
> > Netapp and the PrlSF filesystem.
> >=20
> > Does Cygwin correctly recognize the FS?  What does `mount' print?  It
> > should print `type prlfs'.
>=20
> $ 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=3D0,user,noumount,auto)
> D: on /cygdrive/d type iso9660 (binary,posix=3D0,user,noumount,auto)
> E: on /cygdrive/e type iso9660 (binary,posix=3D0,user,noumount,auto)
> U: on /cygdrive/u type prlsf (binary,posix=3D0,user,noumount,auto)
> V: on /cygdrive/v type prlsf (binary,posix=3D0,user,noumount,auto)
> W: on /cygdrive/w type prlsf (binary,posix=3D0,user,noumount,auto)
> X: on /cygdrive/x type prlsf (binary,posix=3D0,user,noumount,auto)
> Y: on /cygdrive/y type prlsf (binary,posix=3D0,user,noumount,auto)
> Z: on /cygdrive/z type prlsf (binary,posix=3D0,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".
> >=20
>=20
> $ /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
>=20
> (Note that the literal "/usr/lib/csih/getVolInfo.exe Z:" printed
> "NtOpenFile(\??\C:\cygwin64\home\jonathan\Z:) failed, c0000033", so I ass=
ume
> that's not what you want.)

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


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--1LKvkjL3sHcu1TtY
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWOKY+AAoJEPU2Bp2uRE+gPTUP/Arjh9DIbjilS2gZ6EwmNtsf
Ul50xpX51BuC6gqJcMORJyswEzRuHNUx/qrSjA0xaduOwXu1FGwpdnuZmsGrMnFr
R2rP3nep6obElBk4RxfTM0erRjxGENN6Ttt1g+xXbd69wWomAkrOGfvQfcEBHbvW
evyMrj2H6hfpfRwNxvRFxzYzAShqRlhN8TbBd1kFBTEH8XY0ociG5m8haQ2nh5qF
MapmCKi2XYGcGmJd35wIxEz7sF3VIra0zoClF4YR/v8f43IgTkLkwQS1nwkOIlv0
u30uvHVtmUOiNeQmYEnm8iUg1e/2JcicWGYcd6k5MrMH1/0TOCh3A6qfJW0LFzig
9sliBemMGb+Rp/RhlbYoRouoD1tQaTxTi6oLcKSmDAuBuLkMJi31zwhzK4hTerUl
7I0ZhJLF21DnOd/kDkIocFP7UqkMG6FJugwVInrQs8bwAGwbugWwJ86g6J32uqZM
BxJsVM+C0z1drjrZ/4nWJOBK7k8WqCKX+Zzi8mG5RwiYCcEr9enSj6oH9ipw06YE
sc7iBpi/KYZvlIi0xXMM2ev7LnT+dPE8dRenK6AjzXAE/+W36FwBXWXntVXqwaZ6
r5EXQ1tsqhmcct7+Q7qINnDZt/oxHiMsRp0ZcPA87LYlkrRKoTXrRiEtNxXyvoNA
0LOtuL87U073fEnJAyA8
=4+oL
-----END PGP SIGNATURE-----

--1LKvkjL3sHcu1TtY--
