Commit Graph

9549 Commits

Author SHA1 Message Date
Gleb Smirnoff
3f43ada98c Catch up with 6edfd179c8: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG.
Originally IFCAP_NOMAP meant that the mbuf has external storage pointer
that points to unmapped address.  Then, this was extended to array of
such pointers.  Then, such mbufs were augmented with header/trailer.
Basically, extended mbufs are extended, and set of features is subject
to change.  The new name should be generic enough to avoid further
renaming.
2021-01-29 11:46:24 -08:00
Ryan Moeller
65efb73fbd sbin/sysctl: Fix CTLFLAG_SKIP for adjacent nodes
The OID is saved when we encounter CTLFLAG_SKIP so that descendants can
be skipped as well. We then must not update the skip OID until we are
out of the node. This was achieved by resetting the skip OID once the
prefix no longer matches, but the case where the OID we reset on has
CTLFLAG_SKIP was not accounted for.

Reported by:	mav
Reviewed by:	mav
MFC after:	2 days
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D28364
2021-01-27 14:27:46 -05:00
Kirk McKusick
8c22cf9b09 Fix fsck_ffs incorrectly reporting "CANNOT READ BLK: NNNN" errors.
A long-standing bug in Pass 1 of fsck_ffs in which it is reading in
blocks of inodes to check their block pointers. It failed to round
up the size of the read to a disk block size. When disks would
accept 512-byte aligned reads, the bug rarely manifested itself.
But many recent disks will no longer accept 512-byte aligned reads
but require 4096-byte aligned reads, so the failure to properly
round-up read sizes to multiples of 4096 bytes makes the error
much more likely to occur.

Reported by:  Peter Holm and others
Tested by:    Peter Holm and Rozhuk Ivan
MFC after:    3 days
Sponsored by: Netflix
2021-01-26 11:46:38 -08:00
Kristof Provost
dcd1e41f0c pfctl: FreeBSD now supports DIOCGIFSPEED
There's no need for a special case here to work around the lack of
DIOCGIFSPEED. That was introduced in FreeBSD in
c1aedfcbd9.

Reported by:	jmg@
Reviewed by:	donner@
Differential Revision:	https://reviews.freebsd.org/D28305
2021-01-25 19:58:22 +01:00
Alex Richardson
94ac312a71 ifconfig: fix UBSan signed shift error
Use 1u since UBSan complains about 1 << 31.
2021-01-25 15:09:50 +00:00
Kyle Evans
123ae3045d build: remove LIBPTHREAD/LIBTHR build options
WITHOUT_LIBTHR has been broken for a little over five years now, since the
xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building
a useful system without threading support is becoming increasingly more
difficult.

Additionally, in the five plus years that it's been broken more reverse
dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among
others) that make it more and more difficult to reconcile the effort needed
to fix these options.

Remove the broken options.

PR:		252760
Reviewed by:	brooks, emaste, kib
Differential Revision:	https://reviews.freebsd.org/D28263
2021-01-22 12:33:27 -06:00
Allan Jude
b84d0aaa4e ifconfig: add vlanproto "qiniq" as an alias for "802.1ad"
QinQ is better known by this name, so accept it as an alias

Reported-by:	Mike Geiger
Reviewed-by:	melifaro, hselasky, rpokala
MFC-with:	366917
Sponsored-by:	Klara Inc.
Differential-Revision:	https://reviews.freebsd.org/D28245
2021-01-20 15:50:45 +00:00
Rick Macklem
448de00de5 mount_nfs: update man page description for oneopenown
A recent email discussion indicated that a large
accumulation of NFSv4 Opens was occurring on
a mount. This appears to have been caused by a
shared library within the mount being used by
several processes, such that there is always at
least one of these processes running.
A new Open was created by each process and
were not closed, since all the Opens were never
closed. This is alleviated by using the
"oneopenown" mount option.

This man page update attempts to indicate the
use of "oneopenown" for this case.

This is a content change.

