From owner-freebsd-bugs@FreeBSD.ORG Mon Dec 4 00:40:19 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9EA416A403 for ; Mon, 4 Dec 2006 00:40:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74E6C43CAA for ; Mon, 4 Dec 2006 00:39:49 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id kB40eDt4069637 for ; Mon, 4 Dec 2006 00:40:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kB40eDGK069634; Mon, 4 Dec 2006 00:40:13 GMT (envelope-from gnats) Date: Mon, 4 Dec 2006 00:40:13 GMT Message-Id: <200612040040.kB40eDGK069634@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Bruce Evans Cc: Subject: Re: kern/106255: [msdosfs] : correct setting of archive flag X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bruce Evans List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2006 00:40:19 -0000 The following reply was made to PR kern/106255; it has been noted by GNATS. From: Bruce Evans To: Rene Ladan Cc: freebsd-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: kern/106255: [msdosfs] : correct setting of archive flag Date: Mon, 4 Dec 2006 11:39:32 +1100 (EST) On Sun, 3 Dec 2006, Rene Ladan wrote: >> Description: > The MSDOS file system has an archive bit in the flags field. This bit roughly corresponds to the archive flag on the UFS file system. However, it is set the wrong way around: the flag should be set when the bit is present, and cleared when the bit is absent. The comment in msdosfs/direntry.h says that ATTR_ARCHIVE means that the file is new or modified (in other words, not archived), while the comment in sys/stat.h says that SF_ARCHIVED means that the file is archived, but I think both mean that it is archived. > --- msdosfs_vnops.c Mon Nov 6 14:41:57 2006 > +++ msdosfs_vnops.c.rene Sun Dec 3 11:58:47 2006 > @@ -352,7 +352,7 @@ > vap->va_ctime = vap->va_mtime; > } > vap->va_flags = 0; > - if ((dep->de_Attributes & ATTR_ARCHIVE) == 0) > + if (dep->de_Attributes & ATTR_ARCHIVE) > vap->va_flags |= SF_ARCHIVED; > vap->va_gen = 0; > vap->va_blocksize = pmp->pm_bpcluster; This only fixes the reporting of the flag. msdosfs still maintains the flag perfectly backwards (except DETIMES() is missing setting of it for for all changes -- I think all changes to metadata except possibly to atimes should set it to be perfectly backwards and clear it to be correct). Grep shows that this flag is negatively useful in FreeBSD. No file systems maintain it (except for getting it backwards in msdosfs). All archiving utilities need to maintain it for it to be useful, but none except tar even reference it (except possibly indirectly via strtofflags(3)), and tar seems to just print it (indirectly via a special version of strtofflags(3)). Bruce