Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Oct 2013 21:26:57 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Boris Samorodov <bsam@passap.ru>
Cc:        Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>, FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: [10.0-amd64 host and 9.2-i386 jail] cpio: Can't update time for...
Message-ID:  <20131004182657.GW41229@kib.kiev.ua>
In-Reply-To: <524EFEFD.40805@passap.ru>
References:  <524C5781.9000500@passap.ru> <20131002174718.GY41229@kib.kiev.ua> <524C6384.6050508@passap.ru> <20131002191229.GZ41229@kib.kiev.ua> <524EFEFD.40805@passap.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--ZKeritKRIzYXZJZp
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Oct 04, 2013 at 09:46:37PM +0400, Boris Samorodov wrote:
> 02.10.2013 23:12, Konstantin Belousov =D0=C9=DB=C5=D4:
> > On Wed, Oct 02, 2013 at 10:18:44PM +0400, Boris Samorodov wrote:
> >> 02.10.2013 21:47, Konstantin Belousov =D0=C9=DB=C5=D4:
> >>> On Wed, Oct 02, 2013 at 09:27:29PM +0400, Boris Samorodov wrote:
> >>>> (CCing to the maintainer)
> >>>>
> >>>> Hi All,
> >>>>
> >>>> I've come across a problem and can't diagnose it. Please give me
> >>>> an advice how to proceed.
> >>>>
> >>>> I have a fresh CURRENT amd64 host with 9.2 (9.1 behaves the same)
> >>>> i386 jail. The command "/usr/bin/find -d <input_dir> | /usr/bin/cpio
> >>>> -dumpl <output_dir>" ends with error with diagnostic "cpio: Can't up=
date
> >>>> time for <a directory>".
> >>>>
> >>>> One can reproduce it by installing at 10-amd64 host poudriere, create
> >>>> a 9-i386 jail and try to build devel/tmake port. Full log is here:
> >>>> http://gw.wart.ru/bulk/91-i386-default/2013-10-02_14h52m08s/logs/err=
ors/tmake-1.13.log
> >>>>
> >>>> I've managed to find out that the command...:
> >>>> -----
> >>>> # /usr/bin/find -d /wrkdirs/usr/ports/devel/tmake/work/tmake-1.13/lib
> >>>> | /usr/bin/cpio -dumpl /destdir
> >>>> -----
> >>>>
> >>>> ...fails with diagnostic: "cpio: Can't update time for
> >>>> /destdir/wrkdirs/usr/ports/devel/tmake/work/tmake-1.13/lib".
> >>>>
> >>>> However the following command succeeds (mind the /* after lib):
> >>>> -----
> >>>> # /usr/bin/find -d /wrkdirs/usr/ports/devel/tmake/work/tmake-1.13/li=
b/*
> >>>> | /usr/bin/cpio -dumpl /destdir
> >>>> -----
> >>>>
> >>>> The directory itself seems quite natural:
> >>>> -----
> >>>> # ls -ldT /wrkdirs/usr/ports/devel/tmake/work/tmake-1.13/lib
> >>>> drwxr-xr-x  53 root  wheel  3264 Jan 28 05:21:45 2004
> >>>> /wrkdirs/usr/ports/devel/tmake/work/tmake-1.13/lib
> >>>> -----
> >>>>
> >>>> There are no problems at 10-amd64 and 10-i386 jails.
> >>>>
> >>>> I'm out of ideas. Thanks for your help.
> >>> ktrace the failing invocation ?
> >>
> >> The relevant part is here:
> >> ftp://ftp.wart.ru/pub/misc/bsdcpio-error-cant-update-time-kdump.txt
> >=20
> > So lutimes(2) fails with EINVAL, and in fact futimes(2) failed just bef=
ore
> > with the timeval array passed from the same address.  Most likely, EINV=
AL
> > comes from the getutimes() check, which verifies that usec values are
> > non-negative and less than 100000.
> >=20
> > You probably have to debug this by looking at the timeval initialization
> > and understanding where the value come from.
>=20
> The bad value (for birthtim) came from lstat() syscall.
>=20
> So far it seems to be a bug in time conversion. Pure hosts without
> jails (both 10 and 9) are not affected. The simple testcase:
> =3D=3D=3D=3D=3D
> host-amd64% sudo touch /jail/root/afile
> host-amd64% ./test-utimes /jail/root/afile
> ---> /jail/root/afile
> atim: 1380907943.417817881, mtim: 1380907943.417817881, ctim:
> 1380907943.417817881, birthtim:1380907943.417817881
> ...
> jail-i386# ./test-utimes /root/afile
> ---> /root/afile
> atim: 1380907943.417817881, mtim: 1380907943.417817881, ctim:
> 1380907943.417817881, birthtim:417817881.0
> =3D=3D=3D=3D=3D
>=20
> Look at the birthtim results.
>=20
> The testing program just do a stat/lstat (the resulta are the same)
> and print the resulting values.

Try this.

diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebs=
d32.h
index e6644f6..8376e95 100644
--- a/sys/compat/freebsd32/freebsd32.h
+++ b/sys/compat/freebsd32/freebsd32.h
@@ -175,6 +175,7 @@ struct stat32 {
 	u_int32_t st_blksize;
 	u_int32_t st_flags;
 	u_int32_t st_gen;
+	int32_t	st_lspare;
 	struct timespec32 st_birthtim;
 	unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));
 	unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec32));

--ZKeritKRIzYXZJZp
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQIcBAEBAgAGBQJSTwhwAAoJEJDCuSvBvK1BbEoP/jQjcsas/gTwYc0RpDL46PGv
h1lOhx7pYAOqlr/ls28K594yRUgMbmOF0XPSxLivOCz+G5yfD/hwLHWDqtmqM+V4
psBTGngEQ9V1PBECHKeKozxcnjDyCUlAk5TcasKUAcdMXUffjuxCfebDGOA1QjXU
KzJbbzQQTuNhJOGrY6jN3tQJHDep/Kcml+p0SqDPrdbyr3S4GqWp/kf5Y863WCW6
b92NWOaQFSZxwglzkzX4s7YXh+n738uGQzMbQwRnsxEBkjSOvum6ymSALbO7+YCt
pXNgdBd7sIb1f30quiMN+yrLQY5OHqefENEWsC4x1Q7E7DAxADqvxYBIUNhDKdfi
bviZ5FdlEXrAmwHgTn+UMu5VUQXJ/7eZMKAOiLTDM+upffhoEuCxdRQb0iN7HZOr
4B2DL9glKfeO4Fkqb+r5PbsUmLSInYnyTklsK92JNUxrK3aXO5Lpg4DNs2ooqh7R
weQn/a2ml0DID0mOc0WUKQjPWNcN1maO/GbwOTWi1U3FbPyM9y+A9WTuWFLNkl2L
H0tyaNOY68ASJrnfpDEH8HQsmn8fTglXAVew8L+tRAgsVG+RFmtKusm/EdTpjEwN
qiUi5Q34+6F7VApeelvb11iZu0fY0xC2ZJwKZAI9UtnWQ7fi0VcjS7lLRhQkoCFD
fUTs9tb5DZG9+m1Iusbm
=3yyb
-----END PGP SIGNATURE-----

--ZKeritKRIzYXZJZp--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131004182657.GW41229>