#
26c3d72e |
| 13-Jan-2024 |
HUANG,YU-JIA <s112062566@m112.nthu.edu.tw> |
growfs(8): Fix spelling
Event: Advanced UNIX Programming Course (Fall’23) at NTHU. Pull Request: https://github.com/freebsd/freebsd-src/pull/1055
|
#
0b8224d1 |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals.
Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require).
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
70a0fb43 |
| 05-Oct-2023 |
Mina Galić <freebsd@igalic.co> |
growfs: make exit codes more consistent
We have overused err(1), so it's hard to distinguish when an error is very, very serious, and when it's just a user-error, or even harmless.
This patch chang
growfs: make exit codes more consistent
We have overused err(1), so it's hard to distinguish when an error is very, very serious, and when it's just a user-error, or even harmless.
This patch changes the current behaviour to distinguish between the following three:
1 for usage errors 2 for recoverable errors 3 or higher for unrecoverable errors
Reviewed by: jilles, pauamma_gundo.com, des Differential Revision: https://reviews.freebsd.org/D27161
show more ...
|
#
1d386b48 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
0a6e34e9 |
| 15-May-2023 |
Kirk McKusick <mckusick@FreeBSD.org> |
Fix size differences between architectures of the UFS/FFS CGSIZE macro value.
The cylinder group header structure ended with `u_int8_t cg_space[1]' representing the beginning of the inode bitmap arr
Fix size differences between architectures of the UFS/FFS CGSIZE macro value.
The cylinder group header structure ended with `u_int8_t cg_space[1]' representing the beginning of the inode bitmap array. Some architectures like the i386 rounded this up to a 4-byte boundry while other architectures like the amd64 rounded it up to an 8-byte boundry. Thus sizeof(struct cg) was four bytes bigger on an amd64 machine than on an i386 machine. If a filesystem created on an i386 machine was moved to an amd64 machine, the size of the cylinder group calculated by the CGSIZE macro would appear to grow by four bytes. Filesystems whose cylinder groups were exactly equal to the block size on an i386 machine would appear to have a cylinder group that was four bytes too big when moved to an amd64 machine. Note that although the structure appears to be too big, it in fact is fine. It is just the calaculation of its size that is in error.
The fix is to remove the cg_space element from the cylinder-group structure so that the calculated size of the structure is the same size on all architectures.
Reported by: Tijl Coosemans Tested by: Tijl Coosemans and Peter Holm MFC after: 1 week Sponsored by: The FreeBSD Foundation
show more ...
|
Revision tags: release/13.2.0 |
|
#
906c312b |
| 15-Jan-2023 |
Kirk McKusick <mckusick@FreeBSD.org> |
Document the mntopts(3) functions.
The mntopts(3) functions support operations associated with a mount point. The main purpose of this commit is to document the mntopts(3) functions that now appear
Document the mntopts(3) functions.
The mntopts(3) functions support operations associated with a mount point. The main purpose of this commit is to document the mntopts(3) functions that now appear in 18 utilities in the base system. See mntopts(3) for the documentation details.
The getmntopts() function appeared in 4.4BSD. The build_iovec(), build_iovec_argf(), free_iovec(), checkpath(), and rmslashes() functions were added with nmount(8) in FreeBSD 5.0. The getmntpoint() and chkdoreload() functions are being added in this commit.
These functions should be in a library but for historic reasons are in a file in the sources for the mount(8) program. Thus, to access them the following lines need to be added to the Makefile of the program wanting to use them:
SRCS+= getmntopts.c MOUNT= ${SRCTOP}/sbin/mount CFLAGS+= -I${MOUNT} .PATH: ${MOUNT}
Once these changes have been MFC'ed to 13 they may be made into a library.
Reviewed by: kib, gbe MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37907
show more ...
|
Revision tags: 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 ...
|
#
2049cc32 |
| 28-Jun-2022 |
Kirk McKusick <mckusick@FreeBSD.org> |
Correctly update fs_dsize in growfs(8)
When growing a UFS/FFS filesystem, the size of the summary information may expand into additional blocks. These blocks must be removed from fs_dsize which reco
Correctly update fs_dsize in growfs(8)
When growing a UFS/FFS filesystem, the size of the summary information may expand into additional blocks. These blocks must be removed from fs_dsize which records the number of blocks in the filesystem that can be used to hold filesystem data.
While here also update the fs_old_dsize and fs_old_size fields for compatibility with kernels that were compiled before the addition of UFS2.
Reported by: Edward Tomasz Napiera MFC after: 1 week
show more ...
|
#
78dfcf25 |
| 28-Jun-2022 |
Kirk McKusick <mckusick@FreeBSD.org> |
Eliminate set but not used variable.
No functional change intended.
|
Revision tags: release/13.1.0, release/12.3.0 |
|
#
3f9acedb |
| 15-Nov-2021 |
Ed Maste <emaste@FreeBSD.org> |
growfs: do not error if filesystem is already requested size
For some cloud/virtualization use cases it can be convenient to grow the filesystem on boot any time the disk/partition happens to be lar
growfs: do not error if filesystem is already requested size
For some cloud/virtualization use cases it can be convenient to grow the filesystem on boot any time the disk/partition happens to be larger, but not fail if it remains the same size.
Continue to emit a message if we have no action to take, but exit with status 0 if the size remains the same.
Reviewed by: trasz MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32856
show more ...
|
Revision tags: release/13.0.0 |
|
#
0dcde5cc |
| 02-Mar-2021 |
Ed Maste <emaste@FreeBSD.org> |
growfs: allow operation on RW-mounted filesystems
growfs supports growing mounted filesystems (writes are temporarily suspended while the grow happens). Drop the check for fs_clean == 0 to restore
growfs: allow operation on RW-mounted filesystems
growfs supports growing mounted filesystems (writes are temporarily suspended while the grow happens). Drop the check for fs_clean == 0 to restore this case. Leave fs_flags check for FS_UNCLEAN or FS_NEEDSFSCK which represent the state of the filesystem when it was mounted, and fsck should be run first if they are set.
PR: 253754 Reviewed by: mckusick MFC after: 3 days Fixes: 6eb925f8450f ("Filesystem utilities that modify the...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29021
show more ...
|
#
6eb925f8 |
| 25-Oct-2020 |
Kirk McKusick <mckusick@FreeBSD.org> |
Filesystem utilities that modify the filesystem (growfs(8), tunefs(8), and fsirand(8)) should check the filesystem status and require that fsck(8) be run if it is unclean. This requirement is not imp
Filesystem utilities that modify the filesystem (growfs(8), tunefs(8), and fsirand(8)) should check the filesystem status and require that fsck(8) be run if it is unclean. This requirement is not imposed on fsdb(8) or clri(8) since they may be used to clean up a filesystem.
MFC after: 2 weeks Sponsored by: Netflix
show more ...
|
Revision tags: release/12.2.0 |
|
#
54fab0fb |
| 22-Sep-2020 |
Kirk McKusick <mckusick@FreeBSD.org> |
Add missing cylinder group check-hash updates when doing large expansions of filesystems.
Reported by: Colin Percival (cperciva@) Tested by: Colin Percival (cperciva@) MFC after: 3 days Spons
Add missing cylinder group check-hash updates when doing large expansions of filesystems.
Reported by: Colin Percival (cperciva@) Tested by: Colin Percival (cperciva@) MFC after: 3 days 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 ...
|
#
6149ed01 |
| 14-Nov-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r340368 through r340426.
|
#
9fc5d538 |
| 13-Nov-2018 |
Kirk McKusick <mckusick@FreeBSD.org> |
In preparation for adding inode check-hashes, clean up and document the libufs interface for fetching and storing inodes. The undocumented getino / putino interface has been replaced with a new getin
In preparation for adding inode check-hashes, clean up and document the libufs interface for fetching and storing inodes. The undocumented getino / putino interface has been replaced with a new getinode / putinode interface.
Convert the utilities that had been using the undocumented interface to use the new documented interface.
No functional change (as for now the libufs library does not do inode check-hashes).
Reviewed by: kib Tested by: Peter Holm Sponsored by: Netflix
show more ...
|
Revision tags: release/11.2.0 |
|
#
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 ...
|
#
937d37fc |
| 19-Nov-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r325842 through r325998.
|
#
df57947f |
| 18-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
spdx: initial adoption of licensing ID tags.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensou
spdx: initial adoption of licensing ID tags.
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.
Initially, only tag files that use BSD 4-Clause "Original" license.
RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133
show more ...
|
#
c2c014f2 |
| 07-Nov-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r323559 through r325504.
|
#
0a8f81bc |
| 22-Oct-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r324837
While here, diff reduce some of the changes in sys/boot by moving MK_COVERAGE=no to sys/boot/Makefile.inc .
|
#
4887fa36 |
| 10-Oct-2017 |
Ed Maste <emaste@FreeBSD.org> |
growfs: ANSIfy cgckhash()
The build was broken on GCC-using architectures with:
growfs.c: In function 'cgckhash': growfs.c:1753: warning: old-style function definition
Sponsored by: The FreeBSD Fo
growfs: ANSIfy cgckhash()
The build was broken on GCC-using architectures with:
growfs.c: In function 'cgckhash': growfs.c:1753: warning: old-style function definition
Sponsored by: The FreeBSD Foundation
show more ...
|
#
3abf5d76 |
| 10-Oct-2017 |
Kirk McKusick <mckusick@FreeBSD.org> |
Growfs got missed in r323923 that added a check hash to cylinder groups. This makes the needed changes to add/update cylinder group check hashes when a filesystem is expanded.
Reported by: kib and W
Growfs got missed in r323923 that added a check hash to cylinder groups. This makes the needed changes to add/update cylinder group check hashes when a filesystem is expanded.
Reported by: kib and Warner Losh (imp) Reviewed by: kib Tested by: Peter Holm (pho)
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.
|