Reported by:	j.david.lists@gmail.com
Reviewed by:	0mp
MFC:	1 month
Differential Revision:	https://reviews.freebsd.org/D28215
2021-01-17 19:00:41 -08:00
Alexander V. Chernikov
d28210b2c2 Remove remnants of classful behavior in route(8).
Curently route(8) treats some addresses as network addresses:

 RTA_DST: inet 10.0.0.0; RTA_NETMASK: inet 255.0.0.0; RTA_IFP: link ;
 RTM_GET: Report Metrics: len 240, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,STATIC>
 locks:  inits:
 sockaddrs: <DST,NETMASK,IFP>
   10.0.0.0 255.0.0.0 link#0

Note added `RTA_NETMASK` in the request.

Host address from the same network is ok:

route -nv get 10.0.0.1
 RTA_DST: inet 10.0.0.1
 RTA_IFP: link
 RTM_GET: Report Metrics: len 224, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,HOST,STATIC>
...
   route to: 10.0.0.1
destination: 10.0.0.0
       mask: 255.255.255.0

This change eliminates network auto-guessing part AND reading network from /etc/networks.

Reviewed By: rgrimes

Differential Revision: https://reviews.freebsd.org/D24401
2021-01-16 23:45:30 +00:00
Kyle Evans
6dd869c22b bectl: remove spurious aok variable
This rode in with the OpenZFS import. It may have been necessary at some
point, but it is no longer and it breaks the WITHOUT_DYNAMICROOT build as
it collides with the definition in libspl.

Reported-by:	Michael Dexter
2021-01-16 00:07:50 -06:00
Kyle Evans
de661c9f86 bectl: tests: use -R <mount> instead of specifying altroot
-R is currently shorthand for cachefile=none, altroot=<mount>.  This is
functionally the same, but perhaps more resilient to future changes that
could be necessary that may be added when -R is specified.

MFC after:	 1 week
2021-01-16 00:07:50 -06:00
Charlie Root
292808246d ICMP checksum test: Fix for big endian
The in_cksum tests originally tried to simulate a BE environment by
swapping the byte order of the input.  But that's overcomplicated, and
didn't actually work on real BE hardware.  The correct testing strategy
is just to test on the native endianness, and run the tests in both BE
and LE environments.

Submitted by:		Renato Riolino <renato.riolino@eldorado.org.br>
Reviewed By:		asomers
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D23193
2021-01-11 19:03:46 -07:00
Kristof Provost
0c156a3c32 pfctl: Another set skip <group> fix
When retrieving the list of group members we cannot simply use
ifa_lookup(), because it expects the interface to have an IP (v4 or v6)
address. This means that interfaces with no address are not found.
This presents as interfacing being alternately marked as skip and not
whenever the rules are re-loaded.

Happily we only need to fix ifa_grouplookup(). Teach it to also accept
AF_LINK (i.e. interface) node_hosts.

PR:     	250994
MFC after:	3 days
2021-01-11 22:30:44 +01:00
Dimitry Andric
a82f07fc2e Fix 32-bit build post 6733401935
The general style in sbin/nvmecontrol apppears to print uint64_t types
using %j, so I'm using that instead of the more general (but admittedly
ugly) PRIu64.
2021-01-08 23:38:30 +01:00
Cy Schubert
c6951fac78 Fix 32-bit build post 5cc52631b3. 2021-01-08 11:28:30 -08:00
Chuck Tuffli
6733401935 nvmecontrol: add device self-test op and log page
Add decoding of the Device Self-test log page and the ability to start
or abort a test.

Reviewed by:	imp, mav
Tested by:	Muhammad Ahmad <muhammad.ahmad@seagate.com>
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D27517
2021-01-08 09:27:56 -08:00
Kirk McKusick
5cc52631b3 Rewrite the disk I/O management system in fsck_ffs(8). Other than
making fsck_ffs(8) run faster, there should be no functional change.

