svn commit: r290600 - stable/9/usr.sbin/makefs/ffs
Garrett Cooper
ngie at FreeBSD.org
Mon Nov 9 09:29:40 UTC 2015
Author: ngie
Date: Mon Nov 9 09:29:38 2015
New Revision: 290600
URL: https://svnweb.freebsd.org/changeset/base/290600
Log:
MFstable/10 r290599:
MFC r266930,r289225:
r266930 (by jmg):
convert to using the _daddr_t types like newfs was...
Put the superblock in the correct possition for UFS2... There is a bug
in FFS that if we don't put it here (for UFS2), it will forcefully
relocate the superblock, and I believe cause data loss..
I have a fix for that, but w/ how many releases are broken, we won't be
able to switch to the better _FLOPPY (block 0) for this for a while..
r289225 (by sbruno):
makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily
checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel
module sanity checks do not like zero fs_old_size value and skips such UFS1
file system while tasting (fs_old_size derives from sblock.fs_providersize).
PR: 203704
Submitted by: eugen at grosbein.net
Reviewed by: marcel
Modified:
stable/9/usr.sbin/makefs/ffs/mkfs.c
Directory Properties:
stable/9/ (props changed)
stable/9/usr.sbin/ (props changed)
stable/9/usr.sbin/makefs/ (props changed)
Modified: stable/9/usr.sbin/makefs/ffs/mkfs.c
==============================================================================
--- stable/9/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:28:34 2015 (r290599)
+++ stable/9/usr.sbin/makefs/ffs/mkfs.c Mon Nov 9 09:29:38 2015 (r290600)
@@ -248,15 +248,16 @@ ffs_mkfs(const char *fsys, const fsinfo_
exit(21);
}
sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize);
- sblock.fs_size = fssize = dbtofsb(&sblock, fssize);
+ sblock.fs_size = sblock.fs_providersize = fssize =
+ dbtofsb(&sblock, fssize);
if (Oflag <= 1) {
sblock.fs_magic = FS_UFS1_MAGIC;
sblock.fs_sblockloc = SBLOCK_UFS1;
- sblock.fs_nindir = sblock.fs_bsize / sizeof(int32_t);
+ sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs1_daddr_t);
sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs1_dinode);
sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) *
- sizeof (int32_t));
+ sizeof (ufs1_daddr_t));
sblock.fs_old_inodefmt = FS_44INODEFMT;
sblock.fs_old_cgoffset = 0;
sblock.fs_old_cgmask = 0xffffffff;
@@ -272,15 +273,11 @@ ffs_mkfs(const char *fsys, const fsinfo_
sblock.fs_old_nrpos = 1;
} else {
sblock.fs_magic = FS_UFS2_MAGIC;
-#if 0 /* XXX makefs is used for small filesystems. */
sblock.fs_sblockloc = SBLOCK_UFS2;
-#else
- sblock.fs_sblockloc = SBLOCK_UFS1;
-#endif
- sblock.fs_nindir = sblock.fs_bsize / sizeof(int64_t);
+ sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs2_daddr_t);
sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode);
sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) *
- sizeof (int64_t));
+ sizeof (ufs2_daddr_t));
}
sblock.fs_sblkno =
More information about the svn-src-stable-9
mailing list