summaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs
AgeCommit message (Collapse)Author
2015-02-07When getopt processing flags, many should be flag=1 instead of flag++Theo de Raadt
ok tedu miod
2015-01-20Adjust <sys/param.h> comments regarding use of use of MAXFRAG, orTheo de Raadt
delete <sys/param.h> if now possible ok guenther
2015-01-19remove #ifndef #define blocks trying to handle lack of BUFSIZTheo de Raadt
ok millert
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-10-14rely on reallocarray() to give us the overflow detection, rather thanTheo de Raadt
hand-crafting a solution. ok millert
2014-10-08trivial use of getreallocarray()Theo de Raadt
2014-09-06inodesc.id_entryno holds a file size, so upgrade it from int to u_int64_t;Philip Guenther
this fixes handling of very large files on FFS2. Correct a copy-n-pasto that rendered useless the check for allocated fragmented that are marked free in the bitmap. allocdir() returns an inode number, so return an ino_t. sizeof()*N should be printed with %zu, while direct and indirect block numbers should be cast to (long long) use %lld inodesc.id_entryno fix based on a diff from David Vasek <vasek@fido.cz> ok krw@ otto@
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-05-29fsck should use the same values in checking as newfs does in creatingKenneth R Westerback
a filesystem. fs_nspf and its derivitives like fs_spc are DEV_BSIZE values, not actual hardware disk sector values. Adjust initializations accordingly. Tweak header and man page comments to make the DEV_BSIZE'ness more obvious for future spelunkers. No-op for DEV_BSIZE (a.k.a. 512-byte) sector devices but should help checking filesystems on, e.g., 4k-byte sector devices. ok jmc@ on the man page tweaks.
2014-05-24Use consistent format specifiers (%lld) and casts (long long) whenKenneth R Westerback
printing out block numbers and sector numbers. Make output verbiage consistent. -Wall happier. Original diff and ok chl@
2014-05-21Nuke some trailing whitespace to shrink subsequent diffs.Kenneth R Westerback
2014-05-20As suggested by guenther@ and millert@, replace seek+[read|write] withKenneth R Westerback
p[read|write]. Makes the code much clearer by eliminating extra error checking and verbiage. No intentional functional change. Tweaks by and ok guenther@
2014-05-09Modernize spelling. 'Mimick' -> 'Mimic' in comment.Kenneth R Westerback
2014-05-09Fix '-b' option to work with the superblock locations output by newfsKenneth R Westerback
on 4096-byte sector disks. No-op on 512-byte sector disks. Adhering to the bedrock idea that ffs will *never* use anything but 512-byte block disk addressing (a.k.a. daddr_t), and believing that the 'fake' bread()/bwrite() functions should always be using 512-btye block numbers like their kernel big brothers, nuke the computed dev_bsize and use DEV_BSIZE for conversions to/from byte offsets. Spotted and various fixes tested by David Vasek. Still to fix: scanning for superblocks on 4K disks. ok otto@
2013-11-22Kirk was being waaaay too chummy with the compiler when he trustedPhilip Guenther
it to not optimize away a comparison against NULL-1. Add (unsigned char) casts for some ctype calls. Teach fsck_ext2fs about MAXPARTITIONS, letting it operate on partitions 'i' through 'p'. ok deraadt@ millert@ otto@
2013-11-11incorrect %lld for an intTheo de Raadt
2013-11-05Replace direct references to p_size, p_offset and d_secperunit withKenneth R Westerback
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in order to get|set correct value that includes the high bits of the value.
2013-11-03Add missing (long long) cast of variable, (long long) castsKenneth R Westerback
for defines fragnum, fsbtodb, cgsblock, and cgdmin.
2013-11-02No need to cast constants or simple variables to (daddr_t). UseKenneth R Westerback
(u_int64_t) instead of (daddr_t) when casting a variable in an expression passed to DL_SETDSIZE(). Change a variable counting open files from daddr_t to int64_t. ok deraadt@ with the tweak to fix that pesky expression.
2013-11-01Sprinkle (long long) casts where %lld is being used to print daddr_tKenneth R Westerback
variables. Some random whitespace/knf repairs encountered on the way. ok miod@ on inspection, feedback & more suggestions from millert@
2013-06-11final removal of daddr64_t. daddr_t has been 64 bit for a long enoughTheo de Raadt
test period; i think 3 years ago the last bugs fell out. ok otto beck others
2013-04-25big int_t/time_t fixes; ok deraadt@ krw@Otto Moerbeek
2013-04-24pretty print bigger off_tTheo de Raadt
ok tedu otto
2013-02-11Xr scan_ffs 8; requested by Scott McEachernJason McIntyre
2011-05-08Small memory optimization from NetBSD; ok krw@ millert@Otto Moerbeek
2011-05-02Remove unused variableCharles Longeau
ok krw@ otto@
2011-04-24remove support for (very) old ffs on-disk formats; ok krw@ and noOtto Moerbeek
objection form the usual suspects
2011-04-16Blend in some code from netbsd and freebsd that reduces memory consumptionOtto Moerbeek
and speeds things up in a lot of cases. Prompted by Amit Kulkarni; ok krw@ on a slighly diffrenent incarnation
2010-08-12Print the real device name followed by the disklabel UID in parenthesisJoel Sing
when fsck is run against a disklabel UID. This allows a user to determine which device is really being scanned. ok krw@
2010-07-09kill redundant docheck() function; ok deraadt@Otto Moerbeek
2010-07-09Avoid crashes by using correct types for block numbers, which can growOtto Moerbeek
large on very large filesystems; reported by Benny Lofgren; partly from FreeBSD. ok deraadt@ beck@ millert@
2010-06-15When fsck_ffs is used with disklabel UIDs the hot root test fails inJoel Sing
blockcheck() since we try to stat() the UID. This means that we fail to reload the mount if we have indeed cleaned the read-only root file system. To avoid this, rerun blockcheck() if the real name is different to the original device name, once we have opened the device with opendev(3). ok krw@ thib@
2010-06-09add missing headers needed for opendev() and close()Charles Longeau
ok jsing@ krw@
2010-06-05Switch fsck_ffs(8) and fsdb(8) to opendev(3) so that they will soon be ableJoel Sing
to operate with disklabel UIDs. ok marco@ krw@ otto@
2010-05-18dont let sys/ioctl.h imply that you get the ioctls in dkio.h. thisDavid Gwynne
gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include <sys/dkio.h> to the places that actually want and use the disk ioctls. this became an issue when krw@'s X build failed when he was testing a change to dkio.h. tested by krw@ help from and ok miod@
2010-03-03Add description of -p and remove reference to fstab processing.Otto Moerbeek
Prompted by J.C. Robers; ok jmc@
2010-01-10remove references to docs we no longer install;Jason McIntyre
2010-01-04Stop installing many of the incredibly dated and un-authoritative share/docTheo de Raadt
files. If any information found in these documents is worthwhile and you miss it, please make the time to work it into the manual pages (which people actually do read). ok guenther
2010-01-03Neither .Pp nor unqualified text are allowed at the top level of .Bl;Ingo Schwarze
instead, .It is required. Thus, move .Pp and text before the .Bl, and remove the .Pp altogether where it is not needed. Syntax errors found by mandoc(1), also required to fix the mandoc build; feedback and ok jmc@, and sobrado@ also supports the direction.
2009-12-10do not leak memory, found by parfait, ok millert ottoTheo de Raadt
(one case was a false positive, but one is a modified copy of the other)
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
2009-05-29catch funny values of cg_initediblk; make fsck_ffs more robustOtto Moerbeek
against forms of cg header corruption as experienced by todd@; ok millert@
2008-12-29Some forms of inode corruption can make remsize and thus isize goOtto Moerbeek
negative and cause SEGVs. Handle this the same as an out of range blockno. ok jsg@ (also victim) pedro@ thib@
2008-11-09add missing header needed by getpagesize().Charles Longeau
ok millert@
2008-11-06Have called pass pagesize into FS_KERNMAXFILESIZE(), because there is noTheo de Raadt
automatic symbol that has this information. PAGE_SIZE is simply not portable, or even fixed on some systems. ok otto
2008-11-02check for the maximum file size to avoid some out-of-bounds accesses;Otto Moerbeek
ok millert@
2008-06-10reduce mem usage by about 20% by packing state and type of an inode in a singleOtto Moerbeek
byte. Original diff by drahn@; twists by me; ok millert@ thib@
2008-06-10print sizeofs using %zu; ok joris@Otto Moerbeek
2008-06-09The new newfs(8) code causes alternate superblocks to end up inOtto Moerbeek
different locations than before. Actually, the disklabel does not contain enough info to completely reconstruct the locations of all alternate sb's. So use a hardcoded list of all possible 1st alternate sb locations, but don't forget to verify against the label. ok millert@ thib@
2008-05-26reorg fields in structs inodesc and inoinfo to reduce size on some archs; fromOtto Moerbeek
mickey; ok millert@