[PATCH] Wipe other file systems when creating new UFS

Robert Millan rmh at freebsd.org
Sat Dec 10 16:49:47 UTC 2011


2011/12/9 Andrey V. Elsukov <ae at freebsd.org>:
> i think before erasing 512 kib you should at least check actual available
> mediasize and don't use hardcoded 512 sector size.

2011/12/9 Andrey V. Elsukov <ae at freebsd.org>:
> sorry, now i see that you have used disk.d_bsize, not hardcoded.
> But the check for mediasize is still needed. :)

I think I'm actually checking for physical media size, in:

mediasize = get_block_device_size(disk.d_fd);

which is based on output from ioctl rather than file system data
structures.  Is that what you meant?


More information about the freebsd-fs mailing list