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

Lukas Ertl l.ertl at univie.ac.at
Fri May 9 15:07:45 PDT 2003


Hi Poul,

On Fri, 9 May 2003, Poul-Henning Kamp wrote:

> In message <20030509234356.T638 at korben.in.tern>, Lukas Ertl writes:
> >
> >wtfs() is of type static void, and just calls bwrite() from libufs,
> >ignoring its return value.
>
> In the good old days, people could write any damn number they wanted in
> a disklabel, and the kernel would let them.
>
> This check tried to make sure that the partition length picked up from
> the disklabel, or entered as an argument actually makes sense as far
> as you can actually write to the last sector.

Ok, I see, thanks for the history lesson :-)

> I'm not sure if this particular bit does anything at this point in
> time, we may have caught the issue earlier in the process, because
> today disk devices actually know how large they are.
>
> [...]
>
> 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?

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