#
aa90fbed |
| 28-Jan-2025 |
Kirk McKusick <mckusick@FreeBSD.org> |
Standardize the definition of a UFS dinode.
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 nam
Standardize the definition of a UFS dinode.
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
show more ...
|
Revision tags: release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0 |
|
#
752a3404 |
| 03-Feb-2024 |
Ricardo Branco <rbranco@suse.de> |
quot: Use getopt(3) and show usage() if no arguments
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/free
quot: Use getopt(3) and show usage() if no arguments
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
show more ...
|
#
4d65a7c6 |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
usr.sbin: Automated cleanup of cdefs and other formatting
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.
usr.sbin: Automated cleanup of cdefs and other formatting
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
show more ...
|
Revision tags: release/14.0.0 |
|
#
1d386b48 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
Revision tags: release/13.2.0, release/12.4.0 |
|
#
b21582ee |
| 31-Jul-2022 |
Kirk McKusick <mckusick@FreeBSD.org> |
Add a flags parameter to the ffs_sbget() function that reads UFS superblocks.
Rather than trying to shoehorn flags into the requested superblock address, create a separate flags parameter to the ffs
Add a flags parameter to the ffs_sbget() function that reads UFS superblocks.
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
show more ...
|
Revision tags: release/13.1.0, release/12.3.0, release/13.0.0, release/12.2.0 |
|
#
34816cb9 |
| 19-Jun-2020 |
Kirk McKusick <mckusick@FreeBSD.org> |
Move the pointers stored in the superblock into a separate fs_summary_info structure. This change was originally done by the CheriBSD project as they need larger pointers that do not fit in the exist
Move the pointers stored in the superblock into a separate 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
show more ...
|
Revision tags: release/11.4.0, release/12.1.0, release/11.3.0 |
|
#
67350cb5 |
| 09-Dec-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r340918 through r341763.
|
Revision tags: release/12.0.0 |
|
#
fb14e73c |
| 06-Dec-2018 |
Kirk McKusick <mckusick@FreeBSD.org> |
Normally when an attempt is made to mount a UFS/FFS filesystem whose superblock has a check-hash error, an error message noting the superblock check-hash failure is printed and the mount fails. The a
Normally when an attempt is made to mount a UFS/FFS filesystem whose 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
show more ...
|
Revision tags: release/11.2.0 |
|
#
d8ba45e2 |
| 17-Mar-2018 |
Ed Maste <emaste@FreeBSD.org> |
Revert r313780 (UFS_ prefix)
|
#
1e2b9afc |
| 17-Mar-2018 |
Ed Maste <emaste@FreeBSD.org> |
Prefix UFS symbols with UFS_ to reduce namespace pollution
Followup to r313780. Also prefix ext2's and nandfs's versions with EXT2_ and NANDFS_.
Reported by: kib Reviewed by: kib, mckusick Sponsor
Prefix UFS symbols with UFS_ to reduce namespace pollution
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
show more ...
|
#
dffce215 |
| 26-Jan-2018 |
Kirk McKusick <mckusick@FreeBSD.org> |
Refactoring of reading and writing of the UFS/FFS superblock. Specifically reading is done if ffs_sbget() and writing is done in ffs_sbput(). These functions are exported to libufs via the sbget() an
Refactoring of reading and writing of the UFS/FFS superblock. 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
show more ...
|
#
1de7b4b8 |
| 27-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
various: general adoption of SPDX licensing ID tags.
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
various: general adoption of SPDX licensing ID tags.
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.
show more ...
|
Revision tags: release/10.4.0, release/11.1.0 |
|
#
a3906ca5 |
| 17-Feb-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r313644 through r313895.
|
#
1dc349ab |
| 15-Feb-2017 |
Ed Maste <emaste@FreeBSD.org> |
prefix UFS symbols with UFS_ to reduce namespace pollution
Specifically: ROOTINO -> UFS_ROOTINO WINO -> UFS_WINO NXADDR -> UFS_NXADDR NDADDR -> UFS_NDADDR NIADDR -> UFS_NIADDR MAXSYMLINK
prefix UFS symbols with UFS_ to reduce namespace pollution
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
show more ...
|
Revision tags: release/11.0.1, release/11.0.0 |
|
#
6e560add |
| 02-May-2016 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
quot: make use of our rounddown() macro when <sys/param.h> is available.
No functional change.
|
Revision tags: release/10.3.0, release/10.2.0, release/10.1.0, release/9.3.0, release/10.0.0, release/9.2.0 |
|
#
cfe30d02 |
| 19-Jun-2013 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge fresh head.
|
Revision tags: release/8.4.0, release/9.1.0 |
|
#
e477abf7 |
| 27-Nov-2012 |
Alexander Motin <mav@FreeBSD.org> |
MFC @ r241285
|
#
a10c6f55 |
| 11-Nov-2012 |
Neel Natu <neel@FreeBSD.org> |
IFC @ r242684
|
#
23090366 |
| 04-Nov-2012 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Sync from head
|
#
b424efd5 |
| 28-Sep-2012 |
Matthew D Fleming <mdf@FreeBSD.org> |
Fix usr.bin/ and usr.sbin/ build with a 64-bit ino_t.
Original code by: Gleb Kurtsou
|
Revision tags: release/8.3.0_cvs, release/8.3.0, release/9.0.0, release/7.4.0_cvs, release/8.2.0_cvs, release/7.4.0, release/8.2.0 |
|
#
7649cb00 |
| 24-Jan-2011 |
Kirk McKusick <mckusick@FreeBSD.org> |
The dump, fsck_ffs, fsdb, fsirand, newfs, makefs, and quot utilities include sys/time.h instead of time.h. This include is incorrect as per the manpages for the APIs and the POSIX definitions. This c
The dump, fsck_ffs, fsdb, fsirand, newfs, makefs, and quot utilities 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
show more ...
|
Revision tags: release/8.1.0_cvs, release/8.1.0, release/7.3.0_cvs, release/7.3.0, release/8.0.0_cvs, release/8.0.0, release/7.2.0_cvs, release/7.2.0, release/7.1.0_cvs, release/7.1.0, release/6.4.0_cvs, release/6.4.0 |
|
#
b4eca767 |
| 14-Sep-2008 |
Ed Schouten <ed@FreeBSD.org> |
Make `quot -a' work when we've got slashes in the device name.
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 o
Make `quot -a' work when we've got slashes in the device name.
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
show more ...
|
#
8f518424 |
| 02-Jul-2008 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
Drag this code kicking and screaming into the twenty-first century.
|
Revision tags: release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0, release/6.2.0_cvs, release/6.2.0 |
|
#
c433b438 |
| 30-Sep-2006 |
Maxim Konovalov <maxim@FreeBSD.org> |
o Check we have a non-NULL pointer to a super block before dereference it.
PR: misc/103822 Submitted by: Dmitry Stefankov MFC after: 2 weeks
|
Revision tags: release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0 |
|
#
bee3d34f |
| 26-Feb-2006 |
David Malone <dwmalone@FreeBSD.org> |
The quot command expected all inodes contents to be valid, however on UFS2 inodes are initialised as they are needed, rather than at newfs time. When quot encountered these inodes it could produce cr
The quot command expected all inodes contents to be valid, however 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
show more ...
|