| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
* Rewrite the first paragraph to clarify that quot(8) only supports FFS.
* Document which options can or cannot be combined with each other.
MFC after: 1 week
Reviewed by: ziaee
Differential Revision: https://reviews.freebsd.org/D53727
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The existing parser was needlessly complicated and wildly inconsistent
in how it handled invalid input. Rewrite using getline() and treat
invalid input consistently: silently ignore lines that don't begin with
a number, and print a warning if the inode number is out of range.
PR: 290992
MFC after: 1 week
Reviewed by: obrien
Differential Revision: https://reviews.freebsd.org/D53726
|
| |
|
|
|
|
| |
Fixes: 195b00ec45e5 ("quot: Clean up")
Reviewed by: rlibby
Differential Revision: https://reviews.freebsd.org/D53224
|
| |
|
|
|
|
|
|
|
|
|
| |
To facilitate the task, we change the comparison function so that users
with equal filesystem usage are sorted by UID, and add an undocumented
option that prevents quot from replacing numerical UIDs with names. We
also switch from getfsfile(3) to getmntpoint(3) so the first line is
identical regardless of whether we pass quot a mountpoint or a device.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D53133
|
| |
|
|
|
|
|
|
|
| |
There was probably a time, more than 30 years ago, when the actual
size of a file had to be calculated and this option saved time, but
all it does today is give incorrect results for no benefit.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53132
|
| |
|
|
|
|
|
|
| |
We've had this code for 30 years, but there has never been a way to
build it. We have no idea if it still works, or if it ever worked.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53131
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix numerous style violations.
* Modernize somewhat.
* Don't bother examining errno after calling get_inode(), as it always
exits on error.
* Fix confusing wording in the manual page.
The code remains somewhat idiosyncratic, e.g. in its insistance on
counting down rather than up in simple for loops, but in the absence
of comprehensive automated tests, the risk of introducing bugs exceeds
the benefit of rewriting these into more idiomatic forms.
Reviewed by: obiwac
Differential Revision: https://reviews.freebsd.org/D53130
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If it encounters an inode whose owner does not have a pw entry, quot
allocates a 7-byte buffer (8 in practice, since that is the minimum
allocation size) and uses it to store the numeric uid preceded by a
hash character. This will overflow the allocated buffer if the UID
exceeds 6 decimal digits. Avoid this by using asprintf() instead.
While here, simplify the common case as well using strdup().
Reported by: Igor Gabriel Sousa e Souza <igor@bsdtrust.com>
MFC after: 3 days
Reviewed by: obiwac, emaste
Differential Revision: https://reviews.freebsd.org/D53129
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each program that operates on UFS on-disk inodes defines its own
version of a dinode. They all (of necessity) define the same
layout but use different names. This change adds a definition of
a dinode (a union of a UFS1 on-disk inode and a UFS2 on-disk inode)
as well as a dinodep (a union of a pointer to a UFS1 on-disk inode
and a pointer to a UFS2 on-disk inode) in sys/ufs/ufs/dinode.h.
It then deletes the definitions of dinode and dinodep in all the
programs that operate on them and instead uses these standard
definitions.
No functional change intended.
MFC-after: 1 week
|
| |
|
|
|
|
|
| |
This is a residual of the $FreeBSD$ removal.
MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
| |
Also update the man page and usage to be a little more accurate with the
-a flag.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/983
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
|
| |
|
|
| |
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
|
| |
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than trying to shoehorn flags into the requested superblock
address, create a separate flags parameter to the ffs_sbget()
function in sys/ufs/ffs/ffs_subr.c. The ffs_sbget() function is
used both in the kernel and in user-level utilities through export
to the sbget() function in the libufs(3) library (see sbget(3)
for details). The kernel uses ffs_sbget() when mounting UFS
filesystems, in the glabel(8) and gjournal(8) GEOM utilities,
and in the standalone library used when booting the system
from a UFS root filesystem.
The ffs_sbget() function reads the superblock located at the byte
offset specified by its sblockloc parameter. The value UFS_STDSB
may be specified for sblockloc to request that the standard
location for the superblock be read.
The two existing options are now flags:
UFS_NOHASHFAIL will note if the check hash is wrong but will still
return the superblock. This is used by the bootstrap code to
give the system a chance to come up so that fsck can be run to
correct the problem.
UFS_NOMSG indicates that superblock inconsistency error messages
should not be printed. It is used by programs like fsck that
want to print their own error message and programs like glabel(8)
that just want to know if a UFS filesystem exists on a partition.
One additional flag is added:
UFS_NOCSUM causes only the superblock itself to be returned, but does
not read in any auxiliary data structures like the cylinder group
summary information. It is used by clients like glabel(8) that
just want to check for possible filesystem types. Using UFS_NOCSUM
skips the superblock checks for csum data which allows superblocks
that have corrupted csum data to be read and used.
The validate_sblock() function checks that the superblock has not
been corrupted in a way that can crash or hang the system. Unless
the UFS_NOMSG flag is specified, it will print out any errors that
it finds. Prior to this commit, validate_sblock() returned as soon
as it found an inconsistency so would print at most one message.
It now does all its checks so when UFS_NOMSG has not been specified
will print out everything that it finds inconsistent.
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fs_summary_info structure. This change was originally done
by the CheriBSD project as they need larger pointers that
do not fit in the existing superblock.
This cleanup of the superblock eases the task of the commit
that immediately follows this one.
Suggested by: brooks
Reviewed by: kib
PR: 246983
Sponsored by: Netflix
Notes:
svn path=/head/; revision=362358
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
Notes:
svn path=/head/; revision=331095
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.
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.
No functional change intended.
Notes:
svn path=/head/; revision=326276
|
| |
|
|
|
|
|
| |
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=325188
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
No functional change.
Notes:
svn path=/head/; revision=298913
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| | |
Notes:
svn path=/projects/bmake/; revision=284172
|
| | |
| |
| |
| | |
Notes:
svn path=/projects/bmake/; revision=266219
|
| | |
| |
| |
| | |
Notes:
svn path=/projects/bmake/; revision=265802
|
| | |
| |
| |
| | |
Notes:
svn path=/projects/bmake/; revision=248169
|
| | |
| |
| |
| | |
Notes:
svn path=/projects/bmake/; revision=246868
|
| | |\
| |/
|/|
| | |
Notes:
svn path=/projects/bmake/; revision=242545
|
| | |
| |
| |
| |
| |
| |
| | |
Requested by: Simon Gerraty <sjg@juniper.net>
Notes:
svn path=/projects/bmake/; revision=239572
|
| |/
|
|
|
|
|
| |
Original code by: Gleb Kurtsou
Notes:
svn path=/head/; revision=241015
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
include sys/time.h instead of time.h. This include is incorrect as
per the manpages for the APIs and the POSIX definitions. This commit
replaces sys/time.h where necessary with time.h.
The commit also includes some minor style(9) header fixup in newfs.
This commit is part of a larger effort by Garrett Cooper started in
//depot/user/gcooper/posix-conformance-work/ -- to make FreeBSD more
POSIX compliant.
Submitted by: Garrett Cooper yanegomi at gmail dot com
Notes:
svn path=/head/; revision=217769
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A very long time ago we had raw device nodes. quot(8) was supposed to
use these when running `quot -a'. For some reason the code got once
changed to strip the device name until it reaches the last slash. This
is not reliable, because this means /dev/mirror/foo will be stripped to
/dev/foo.
This bug also exists on RELENG_7 and RELENG_6, but I think I'll just
merge them back somewhere after the upcoming releases. There's no rush.
MFC after: 2 months
Notes:
svn path=/head/; revision=183018
|
| |
|
|
| |
Notes:
svn path=/head/; revision=180187
|
| |
|
|
|
|
|
|
|
| |
PR: misc/103822
Submitted by: Dmitry Stefankov
MFC after: 2 weeks
Notes:
svn path=/head/; revision=162831
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on UFS2 inodes are initialised as they are needed, rather than at
newfs time. When quot encountered these inodes it could produce
crazy results.
Now, on UFS2 filesystems, quot's get_inode function will bzero
unallicated inodes before passing them back to a caller. This is
how UFS2 initialises new inodes, so this should work OK.
Also, while I'm here, make quot exit with an error if it finds
inodes of an unknown type. This should help catch future problems
of this type.
Reviewed by: iedowse
MFC after: 1 week
Notes:
svn path=/head/; revision=156015
|
| |
|
|
| |
Notes:
svn path=/head/; revision=144841
|
| |
|
|
| |
Notes:
svn path=/head/; revision=140442
|
| |
|
|
| |
Notes:
svn path=/head/; revision=131500
|
| |
|
|
| |
Notes:
svn path=/head/; revision=114601
|
| |
|
|
|
|
|
|
|
|
| |
on valid superblocks instead of issuing the error "not a BSD filesystem".
fs_sblockloc is a byte offset, not a fragment number. This change makes
quot work properly on UFS2 filesystems, which is important now that UFS2
is the default.
Notes:
svn path=/head/; revision=114009
|
| |
|
|
| |
Notes:
svn path=/head/; revision=113091
|
| |
|
|
|
|
|
| |
Use `Force' in place of `Cause' which sounds better.
Notes:
svn path=/head/; revision=111067
|
| |
|
|
| |
Notes:
svn path=/head/; revision=108458
|
| |
|
|
|
|
|
| |
Approved by: re
Notes:
svn path=/head/; revision=107788
|
| |
|
|
|
|
|
| |
on LP64 hosts
Notes:
svn path=/head/; revision=105883
|