newfs: useless/bogus check if new last block can be accessed?

Lukas Ertl l.ertl at univie.ac.at
Fri May 9 15:31:33 PDT 2003


On Sat, 10 May 2003, Poul-Henning Kamp wrote:

> In message <20030510000438.Y638 at korben.in.tern>, Lukas Ertl writes:
>
> >> syv# newfs -s 2049 md5
> >> newfs: /dev/md5: maximum file system size is 2048
> >> syv#
> >
> >But since this size check comes much earlier in the code, I guess the
> >wtfs() call is useless and should be removed, shouldn't it?
>
> If the check still works, I'd tend to keep it on the basis that it
> does no harm, but if you tell me that it would never result in an
> error, then we might as well remove it.

I don't think it does any harm to keep it (WRT to getting a working
filesystem), but since I don't see how it would signal an error (and this
is why I posted the question) I'd vote for removing the check.

And while we're here: shouldn't wtfs() actually give a return value and
not be just static void? (In terms of: "be a good programmer and check the
return values of your syscalls...") I think it's called often enough in
newfs to qualify for a check :-)

regards,
le

-- 
Lukas Ertl                             eMail: l.ertl at univie.ac.at
UNIX-Systemadministrator               Tel.:  (+43 1) 4277-14073
Zentraler Informatikdienst (ZID)       Fax.:  (+43 1) 4277-9140
der Universität Wien                   http://mailbox.univie.ac.at/~le/


More information about the freebsd-fs mailing list