summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2013-10-07 10:05:25 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2013-10-07 10:05:25 +0000
commitc013b23b19ae86609e5d186123a4cc6b099ab9a4 (patch)
tree2ea2e8f61622a3aee2bf17a79dcb151afa9b16aa /sbin
parent406b7ac51f87f5ce44628c6d7cf9da3dac4469ab (diff)
Oops. Too mechanical -- can't use DL_SECTOBLK() to set fssize, since
command line sector size overrides disk label sector size. Add a comment to make sure I don't do it again.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/newfs/newfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index 0b17f07ee1f..f6cdf776d4b 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newfs.c,v 1.92 2013/10/06 22:13:26 krw Exp $ */
+/* $OpenBSD: newfs.c,v 1.93 2013/10/07 10:05:24 krw Exp $ */
/* $NetBSD: newfs.c,v 1.20 1996/05/16 07:13:03 thorpej Exp $ */
/*
@@ -441,7 +441,8 @@ havelabel:
fatal("%s: maximum file system size on the `%c' partition is "
"%llu sectors", argv[0], *cp, DL_GETPSIZE(pp));
- fssize = DL_SECTOBLK(lp, nsecs);
+ /* Can't use DL_SECTOBLK() because sectorsize may not be from label! */
+ fssize = nsecs * (sectorsize / DEV_BSIZE);
if (oflagset == 0 && fssize >= INT_MAX)
Oflag = 2; /* FFS2 */
if (fsize == 0) {