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

Lukas Ertl l.ertl at
Fri May 9 14:52:08 PDT 2003

Hi fs-hackers,

since I'm currently having fun in getting familiar with UFS/FFS and all
its related tools, I found the following piece of code in sbin/newfs/mkfs.c:

     * Validate the given file system size.
     * Verify that its last block can actually be accessed.
     * Convert to file system fragment sized units.
    if (fssize <= 0) {
        printf("preposterous size %jd\n", (intmax_t)fssize);
    wtfs(fssize - (realsectorsize / DEV_BSIZE), realsectorsize,
        (char *)&sblock);

I quite clueless why that wtfs() call is there at all and how it should
"verify that its last block can actually be accessed".

wtfs() is of type static void, and just calls bwrite() from libufs,
ignoring its return value.

Anyone can shed some light on this?

best regards,

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

More information about the freebsd-fs mailing list