X-Recipient: archive-cygwin AT delorie DOT 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=U31f2mhDmQvDaYiE7PA26K0VDXCU73P2q2bJNr6H41uYxvRpNsrNl q9pFS1LDSx0qY5tbjFumDq8O34GSOKwlYgsnUXhn0NHVa70MCqRajQTcJCqiLg8G 6/93dccnZ0NkBhonWlRtM/xkG2d/d1Tv3enTcpngjCtkRY3USKeHBs= 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=PTATsUmppQYVZG1QV4bqrHuN5Rs=; b=RVSNfe1F6gEoFoFG++FbTyoSJlr6 /QoUcT16ljMksi82Xde2V84dI3NHFU440VP4g4idME8QUqF4vAb4nve6EmB2hE1u U4FHFspAxqqgFmhI40jrfQU+WJ2BPdLZKYkG/FGEl4/fLGOAW99BOt1tnLbMCn5m 5MHX9b4uDotyPiQ= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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: Mon, 2 Nov 2015 12:23:34 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: fstat st_size on open files on Parallels filesystem is wrong Message-ID: <20151102112334.GC5319@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <227151856 DOT 20140421223417 AT yandex DOT ru> <21333 DOT 26515 DOT 393838 DOT 380071 AT compute01 DOT cs DOT columbia DOT edu> <20140422081628 DOT GC2339 AT calimero DOT vinschen DOT de> <21334 DOT 55207 DOT 784319 DOT 488271 AT compute01 DOT cs DOT columbia DOT edu> <20140423084056 DOT GJ2339 AT calimero DOT vinschen DOT de> <21335 DOT 61113 DOT 963950 DOT 516021 AT compute01 DOT cs DOT columbia DOT edu> <20140423172413 DOT GQ2339 AT calimero DOT vinschen DOT de> <22038 DOT 38637 DOT 802707 DOT 846218 AT compute03 DOT cs DOT columbia DOT edu> <20151021110734 DOT GO5319 AT calimero DOT vinschen DOT de> <22071 DOT 12068 DOT 858109 DOT 210047 AT compute03 DOT cs DOT columbia DOT edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tBHT5Mz29exfSJaj" Content-Disposition: inline In-Reply-To: <22071.12068.858109.210047@compute03.cs.columbia.edu> User-Agent: Mutt/1.5.23 (2014-03-12) --tBHT5Mz29exfSJaj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Nov 2 04:38, Jonathan Lennox wrote: > On Wednesday, October 21 2015, "Corinna Vinschen" wrote to "cygwin AT cygwin= .com" saying: > > On Oct 8 12:16, Jonathan Lennox wrote: > > > No such luck, despite two major version revisions of Parallels Deskto= p (I'm > > > now on version 11.0.2) and moving to Windows 10 as the guest OS -- th= e bug > > > perists, unchanged. So it looks like Cygwin will need to add a worka= round > > > for this filesystem to fix the problem. > >=20 > > Ok, we could do that. Can you compile and run the testcase from > > https://cygwin.com/ml/cygwin/2014-04/msg00523.html again? Does it > > still show 0 vs. 12 bytes? Dumb extra test: Does the output change > > if you reorder the calls, requesting FileStandardInformation first, > > FileNetworkOpenInformation second? >=20 > I re-ran the test, no change. Changing the order gives the same result -- > FileStandardInformation works, FileNetworkOpenInformation doesn't. Ok, so it's not about some caching. > > Just create a hardlink on that drive using native means: > >=20 > > $ touch foo > > $ cmd /c mklink /h bar foo > >=20 > > Error at this point? No hardlinks. Otherwise: >=20 > "You do not have sufficient privilege to perform this operation." Is that > sufficient proof? No. > Unfortunately, when I do "Run As Administrator" on MinTTY, the Mac drives > (/cygdrive/z and /cygdrive/y) don't show up. I don't know why that is. S= o I > can't test hard links as administrator. That's a security feature of UAC. You can change that in the registry. As administrator: regtool -d set /HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVers= ion/Policies/System/EnableLinkedConnections 1 Then reboot. > > $ ls -li foo bar > >=20 > > Are the inode numbers identical? Congrats, hardlinks work. But given > > the general FAT-iness of the getVolInfo output, I guess it doesn't > > maintain hardlinks. >=20 > However, when I create a hardlink on the underlying (Mac) file system, the > inode numbers that Cygwin shows are not identical. So "no hardlinks" see= ms > very likely. Given the filesystem flags, Cygwin treats your FS as some kind of FAT anyway, so this isn't convincing. I doubt they work anyway, but if you really want to test it, use your orignal testcase and replace the NtQueryInformationFile like this: FILE_INTERNAL_INFORMATION fii; status =3D NtQueryInformationFile (h, &io, &fii, sizeof fii, FileInternalInformation); if (!NT_SUCCESS (status)) fprintf (stderr, "NtQueryInformationFile: 0x%08x\n", status); else printf ("inode number %llu\n", fii.FileId.QuadPart); Then call this application multiple times on some well known hardlinks to the same file. If they have the same number, all the time, hardlinks work. 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. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --tBHT5Mz29exfSJaj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWN0e2AAoJEPU2Bp2uRE+gOuMP/RgKDxf7OwvY6Hb1BHWebKsi m8AXl5pszTRxPtS6pFg5OLY98i8Sqh0GlX8LEMd+H8zqNxKEQu4Q5A3w5ntugHTs Y+0cx0Jq7zVuKw8vL/7g1/M6FkRqVdNc1XpYMX3FTrmkk2OHjj8IindRKYypQqLk zGXV0aP9VDxfM63cYnuynVuTSTZ49E6AP/nzHPN+tH+s/mCGA/Plh6MruPbjLtkV CmhHK1We3mqlWvzEhN4iJRr/a1J+cmTv6vLHIB88NbMFzOi1i5M7M7igw+U/0dZk KgmfFmMqm9fqmbJCI4yYrF7YzoghuanLusxnl/qDUYB727K6CxBrjrRX68eKULBV SG3I8X37zVMeHPpkCKRp229Ro8E4uuv3MTFb4efhW+iU/J97j0FSucdCtldFg+w3 IvwMfbgN72OBux8gJSxlGE63kRGsptdWZ94tZOcFQQ0I/DEjHzFEOI/4q4l7w+iQ a4CY6bz8bCIqsfH6ZbDoVL9sDhOBLssa8joxC6p9q/KkJRBRlgfitWcdUN9xBiSj IXCYLosyjkOi9Fy4bZ+u9okOVZUnDI7/ZA1B0lyPkCCZzJXNJrSv0LJ0wVRFcGA1 7MmRFyr0HAz7AtdP4WpeI7pJ5v782zTCzvi9oezGzC4lQGqlulw+QfaibBplFpu1 eZGsXUwRVkmt7UlCsv0Y =GlI4 -----END PGP SIGNATURE----- --tBHT5Mz29exfSJaj--