Date: Fri, 25 Jul 2008 10:23:15 +0300 From: Jaakko Heinonen <jh@saunalahti.fi> To: Bruce Evans <brde@optusnet.com.au> Cc: freebsd-fs@freebsd.org Subject: Re: birthtime initialization Message-ID: <20080725072314.GA807@a91-153-120-204.elisa-laajakaista.fi> In-Reply-To: <20080724000618.Q16961@besplex.bde.org> References: <200806020800.m528038T072838@freefall.freebsd.org> <20080722075718.GA1881@a91-153-120-204.elisa-laajakaista.fi> <20080722215249.K17453@delplex.bde.org> <20080723103424.GA1856@a91-153-120-204.elisa-laajakaista.fi> <20080724000618.Q16961@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2008-07-24, Bruce Evans wrote: > First, the fields shouldn't be initialized using VATTR_NULL() in > VOP_GETATTR(). > Second, VNOVAL is an extremly bogus default value. Except for va_fsid because there's this check in vn_stat(): if (vap->va_fsid != VNOVAL) sb->st_dev = vap->va_fsid; else sb->st_dev = vp->v_mount->mnt_stat.f_fsid.val[0]; What do you think that is a proper default value for va_rdev? Some file systems set it to 0 and some to VNOVAL. > After deleting the bogus initializations, we're left with va_filerev, > va_birthtime and va_flags. Most file systems don't support these, so > they could usefully all be handled by defaulting them as in the proposed > changes for va_birthtime. Unfortunately moving initializations to vn_stat() breaks things. For example vm_mmap_vnode() uses VOP_GETATTR() to determine which file flags are set. Thus moving va_flags initialization to vn_stat() breaks mmap. In theory this could be a potential problem for birthtime too. > > 3) Initialize vattr with VATTR_NULL() but not birthtime explicitly. Thus > > tv_sec and tv_nsec are set to -1 (VNOVAL). (devfs, xfs, portalfs, > > pseudofs) > > I don't want the case (3). Otherwise good. Thank you for your valuable comments. I will try to update the patch. -- Jaakko
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080725072314.GA807>