aboutsummaryrefslogtreecommitdiff
path: root/sbin/quotacheck
Commit message (Collapse)AuthorAgeFilesLines
* Normally when an attempt is made to mount a UFS/FFS filesystem whoseKirk McKusick2018-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | superblock has a check-hash error, an error message noting the superblock check-hash failure is printed and the mount fails. The administrator then runs fsck to repair the filesystem and when successful, the filesystem can once again be mounted. This approach fails if the filesystem in question is a root filesystem from which you are trying to boot. Here, the loader fails when trying to access the filesystem to get the kernel to boot. So it is necessary to allow the loader to ignore the superblock check-hash error and make a best effort to read the kernel. The filesystem may be suffiently corrupted that the read attempt fails, but there is no harm in trying since the loader makes no attempt to write to the filesystem. Once the kernel is loaded and starts to run, it attempts to mount its root filesystem. Once again, failure means that it breaks to its prompt to ask where to get its root filesystem. Unless you have an alternate root filesystem, you are stuck. Since the root filesystem is initially mounted read-only, it is safe to make an attempt to mount the root filesystem with the failed superblock check-hash. Thus, when asked to mount a root filesystem with a failed superblock check-hash, the kernel prints a warning message that the root filesystem superblock check-hash needs repair, but notes that it is ignoring the error and proceeding. It does mark the filesystem as needing an fsck which prevents it from being enabled for writing until fsck has been run on it. The net effect is that the reboot fails to single user, but at least at that point the administrator has the tools at hand to fix the problem. Reported by: Rick Macklem (rmacklem@) Discussed with: Warner Losh (imp@) Sponsored by: Netflix Notes: svn path=/head/; revision=341608
* quotacheck: build with WARNS=3Eitan Adler2018-06-162-10/+11
| | | | | | | | | WARNS++ Tested with amd64, arm64, i386, mips Notes: svn path=/head/; revision=335268
* Revert r313780 (UFS_ prefix)Ed Maste2018-03-171-5/+5
| | | | Notes: svn path=/head/; revision=331095
* Prefix UFS symbols with UFS_ to reduce namespace pollutionEd Maste2018-03-171-5/+5
| | | | | | | | | | | | | Followup to r313780. Also prefix ext2's and nandfs's versions with EXT2_ and NANDFS_. Reported by: kib Reviewed by: kib, mckusick Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9623 Notes: svn path=/head/; revision=331083
* Refactoring of reading and writing of the UFS/FFS superblock.Kirk McKusick2018-01-262-26/+21
| | | | | | | | | | | | | | | Specifically reading is done if ffs_sbget() and writing is done in ffs_sbput(). These functions are exported to libufs via the sbget() and sbput() functions which then used in the various filesystem utilities. This work is in preparation for adding subperblock check hashes. No functional change intended. Reviewed by: kib Notes: svn path=/head/; revision=328426
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-203-3/+9
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* sbin: normalize paths using SRCTOP-relative paths or :H when possibleEnji Cooper2017-03-041-1/+1
| | | | | | | | | | This simplifies make logic/output MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314656
* Renumber copyright clause 4Warner Losh2017-02-284-4/+4
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* prefix UFS symbols with UFS_ to reduce namespace pollutionEd Maste2017-02-151-1/+2
| | | | | | | | | | | | | | | | | | | | | Specifically: ROOTINO -> UFS_ROOTINO WINO -> UFS_WINO NXADDR -> UFS_NXADDR NDADDR -> UFS_NDADDR NIADDR -> UFS_NIADDR MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency) Also prefix ext2's and nandfs's NDADDR and NIADDR with EXT2_ and NANDFS_ Reviewed by: kib, mckusick Obtained from: NetBSD MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9536 Notes: svn path=/head/; revision=313780
* For pointers use NULL instead of 0.Marcelo Araujo2016-05-161-1/+1
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=299876
* getfsent(3) will return NULL on EOF or error.Marcelo Araujo2016-04-191-1/+1
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=298239
* Create packages for atm, ccdconfig, devd, ipf, ipfw,Glen Barber2016-02-091-0/+1
| | | | | | | | | | | iscsi, natd, nandfs, pf, quotacheck, and routed. Add ping6 and rtsol to the runtime package. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295448
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-2/+1
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync from headSimon J. Gerraty2012-11-041-4/+6
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+20
| | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | Convert sbin/ to LIBADDBaptiste Daroussin2014-11-251-2/+1
| |/ |/| | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275030
* | Fix sbin/ build with a 64-bit ino_t.Matthew D Fleming2012-09-271-4/+6
|/ | | | | | | Original code by: Gleb Kurtsou Notes: svn path=/head/; revision=241013
* Remove trailing whitespace per mdoc lint warningEitan Adler2012-03-291-1/+1
| | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days Notes: svn path=/head/; revision=233648
* Update to current version of head.Kirk McKusick2010-04-281-1/+1
|\ | | | | | | Notes: svn path=/projects/quota64/; revision=207307
| * Fix several typos in macros or macro misusage.Ulrich Spörlein2010-03-121-1/+1
| | | | | | | | | | | | | | | | | | Found by: make manlint Reviewed by: ru Approved by: philip (mentor) Notes: svn path=/head/; revision=205076
* | Add the -c option to quotacheck to use the quota_convert(3) function toKirk McKusick2009-12-282-5/+63
| | | | | | | | | | | | | | convert between quota file formats. Notes: svn path=/projects/quota64/; revision=201147
* | Convert quotacheck to use new quotafile functions in libutil.Kirk McKusick2009-12-274-236/+109
|/ | | | | | | Still to come, conversion between 64-bit and 32-bit quotafile formats. Notes: svn path=/projects/quota64/; revision=201039
* Drag this code kicking and screaming into the twenty-first century.Dag-Erling Smørgrav2008-07-022-54/+29
| | | | Notes: svn path=/head/; revision=180187
* Sync up quotacheck's preen.c with fsck's. This makes quotacheckMike Pritchard2008-01-265-199/+237
| | | | | | | | | | | | process parallel checks in the same way as fsck, since fsck supports pass numbers other than 0, 1 or 2. Without this, quotacheck would ignore file systems with pass numbers > 2. The -l (maxrun) option is now deprecated and can be tuned with pass numbers in /etc/fstab if needed. Notes: svn path=/head/; revision=175678
* Quotacheck may possibly skip quota accounting for up to 2 filesMike Pritchard2008-01-151-3/+14
| | | | | | | | | | | | | on a filesystem if the quota data files reside on a different filesystem (e.g. the userquota=/somepath,groupquota=/somepath2 options are specified in /etc/fstab to place the quota files somewhere other than the default location). Fix quotacheck to only skip accounting if the quota data file actually resides on the filesystem being checked. Notes: svn path=/head/; revision=175344
* Fix "quotacheck -a" from core dumping on 64 bit systems by correctlyMike Pritchard2007-09-161-9/+10
| | | | | | | | | | | declaring the return value used by the routines in preen.c as a pointer type, instead of "int", which was causing the pointer to be truncated. Tested by: marck Approved by: re (bmah) Notes: svn path=/head/; revision=172193
* Flush stdout at the end of the update phase to prevent possibleMike Pritchard2007-09-141-0/+1
| | | | | | | | | duplicate output when "quotacheck -a -v" is used. Approved by: re (bmah) Notes: svn path=/head/; revision=172168
* If two files systems, /a and /b are marked as having quotas enabledMike Pritchard2007-02-041-6/+17
| | | | | | | | | | | | | | | | in fstab and they are normally mounted as /a/b, if /b is not mounted, the various quota utilities will incorrectly operate with the quotas on /a (silently) when operations are attemted on /b. Sync up all the hasquota() routines between all the different quota utilities and change it to detect if the file system we are attempting to perform quota operations on is not currently mounted and warn the user accordingly. PR: bin/38918 Notes: svn path=/head/; revision=166485
* Do not touch the block or i-node grace times for id 0.Mike Pritchard2007-02-031-2/+2
| | | | | | | | These are used to indicate the default grace period for the file system, and should not be touched by quotacheck. Notes: svn path=/head/; revision=166458
* Fix quotqcheck to correctly use the curinode count, and not theMike Pritchard2007-02-031-2/+2
| | | | | | | | curblock count when checking if the inode soft limit has been crossed. Notes: svn path=/head/; revision=166457
* Bump .Dd.Mike Pritchard2007-01-251-1/+1
| | | | Notes: svn path=/head/; revision=166230
* Add a BUGS section that shows that ids that appear to beMike Pritchard2007-01-251-0/+12
| | | | | | | | | | | negative are now ignored by the quota system and that extremely large ids may make quotacheck run for a very long time. Also mention that "options QUOTA" is required for the kernel to provide quota support. Notes: svn path=/head/; revision=166217
* Use fseeko to seek in the file, instead of fseek to prevent seekMike Pritchard2007-01-231-2/+2
| | | | | | | errors for extremely large uids (e.g. in the billions range). Notes: svn path=/head/; revision=166180
* Make sure that unknown uids/gids that now have non-zero usage andMike Pritchard2007-01-231-7/+24
| | | | | | | | had a previously recorded usage of zero are correctly displayed in verbose mode. Generalize the print routine a little too. Notes: svn path=/head/; revision=166179
* Quota system cleanup.Mike Pritchard2007-01-201-29/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | 1) Do not account for uids/gids that appear negative to prevent the creation of 131GB+ quota files. This is the same as the kernel now determines which files to provide quota accounting for. Related to PR kern/38156. This should also prevent boots from hanging if a negative uid appears in the file systems. 2) Do not count system files in the usage counts. These currently are file system snapshot and quota data files. This is how the kernel now handles those files. 3) Correctly generate new quota data files if the current files do not exist or are zero length in size. PR kern/30958. It should now be possible to newfs / mount / touch quota.{user,group} and quotaon a file system and have everything work. 4) Change some diagnostics to report the file system and type of id (uid or gid) that is being reported. 5) Truncate the quota data files if possible, instead of letting them grow to a big enough size to hold the largest UID/GID on the system (typically "nobody"). The kernel should now be able to grow the files as needed without deadlocking the system. PR: kern/30958, kern/38156 Notes: svn path=/head/; revision=166143
* Document the -l option.Ceri Davies2006-11-072-2/+16
| | | | | | | | Reviewed by: brd Approved by: ru (mentor) Notes: svn path=/head/; revision=164071
* Sync program's usage() with manpage's SYNOPSIS.Ruslan Ermilov2005-02-102-10/+5
| | | | Notes: svn path=/head/; revision=141611
* Remove advertising clause from University of California Regent's license,Mark Murray2004-04-093-12/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core, imp Notes: svn path=/head/; revision=128073
* style.Makefile(5):Johan Karlsson2004-02-231-1/+1
| | | | | | | Use WARNS?= instead of WARNS=. Notes: svn path=/head/; revision=126178
* Userland signed char fixes for PPC build. Problems were using a charPeter Grehan2004-01-221-2/+2
| | | | | | | | | | | | return for getopt() and comparing to -1, ditto with fgetc() and EOF, and using the kg_nice value from <sys/user.h> Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> Reviewed by: obrien, bde (a while back) Tested lightly on: ppc, i386, make universe Notes: svn path=/head/; revision=124830
* Prefer PATH_MAX to MAXPATHLEN. Both contain the trailing NUL, soWarner Losh2003-08-071-2/+2
| | | | | | | remove the unneeded +1. Notes: svn path=/head/; revision=118582
* Use __FBSDID() to quiet GCC 3.3 warnings.David E. O'Brien2003-05-032-8/+8
| | | | Notes: svn path=/head/; revision=114589
* Create a new 32-bit fs_flags word in the superblock. Add code to moveKirk McKusick2002-11-271-2/+1
| | | | | | | | | | | | | | | | | | | | the old 8-bit fs_old_flags to the new location the first time that the filesystem is mounted by a new kernel. One of the unused flags in fs_old_flags is used to indicate that the flags have been moved. Leave the fs_old_flags word intact so that it will work properly if used on an old kernel. Change the fs_sblockloc superblock location field to be in units of bytes instead of in units of filesystem fragments. The old units did not work properly when the fragment size exceeeded the superblock size (8192). Update old fs_sblockloc values at the same time that the flags are moved. Suggested by: BOUWSMA Barry <freebsd-misuser@netscum.dyndns.dk> Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=107294