From owner-freebsd-current@FreeBSD.ORG Thu Dec 28 12:19:29 2006 Return-Path: X-Original-To: freebsd-current@FreeBSD.ORG Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3FDA16A40F for ; Thu, 28 Dec 2006 12:19:29 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 4183913C463 for ; Thu, 28 Dec 2006 12:19:28 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (qtedgn@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id kBSCJMsK046636; Thu, 28 Dec 2006 13:19:27 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id kBSCJLEV046635; Thu, 28 Dec 2006 13:19:21 +0100 (CET) (envelope-from olli) Date: Thu, 28 Dec 2006 13:19:21 +0100 (CET) Message-Id: <200612281219.kBSCJLEV046635@lurza.secnetix.de> From: Oliver Fromme To: freebsd-current@FreeBSD.ORG, uspoerlein@gmail.com In-Reply-To: <7ad7ddd90612270810o6ebaf8c8mdbade512c1eb096f@mail.gmail.com> X-Newsgroups: list.freebsd-current User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Thu, 28 Dec 2006 13:19:27 +0100 (CET) Cc: Subject: Re: msdosfs and cd9660: stat(2) returns garbled birthtime X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-current@FreeBSD.ORG, uspoerlein@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2006 12:19:29 -0000 Ulrich Spoerlein wrote: > Oliver Fromme wrote: > > Please see PR kern/106018. It fixes the msdosfs case; > > it has already been committed a few weeks ago. > > > > I haven't looked at the cd9660 code, but if you see > > similar problems there, then I guess it needs a similar > > fix. ;-) > > Ah, sorry for not testing this on current (I used RELENG_6). Well, this is the "-current" mailing list, so I assumed you were using (an older version of) -current a.k.a. HEAD, not RELENG_6 which is -stable. I haven't checked whether the patch from kern/106018 has been MFCed. Maybe it wasn't deemed safe enough for inclusion during the 6.2 code freeze (it's a quite trivial patch, though). > Changeing each filesystem code to do this is somewhat ugly. I don't think it is ugly. It's up to each file system to decide which data makes sense to use for the birthtime. > Though I > don't think that we will grow significantly more statfs fields over > time, the syscall should probably first bzero() the struct and let the > fs-specific code fill in the/some blanks. That would mean that zero will be returned for fields that are not filled in by the FS-specific code. That's wrong. In most cases it probably makes more sense to return -1 for unsupported fields, rather than 0. And in some cases, a different value should be copied. (For example, FAT does not support ctime, but it would be wrong to return 0 or -1 for it. Instead, the most useful thing to do is copy the mtime value for the ctime.) The real fix is to have every FS fill in _all_ fields with reasonable values. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. (On the statement print "42 monkeys" + "1 snake":) By the way, both perl and Python get this wrong. Perl gives 43 and Python gives "42 monkeys1 snake", when the answer is clearly "41 monkeys and 1 fat snake". -- Jim Fulton