Home | History | Annotate | Download | only in fsck_ext2fs
History log of /src/sbin/fsck_ext2fs/setup.c
RevisionDateAuthorComments
 1.39  31-Mar-2019  mlelstv Ignore EXT4 'kbytes written' field when validating alternate superblock.
 1.38  31-Mar-2019  mlelstv No longer rely on data in disklabel to deduce alternate superblock
positions from block size. Instead use the same defaults as newfs_ext2fs.

Side effect is that fsck_ext2fs now works with wedges.
 1.37  31-Mar-2019  mlelstv remove debug printfs from last commit.
 1.36  30-Mar-2019  mlelstv Ignore recorded last mount point when validating alternate superblocks.
Compute log_bsize correctly. This fixes computation of alternate
superblock addresses.
 1.35  15-Aug-2016  jdolecek branches: 1.35.14;
more informative debug output for unsupported features
 1.34  15-Aug-2016  jdolecek adjust inode size check to compare against EXT2_REV0_DINODE_SIZE, rather then sizeof(struct ext2fs_dinode), as the structure definition was expanded with the optional fields
 1.33  15-Aug-2016  jdolecek divorce list of features supported by fsck_ext2fs from the kernel;
while kernel might support e.g. extents, extra_isize or dir_nlink,
fsck could actually have no idea about the features
 1.32  04-Dec-2014  christos Instead of zerodivide, give a useful error message.
 1.31  23-Jun-2013  dholland branches: 1.31.6;
fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()
dbtofsb() -> FFS_DBTOFSB() or EXT2_DBTOFSB()

(Christos already did the lfs ones a few days back)
 1.30  19-Jun-2013  dholland Rename ambiguous macros:
MAXDIRSIZE -> UFS_MAXDIRSIZE or LFS_MAXDIRSIZE
NINDIR -> FFS_NINDIR, EXT2_NINDIR, LFS_NINDIR, or MFS_NINDIR
INOPB -> FFS_INOPB, LFS_INOPB
INOPF -> FFS_INOPF, LFS_INOPF
blksize -> ffs_blksize, ext2_blksize, or lfs_blksize
sblksize -> ffs_blksize

These are not the only ambiguously defined filesystem macros, of
course, there's a pile more. I may not have found all the ambiguous
definitions of blksize(), too, as there are a lot of other things
called 'blksize' in the system.
 1.29  22-Jan-2013  dholland Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
ROOTINO -> UFS_ROOTINO
WINO -> UFS_WINO
NXADDR -> UFS_NXADDR
NDADDR -> UFS_NDADDR
NIADDR -> UFS_NIADDR
MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
 1.28  16-Sep-2011  plunky branches: 1.28.2; 1.28.8;
NULL does not need a cast, here
 1.27  19-Oct-2009  bouyer Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !
 1.26  02-Mar-2009  tsutsui - add a sanity check for e2fs_inode_size in readsb()
- use EXT2_DINODE_SIZE() rather than sizeof(struct ext2fs_dinode) or
struct ext2fs_dinode array/pointer to see e2fs_ipb and inode offsets
 1.25  16-Mar-2008  lukem branches: 1.25.6; 1.25.8;
errexit() now provides the trailing \n (since fsck_ffs assumed that
from a conversion from err(3)), so "make it so".
 1.24  22-Dec-2007  tsutsui branches: 1.24.2; 1.24.4;
Use h2fs32() rather than fs2h32() on host to disk conversion.
 1.23  22-Dec-2007  tsutsui - use MINFREE defiend in <ufs/ext2fs/ext2fs.h>
- remove unnecessary casts
- unsigned -> unsigned int
- misc KNF
 1.22  22-Dec-2007  tsutsui Remove unused macro.
 1.21  13-Nov-2007  tsutsui branches: 1.21.2;
Fix e2fs_itpg calculation (a rounddown bug).
 1.20  16-Oct-2006  christos branches: 1.20.8;
comment out impossible code.
 1.19  26-Jun-2005  christos constify.
 1.18  09-Feb-2005  ws Add support for large files (>2GB).
Allow conversion of old filesystems to use this,
if they are already at revision 1.

There probably should be an option to turn revision 0 to revision 1.

Reviewed (in part) by Manuel (bouyer@).
 1.17  19-Jan-2005  xtraeme Kill __P(), ANSIfy, remove main() prototype; WARNS=2
 1.16  29-Oct-2004  dsl Add (unsigned char) cast to ctype function
Fix check for device name ending in [0-9a-h] (strchr(dev, 0) doesn't ever
return NULL - which is fortunate because the () were wrong as well!)
 1.15  22-Mar-2004  bouyer Fix disclaimer in my copyright. Pointed out by Thomas Klausner.
 1.14  05-Oct-2003  bouyer Remove references to University of California from my copyright notices.
 1.13  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22308, verified by myself.
 1.12  28-Jan-2000  bouyer Correct bogons in filetype option support, and add support for the
sparse_super option.
 1.11  26-Jan-2000  bouyer First cut at ext2fs rev 1 support (as of mke2fs 1.18): supports the filetype
option read/write and the sparse option read-only.
 1.10  17-Feb-1999  bouyer branches: 1.10.2;