The original fsck_ffs(8) had its own disk I/O management system.
When gjournal(8) was added to FreeBSD 7, code was added to fsck_ffs(8)
to do the necessary gjournal rollback. Rather than use the existing
fsck_ffs(8) disk I/O system, it wrote its own from scratch. Similarly
when journalled soft updates were added in FreeBSD 9, code was added
to fsck_ffs(8) to do the necessary journal rollback. And once again,
rather than using either of the existing fsck_ffs(8) disk I/O
systems, it wrote its own from scratch. Lastly the fsdb(8) utility
uses the fsck_ffs(8) disk I/O management system. In preparation for
making the changes necessary to enable snapshots to be taken when
using journalled soft updates, it was necessary to have a single
disk I/O system used by all the various subsystems in fsck_ffs(8).

This commit merges the functionality required by all the different
subsystems into a single disk I/O system that supports all of their
needs. In so doing it picks up optimizations from each of them
with the results that each of the subsystems does fewer reads and
writes than it did with its own customized I/O system. It also
greatly simplifies making changes to fsck_ffs(8) since everything
goes through a single place. For example the ginode() function
fetches an inode from the disk. When inode check hashes were added,
they previously had to be checked in the code implementing inode
fetch in each of the three different disk I/O systems. Now they
need only be checked in ginode().

Tested by:    Peter Holm
Sponsored by: Netflix
2021-01-07 15:03:15 -08:00
Mateusz Piotrowski
74bd207697 Reference newfs_msdos(8) from the newfs(8) manual
PR:		252484
Reported by:	Graham Perrin <grahamperrin@gmail.com>
MFC after:	3 days
2021-01-07 10:24:07 +01:00
Kirk McKusick
c8a7a3ffe1 Fix bug in expanding lost+found direct blocks.
Reported by:  Peter Holm
Sponsored by: Netflix
2021-01-06 16:35:01 -08:00
Robert Wing
b1ea63e2e3 bectl(8): sync man page and help text
Sync man page with behavior of bectl(8).

Sync help text with man page.

PR:             246697
Reported by:	olgeni
Submitted by:   olgeni (with changes)
Reviewed by:    kevans, olgeni
Approved by:    kevans (mentor)
MFC after:      1 week
Differential Revision:	https://reviews.freebsd.org/D27482
2021-01-06 10:38:25 -09:00
Kristof Provost
fda7daf063 pfctl: Stop sharing pf_ruleset.c with the kernel
Now that we've split up the datastructures used by the kernel and
userspace there's essentually no more overlap between the pf_ruleset.c
code used by userspace and kernelspace.

Copy the userspace bits to the pfctl directory and stop using the kernel
file.

Reviewed by:	philip
MFC after:	2 weeks
Sponsored by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D27764
2021-01-05 23:35:37 +01:00
Emmanuel Vadot
2d486ba15f pkgbase: Move bectl to the runtime package
runtime contain what is needed to boot in single user and repair a
system, bectl could be handy to have in this situation.

Differential Revision:	https://reviews.freebsd.org/D27708
2021-01-04 16:17:12 +01:00
Xin LI
fd340a1222 sbin/camcontrol: use calloc/strlcpy where appropriate.
MFC after:	2 weeks
2021-01-03 22:52:28 -08:00
Kirk McKusick
997f81af43 The fsck_ffs program had previously only been able to expand the size
of its lost+found directory by allocating direct block pointers. The
effect was that it was limited to about 19,000 files. One of Peter Holm's
tests produced a filesystem with about 23,000 lost files which meant
that fsck_ffs was unable to recover it. This update allows lost+found
to be expanded into a single indirect block which allows it to store
up to about 6,573,000 lost files.

Reported by:  Peter Holm
Sponsored by: Netflix
2021-01-02 22:31:55 -08:00
Alan Somers
b586c66baf ping: fix ping when the kernel was built without INET6
If the kernel was built without INET6, default to ICMP.  Or, if it was
built without INET, default to ICMPv6.

