*BSD News Article 9964


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA6883 ; Fri, 15 Jan 93 10:38:15 EST
Path: sserve!manuel.anu.edu.au!munnari.oz.au!bruce.cs.monash.edu.au!monu6!escargot!minyos.xx.rmit.OZ.AU!s902113
From: s902113@minyos.xx.rmit.OZ.AU (Luke Mewburn)
Newsgroups: comp.unix.bsd
Subject: Re: UFS on disk inode "spare" fields bad [and patch]
Date: 16 Jan 1993 14:07:25 GMT
Organization: RMIT Computer Centre
Lines: 51
Message-ID: <1j94qtINNjmd@escargot.xx.rmit.OZ.AU>
References: <1993Jan15.062302.15669@fcom.cc.utah.edu>
NNTP-Posting-Host: minyos.xx.rmit.oz.au
Keywords: UFS di_spare extensions

terry@cs.weber.edu (A Wizard of Earth C) writes:

> [...stuff on why he wrote the patch gone the way of the ded parrot...]

>The following is a patch to UFS to insure that the unused spare values
>are initialized to 0 when not in use.  The number of spare values present
>is counted as long words and is defined in dinode.h as SZ_DI_SPARE.  This
>is so that future partial use of these fields will not prevent the still
>unused "spare" fields from being correctly initialized.

>I also changed the "spare" values from long to unsigned long at the same
>time (to avoid potential sign extension problems when storing values
>directly into these fields, like "last archived date" when these fields
>are used without being labelled by a change to dinode.h).

>These patches only help for extensions made to file systems created *after*
>they are installed (sorry).  What this means is that you can either write
>a program to "blow" th spare fields to (unsigned long)0L after installing
>this patch, and traverse the entire file system, or you can put a kernel
>containing the patches on a dist.fs disk and install a system.

>Any opinions in this posting are my own and not those of my present
>or previous employers.
>-- 
>-------------------------------------------------------------------------------
>                                        "I have an 8 user poetic license" - me
> Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
>-------------------------------------------------------------------------------

Terry,
    dunno if you tested this patch on a normal dinode.h, etc cause
it don't work.
    firstly, in this header and ufs_inode.c you refer to SZ_DI_SPARE,
but in dinode.h you call it DI_SPARE_SZ (and thus the compile barfs
    secondly, ufs_inode.c wouldn't compile after this was fixed (and
I didn't get a chance to find out why - but I think that the error
message from gcc was the usual ``error reported on line blah cause a
type hasn't been defined or a semicolon has been misplaced'' type of
thing.

    Reckon it would be possible to fix it and re-release it?

TiA, Luke.

PS: what would be the simplest way to convert an 'old' UFS to the
newer 0-ed spare_field version?

--
               Luke Mewburn [Zak]     zak@rmit.edu.au
   "Nobody dies on the Discworld, they just become dimensionally
    disadvantaged."         Terry Pratchett in alt.fan.pratchett