delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/01/12/10:01:34

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4D2DC23E.5040202@redhat.com>
Date: Wed, 12 Jan 2011 08:01:18 -0700
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Strange fstatat / stat behavour on directories causing tar "file changed as we read it" error
References: <3501944D149644D394474781054F5E98 AT multiplay DOT co DOT uk> <4D2783A3 DOT 5000008 AT redhat DOT com> <D43AAA42D53E47AF958054385DAEFB50 AT multiplay DOT co DOT uk> <4D27C896 DOT 30202 AT cygwin DOT com> <265F601A437E4A03BE8C665BE7470721 AT multiplay DOT co DOT uk> <4D27D66F DOT 8030201 AT cygwin DOT com> <4D28F1AC DOT 1070907 AT laposte DOT net> <20110111095435 DOT GF3413 AT calimero DOT vinschen DOT de> <4D2C7024 DOT 8090507 AT redhat DOT com> <20110112102823 DOT GF6353 AT calimero DOT vinschen DOT de> <20110112104744 DOT GH6353 AT calimero DOT vinschen DOT de>
In-Reply-To: <20110112104744.GH6353@calimero.vinschen.de>
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------enig02164FA21554370C1D61207A
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 01/12/2011 03:47 AM, Corinna Vinschen wrote:
>=20
> On second thought, let's take a step back.
>=20
> Actually, directories can change all the time.  Why on earth is tar
> checking the st_size member of a directory at all?  That's a bug IMO.
> No application should do that.  I understand that a change in the inode
> number points to the fact that the directory has been replaced
> underfoot, but why should tar be concerned that a directory has changed
> its size while it's reading files from it?  I mean, even during a tar
> backup, there's no reason to expect that files are *not* added or
> deleted to a directory by other applications, and these actions may
> naturally change the size of the directory.

When tar is trying to capture the entire contents of the directory, any
modification to that directory (including adding a file to the directory
which changes the st_size of the directory) means that tar missed
something, so tar emits a warning to tell you about that fact.

>=20
> Having said that, I don't think it's correct to change Cygwin here.
> It's just a bug in tar.

I'm not sure we've established that point yet, but I'll raise the
question upstream.  But, assuming tar is doing the right thing...

>  The fact that the directory size changes even
> if the content hasn't changed is just a side effect of the OS MO.  It
> doesn't matter if the directory has actually changed or not.  It's not
> in the hand of a single application.

then cygwin's behavior DOES matter to tar - no other system changes the
st_size of a directory without ALSO adding or deleting files within that
directory and also updating the st_mtim of the directory; at which point
tar is entirely within its rights to complain (the directory changed
while trying to read it, so the tar file may be incomplete).  Locking
st_size at 0 avoids the issue entirely, whether or not upstream tar
agrees that checking changes in st_mtim but ignoring changes in st_size
would be a more appropriate behavior.

--=20
Eric Blake   eblake AT redhat DOT com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig02164FA21554370C1D61207A
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJNLcI+AAoJEKeha0olJ0Nq8HwH/09QXf6xvV5avB4OcfG1R61U
eDV5XFNiohVoGBcU4o7OIFhfJRHpPQXepdjgJYpO3PPVpJeg+QNfnHAT5pb2MfwO
xtq6SgEe2VlHZizYmff0GDVH9lK4WQIGT1gtOJTHnkI7CAooXSNMaqfFoLIABpSQ
3Ae03BHhgdSEnPphsn1m2qs0rphUHTV166myIS0AXvORtZaZl0Nb+kMJwrZQb7Nz
tENIjJHH6ztlhIwIy3XumbAj8GM3dQ7yuYHJKgnwxYLfByHcO1ncrffj3duh8dAa
y1mvg/DUSYUuiJ38diC3WSqOd0VPMrRellx+J3HrZdPubaHzQRv4LUP/5CNLa0E=
=aqZ/
-----END PGP SIGNATURE-----

--------------enig02164FA21554370C1D61207A--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019