Properly handle FIFO (linux seems to puts something in the block addr fields
here) and a new field that can be different in the master superblock and
its first copy. From Tim Shepard.
 1.9  01-Feb-1999  bouyer Check malloc's return value before using the pointer.
 1.8  12-Nov-1998  christos Adjust for DKTYPENAME changes.
 1.7  26-Jul-1998  mycroft const poisoning.
 1.6  09-Oct-1997  bouyer Ext2 metadata are always stored on disk in little-endian byte order,
so do byte-swapping on big-endian system. The byte-swap routines are in
fsck/bswap.c because they will also be used in fsck_ffs in future.
Tested on i386 and sparc.
 1.5  16-Sep-1997  mrg make these compile on the alpha after WARNS=1.
 1.4  14-Sep-1997  lukem * cleanup for WARNS=1
* deprecate register
* cleanup manpage
* remove unused docheck()
* getopt returns -1 not EOF
* put a ) in the correct place in a printf, so that the argument gets
& 0xff, not the result of printf() itself...
 1.3  10-Jul-1997  mikel prototype calcsb()
 1.2  16-Jun-1997  bouyer The computed superblock size is bigger than SBSIZE, malloc() enouth
memory for it. Apparently, this bug was hidden by our malloc implementation.
Reported by Jason Downs.
 1.1  11-Jun-1997  bouyer Add support programs for ext2fs. fsck_ext2fs is derived from fsck_ffs.
 1.10.2.1  01-Feb-2000  he Apply patch (requested by bouyer):
Add support for ext2fs revision 1, with read-only support for
the 'sparse_super' and 'filetype' options. Should fix PR#9088.
 1.20.8.2  23-Mar-2008  matt sync with HEAD
 1.20.8.1  09-Jan-2008  matt sync with HEAD
 1.21.2.1  27-Dec-2007  mjf Sync with HEAD.
 1.24.4.1  03-Apr-2008  mjf Sync with HEAD.
 1.24.2.1  24-Mar-2008  keiichi sync with head.
 1.25.8.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.25.6.1  16-Jan-2011  bouyer Pull up following revision(s) (requested by tsutsui in ticket #1486):
sbin/fsck_ext2fs/setup.c: revision 1.26
sbin/newfs_ext2fs/mke2fs.c: revision 1.10
sbin/newfs_ext2fs/mke2fs.c: revision 1.11
sbin/newfs_ext2fs/mke2fs.c: revision 1.12
sbin/fsck_ext2fs/inode.c: revision 1.24
sys/lib/libsa/ext2fs.c: revision 1.6
sbin/newfs_ext2fs/extern.h: revision 1.3
sbin/fsck_ext2fs/inode.c: revision 1.25
sys/lib/libsa/ext2fs.c: revision 1.7
sbin/fsck_ext2fs/inode.c: revision 1.26
sys/ufs/ext2fs/ext2fs_inode.c: revision 1.68
sbin/fsck_ext2fs/inode.c: revision 1.27
sbin/fsck_ext2fs/inode.c: revision 1.28
sys/ufs/ext2fs/ext2fs_dinode.h: revision 1.18
sys/ufs/ext2fs/ext2fs_dinode.h: revision 1.19
sbin/newfs_ext2fs/newfs_ext2fs.c: revision 1.5
sbin/newfs_ext2fs/newfs_ext2fs.8: revision 1.2
sbin/newfs_ext2fs/newfs_ext2fs.c: revision 1.6
sbin/newfs_ext2fs/newfs_ext2fs.8: revision 1.3
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.142
sbin/newfs_ext2fs/newfs_ext2fs.c: revision 1.7
sbin/newfs_ext2fs/newfs_ext2fs.8: revision 1.4
sbin/newfs_ext2fs/newfs_ext2fs.c: revision 1.8
PR/40936: Frederik Sausmikat: ext2fs: add support for inodes > 128 bytes
Support variable inode sizes.
catch up with variable inode size.
Don't use e2fs_inode_size in superblock on E2FS_REV0 file system.
- accept only EXT2_REV0_DINODE_SIZE inodesize on -O 0
- use inodesize to get offset of inode, not struct ext2fs_dinode array
Replace a magic number with a new EXT2_REV0_DINODE_SIZE macro.
Use EXT2_DINODE_SIZE() to get offset of inode, not struct ext2fs_dinode array.
Fix botched logic in inodesize check.
Use inodesize to get offset of inode in one more place.
- add a sanity check for e2fs_inode_size in readsb()
- use EXT2_DINODE_SIZE() rather than sizeof(struct ext2fs_dinode) or
struct ext2fs_dinode array/pointer to see e2fs_ipb and inode offsets
Sort options.
New sentence, new line.
Sort options in usage.
- unsigned -> unsigned int
- remove unnecessary casts from malloc(3) and free(3)
- fix a bogus indent
Use "size > INT32_MAX" rather than "size >= 0x80000000U" to check 2GB limit.
Add missed byteswap ops against ext2fs_dinode members.
Handle 32 bit uid field on E2FS_REV1.
 1.28.8.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.8.2  23-Jun-2013  tls resync from head
 1.28.8.1  25-Feb-2013  tls resync with head
 1.28.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.28.2.1  23-Jan-2013  yamt sync with head
 1.31.6.1  14-Apr-2015  snj Pull up following revision(s) (requested by christos in ticket #688):
sbin/fsck_ext2fs/setup.c: revision 1.32
Instead of zerodivide, give a useful error message.
 1.35.14.1  10-Jun-2019  christos Sync with HEAD

RSS XML Feed