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

Lukas Ertl l.ertl at univie.ac.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:

---8<---
    /*
     * 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);
        exit(13);
    }
    wtfs(fssize - (realsectorsize / DEV_BSIZE), realsectorsize,
        (char *)&sblock);
---8<---

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,
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