PR:		251725
Reported by:	jbeich
Reviewed by:	jbeich
Tested by:	jbeich
MFC with:	368045
2021-01-01 10:25:49 -07:00
Kirk McKusick
68dc94c7d3 Correct and add some comments.
Sponsored by: Netflix
2020-12-31 15:36:33 -08:00
Ed Maste
50a40d0911 ldconfig: Retire a.out support
aout support in ldconfig hasn't been required since FreeBSD 2.x.
If someone needs to use FreeBSD 2 shared libraries they will be best
served by using a FreeBSD 2 ldconfig as well.

In aa5e1b42e6 we removed the ldconfig a.out invocation from rc.d but
left the support in ldconfig itself.  Remove it now.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27481
2020-12-31 10:29:08 -05:00
Guangyuan Yang
70a2e109bd dump(8): clarify the recommended use of cache and snapshots
PR:		131626
MFC after:	1 week
Submitted by:	Andrew Hamilton-Wright <andrew@qemg.org>
Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D27775
2020-12-28 21:56:58 +00:00
Gordon Bergling
e5a84dc8a7 dumpon(8): Add missing section arguments
MFC after:	3 days
2020-12-28 16:48:58 +01:00
Gordon Bergling
e13534d54a newfs(8): Fix unusual Xr order
- unusual Xr order: gjournal after gpart

MFC after:	3 days
2020-12-28 16:46:28 +01:00
Xin LI
804b4afb9c sbin/init: Reduce code duplication by using %m for error message
instead of passing %s with return value from strerror().

MFC after:	2 weeks
2020-12-25 17:49:33 -08:00
Xin LI
7e75718295 sbin/routed: Remove unused code for sgi and NetBSD.
MFC after:	2 weeks
2020-12-25 17:42:47 -08:00
Rick Macklem
79302a6304 mount_nfs(8): add a description for the new "tlscertname" option
commit 665b1365fe added a new NFS mount option that is used to set a
non-default X.509 certificate, that can be used for nfs-over-tls NFS
mounts.
This patch adds a description for it to the man page.

Reviewed by:		0mp
Differential Revision:	https://reviews.freebsd.org/D27733
2020-12-24 14:20:06 -08:00
Ryan Moeller
401f82df48 sbin/sysctl: Style fix
Remove parameter names from function prototype to match other
prototypes in the file.

Sponsored by:	iXsystems, Inc.
2020-12-23 12:45:11 -05:00
Ryan Moeller
a5ec1dd453 sbin/sysctl: Always honor skip in sysctl_all
Fix broken CTLFLAG_SKIP when present on the first child of the requested
node.

We don't need to ignore skip for the first node because in sysctl_all()
we've implicitly visited the first node already when oid is specified.
The first call to show_var() in here is after we have iterated to the
next node. When the command line specifically requests a non-node sysctl
we go straight into show_var() without calling sysctl_all().

Reported by:	jhb
Reviewed by:	jhb
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D27674
2020-12-23 12:42:38 -05:00
Gordon Bergling
bae74ca922 ipfw(8): Fix a few mandoc related issues
- no blank before trailing delimiter
- missing section argument: Xr inet_pton
- skipping paragraph macro: Pp before Ss
- unusual Xr order: syslogd after sysrc
- tab in filled text

There were a few multiline NAT examples which used the .Dl macro with
tabs. I converted them to .Bd, which is a more suitable macro for that case.

MFC after:	1 week
2020-12-19 12:47:40 +00:00
Gordon Bergling
ea0dd3ca44 ping(8): Fix a mandoc related issue
- unusual Xr punctuation: none before traceroute6(8)
2020-12-19 11:57:47 +00:00
Gordon Bergling
9bca273d84 nvmecontrol(8): Fix a few mandoc related issues and add a SEE ALSO section
- inserting missing end of block: Ss breaks Bl
- skipping paragraph macro: Pp before Ss
- referenced manual not found: Xr nvme 4 (2 times)
- unknown standard specifier: St The

The macro .St can only be used for standards known by mdoc(7). So add a
SEE ALSO section and add a reference to the NVM Express Base Specification.

MFC after:	2 weeks
2020-12-19 11:47:38 +00:00
Gordon Bergling
226f43e757 devd.conf(5): Fix a mandoc related issue
- sections out of conventional order: Sh SEE ALSO

MFC after:	1 week
2020-12-19 11:03:04 +00:00
Kirk McKusick
7180f1ab40 Rename pass4check() to freeblock() and move from pass4.c to inode.c.
The new name more accurately describes what it does and the file move
puts it with other similar functions. Done in preparation for future
cleanups. No functional differences intended.

Sponsored by: Netflix
Historic Footnote: my last FreeBSD svn commit
2020-12-18 23:28:27 +00:00
Robert Wing
f200cc255f geom(8): list geoms with /dev/ prefix
Allow geom(8) to list geoms with the '/dev/' prefix.

`geom part show` accepts the '/dev/' prefix but `geom part list` does not.

Modify find_geom() in sbin/geom/core/geom.c to be consistent with the behavior
of find_geom() in lib/geom/part/geom_part.c.

PR:             188213
Reported by:    Ronald F. Guilmette <rfg@tristatelogic.com>
Reviewed by:    imp, kevans
Approved by:    kevans (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D27556
2020-12-12 07:22:38 +00:00
Ryan Libby
61261ef589 savecore: bail on write error even when decompressing
Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D27560
2020-12-11 22:52:12 +00:00
Eric van Gyzen
4617b1f62b decryptcore: preload OpenSSL error strings; seed PRNG
As in r360226, preload OpenSSL error strings and seed the PRNG
before entering capability mode.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2020-12-11 14:32:42 +00:00
Hans Petter Selasky
21f5dc86d3 Fix bug in ifconfig preventing proper VLAN creation.
Detection of interface type by filter must happen before detection of
interface type by prefix. Else the following sequence of commands will
try to create a LAGG interface instead of a VLAN interface, which
accidentially worked previously, because the date pointed to by the
ifr_data pointer was not parsed by VLAN create ioctl(2). This is a
regression after r368229, because the VLAN creation now parses the
ifr_data field.

How to reproduce:
# ifconfig lagg0 create
# ifconfig lagg0.256 create

Differential Revision:	https://reviews.freebsd.org/D27521
Reviewed by:		kib@ and kevans@
Reported by:		raul.munoz@custos.es
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-12-09 20:13:12 +00:00
Kyle Evans
b8f71f9750 bectl: simplify the tail end of the jail cmd
This has already confused me once (and I'm pretty sure I wrote it), so let's
clarify: unjailing after the command has completed will only happen if we're
interactive and -U has not been specified.

This just folds two conditionals together to make it obvious how -b/-U
interact with each other.

MFC after:	3 days
2020-12-06 15:58:50 +00:00
Gordon Bergling
4ddfc27e14 ping(8): Fix a few mandoc related issues
- new sentence, new line
2020-12-04 20:47:56 +00:00
Gleb Smirnoff
3921dc1304 Fix r368197: suppress error printing for the "check" command.
Reviewed by:	kevans
2020-12-02 21:53:28 +00:00
Rick Macklem
00c8b28c1a Improve man page for AmazonEFS mounts.
PR#250770 was actually just a misunderstanding of what
NFS mount options are needed for AmazonEFS mounts.
This patch attempts to clarify the manpage to clarify this.

This is a content change.

PR:		250770
Reviewed by:	bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27430
2020-12-01 23:33:10 +00:00
John-Mark Gurney
4102e8385f add documentation that the rules need to be reloaded, and how to do it...
MFC after:	1 week
2020-12-01 23:25:21 +00:00
Gleb Smirnoff
4c91d6bc44 Print at least something when failing. 2020-11-30 21:05:31 +00:00