Commit Graph

266334 Commits

Author SHA1 Message Date
наб
0854d4c186 libzutil: add zfs_{base,dir}name()
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12105
2021-06-11 09:10:05 -07:00
наб
3aa81a6635 linux/libzutil: use ARRAY_SIZE instead of constant for search paths
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12105
2021-06-11 09:10:00 -07:00
Mariusz Zaborski
89d5cbb822 libnv: optimize nvlist size calculation
If we had a multiple nvlist, during nvlist_pack, we calculated the size
of every nvlist separately. For example, if we had a nvlist with three
nodes each containing another (A contains B, and B contains C), we first
calculated the size of nvlist A (which contains B, C), then we calculate
the size of B (which contains C, notice that we already did the
calculation of B, when we calculate A), and finally C. This means that
this calculation was O(N!). This was done because each time we pack
nvlist, we have to put its size in the header
(the separate header for A, B, and C).

To not break the ABI and to reduce the complexity of nvlist_size,
instead of calculating the nvlist size when requested,
we track the size of each nvlist.

Reported by:	pjd, kp
Tested by:	kp
2021-06-11 17:51:29 +02:00
Rich Ercolani
1a345d645a
Added uncompress requirement
Having an old enough version of "file" and no "uncompress" program
installed can cause rpmbuild as root to crash and mangle rpmdb.

So let's add a build dependency for RPM-based systems.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes: #12071
Closes: #12168
2021-06-11 09:38:23 -06:00
Randall Stewart
ba1b3e48f5 tcp: Missing mfree in rack and bbr
Recently (Nov) we added logic that protects against a peer negotiating a timestamp, and
then not including a timestamp. This involved in the input path doing a goto done_with_input
label. Now I suspect the code was cribbed from one in Rack that has to do with the SYN.
This had a bug, i.e. it should have a m_freem(m) before going to the label (bbr had this
missing m_freem() but rack did not). This then caused the missing m_freem to show
up in both BBR and Rack. Also looking at the code referencing m->m_pkthdr.lro_nsegs
later (after processing) is not a good idea, even though its only for logging. Best to
copy that off before any frees can take place.

Reviewed by: mtuexen
Sponsored by: Netflix Inc
Differential Revision:	https://reviews.freebsd.org/D30727
2021-06-11 11:38:08 -04:00
Brian Behlendorf
9d639d8799
ZTS: Add zfs_clone_livelist_dedup.ksh to Makefile.am
Commit 86b5f4c12 added a new zfs_clone_livelist_dedup.ksh test case
but didn't include it in the Makefile.am.  This results in the test
not being included in the dist tarball so it's never run by the CI.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #12224
2021-06-11 09:21:36 -06:00
Hans Petter Selasky
6847ea5019 Improve handling of USB device re-open in the LibUSB v1.x API.
Make sure the "device_is_gone" flag is cleared after every successful open,
so that the "device_is_gone" flag doesn't persist forever.

Found by:	sergii.dmytruk@3mdeb.com
PR:		256296
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-06-11 17:06:44 +02:00
Michael Tuexen
fa3746be42 tcp: fix two bugs in new reno
* Completely initialise the CC module specific data
* Use beta_ecn in case of an ECN event whenever ABE is enabled
  or it is requested by the stack.

Reviewed by:		rscheff, rrs
MFC after:		3 days
Sponsored by:		Netflix, Inc.
2021-06-11 15:40:34 +02:00
Hans Petter Selasky
a7cf31da5a Add new USB ID to u3g(4).
Submitted by:	pierre-jean.gineste@nuabee.fr
PR:		231909
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-06-11 13:05:58 +02:00
Michael Tuexen
224cf7b35b tcp: fix compilation of IPv4-only builds
PR:			256538
Reported by:		iron.udjin@gmail.com
MFC after:		3 days
Sponsored by:		Netflix, Inc.
2021-06-11 09:50:46 +02:00
Warner Losh
7aa2e90176 spl: Fix gcc6 build
-Wno-error= is only a clang flag, restrict its use to only clang.

Sponsored by:		Netflix
2021-06-10 21:28:52 -06:00
Warner Losh
07d72396f8 tools: Remove obsolete svn information.
Reviewed by:		jhb@
Differential Revision:	https://reviews.freebsd.org/D30720
Sponsored by:		Netflix
2021-06-10 19:02:22 -06:00
Brad Davis
ab6d05336c tests/sys/netpfil: Move common tests out from behind MK_PF.
Approved by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-06-10 17:56:01 -06:00
Martin Matuska
47ddbfae27 zfs: unbreak build with clang 12
Change -Wno-error-atomic-alignment to -Wno-error=atomic-alignment
in the Makefile of libspl.

Reported by:	Ed Maste <emaste@FreeBSD.org>
Fix by:		Alexander Richardson <arichardson@FreeBSD.org>
2021-06-11 01:34:46 +02:00
Lutz Donnerhacke
294799c6b0 libalias: tidy up housekeeping
Replace current expensive, but sparsly called housekeeping
by a single, repetive action.

This is part of a larger restructure of libalias in order to switch to
more efficient data structures.  The whole restructure process is
split into 15 reviews to ease reviewing.  All those steps will be
squashed into a single commit for MFC in order to hide the
intermediate states from production systems.

Reviewed by:	hselasky
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30277
2021-06-10 23:30:10 +02:00
Alexander Motin
ffdf019cb3
Re-embed multilist_t storage
This commit partially reverts changes to multilists in PR 7968
(multi-threaded spa-sync()) and adds some cache line alignments to
separate read-only multilists and heavily modified refcount's to different
cache lines.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-by: iXsystems, Inc.
Closes #12158
2021-06-10 10:42:31 -06:00
наб
eec5ba113e
dracut: 90zfs: respect zfs_force=1 on systemd systems
On systemd systems provide an environment generator in order
to respect the zfs_force=1 kernel command line option.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11403
Closes #12195
2021-06-10 09:26:37 -07:00
Alexander Motin
371f88d96f
Remove pool io kstats (#12212)
This mostly reverts "3537 want pool io kstats" commit of 8 years ago.

From one side this code using pool-wide locks became pretty bad for
performance, creating significant lock contention in I/O pipeline.
From another, there are more efficient ways now to obtain detailed
statistics, while this statistics is illumos-specific and much less
usable on Linux and FreeBSD, reported only via procfs/sysctls.

This commit does not remove KSTAT_TYPE_IO implementation, that may
be removed later together with already unused KSTAT_TYPE_INTR and
KSTAT_TYPE_TIMER.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12212
2021-06-10 08:27:33 -07:00
Neel Chauhan
b47f461c8e linuxkpi: Add list_for_each_entry_lockless() macro
This is needed by the drm-kmod 5.7 update.

Approved by:		hselasky (src)
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D30708
2021-06-10 08:15:29 -07:00
Fernando Apesteguía
cedaad9317 mmc(4), mmcsc(4): Remove missing Xref
There is no evidence of at91_mci in the code whatsoever. Most of the at91
drivers where removed in 802baf0ba6

PR: 218970
Reported by: reezer@reezer.org

Approved by: imp@
Differential Revision: https://reviews.freebsd.org/D29193
2021-06-10 15:15:54 +02:00
Fernando Apesteguía
49ddfdec19 ports(7): Add install-missing-packages to target list
It is already used in the EXAMPLES section.

Approved by:	bcr@ (manpages)
Differential Revision: https://reviews.freebsd.org/D30044
2021-06-10 14:58:24 +02:00
Randall Stewart
67e892819b tcp: Mbuf leak while holding a socket buffer lock.
When running at NF the current Rack and BBR changes with the recent
commits from Richard that cause the socket buffer lock to be held over
the ip_output() call and then finally culminating in a call to tcp_handle_wakeup()
we get a lot of leaked mbufs. I don't think that this leak is actually caused
by holding the lock or what Richard has done, but is exposing some other
bug that has probably been lying dormant for a long time. I will continue to
look (using his changes) at what is going on to try to root cause out the issue.

In the meantime I can't leave the leaks out for everyone else. So this commit
will revert all of Richards changes and move both Rack and BBR back to just
doing the old sorwakeup_locked() calls after messing with the so_rcv buffer.

We may want to look at adding back in Richards changes after I have pinpointed
the root cause of the mbuf leak and fixed it.

Reviewed by: mtuexen,rscheff
Sponsored by: Netflix Inc
Differential Revision:	https://reviews.freebsd.org/D30704
2021-06-10 08:33:57 -04:00
Kristof Provost
ea21980a3f pf: use M_WAITOK where possible
In the ioctl path use M_WAITOK allocations whereever possible. These are
less sensitive to memory pressure, and ioctl requests have no hard
deadlines.

Reviewed by:	donner
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30702
2021-06-10 12:20:10 +02:00
Dmitry Chagin
89f15b79b1 linux(4): Regen for ppoll_time64 system call.
MFC after:	2 weeks
2021-06-10 15:19:12 +03:00
Dmitry Chagin
ed61e0ce1d linux(4): Implement ppoll_time64 system call.
MFC after:	2 weeks
2021-06-10 15:18:46 +03:00
Dmitry Chagin
e884512ad1 Split kern_poll() on two counterparts.
The kern_poll_kfds() operates on clear kernel data, kfds points to an
array in the kernel, while kern_poll() operates on user supplied pollfd.
Move nfds check to kern_poll_maxfds().

No functional changes, it's for future use in the Linux emulation layer.

Reviewd by:		kib
Differential Revision:	https://reviews.freebsd.org/D30690
MFC after:		2 weeks
2021-06-10 15:11:25 +03:00
Dmitry Chagin
981a60f112 linux(4): Regen for pselect6_time64 system call.
MFC after:	2 weeks
2021-06-10 15:04:37 +03:00
Dmitry Chagin
f6d075ecd7 linux(4): Implement pselect6_time64 system call.
MFC after:	2 weeks
2021-06-10 15:03:30 +03:00
Dmitry Chagin
c002529000 linux(4): Regen for rt_sigtimedwait_time64 system call.
MFC after:	2 weeks
2021-06-10 14:52:43 +03:00
Dmitry Chagin
db4a1f331b linux(4): Implement rt_sigtimedwait_time64 system call.
It still does not work as intended, awaits D30675.

MFC after:	2 weeks
2021-06-10 14:51:30 +03:00
Dmitry Chagin
985978806e linux(4): Regen for futex_time64 system call.
MFC after:	2 weeks
2021-06-10 14:28:25 +03:00
Dmitry Chagin
2e46d0c3d9 linux(4): Implement futex_time64 system call.
MFC after:	2 weeks
2021-06-10 14:27:06 +03:00
Dmitry Chagin
25b09d6f39 linux(4): Prevent integer overflow in futex_requeue.
To prevent a signed integer overflow in futex_requeue add a sanity check
to catch negative values of nrwake or nrrequeue.

MFC after:	2 weeks
2021-06-10 14:23:11 +03:00
Dmitry Chagin
ee64d98204 linux(4): Regen for futex system call.
MFC after:	2 weeks
2021-06-10 14:16:40 +03:00
Dmitry Chagin
3c1de151e3 linux(4): Change Linux futex syscall definition to match Linux actual one.
MFC after:	2 weeks
2021-06-10 14:00:00 +03:00
Mariusz Zaborski
aa310ebfba libcasper: fix descriptors numbers
Casper services expect that the first 3 descriptors (stdin/stdout/stderr)
will point to /dev/null. Which Casper will ensure later. The Casper
services are forked from the original process. If the initial process
closes one of those descriptors, Casper may reuse one of them for it on
purpose. If this is the case, then renumarate the descriptors used by
Casper to higher numbers. This is done already after the fork, so it
doesn't break the parent process.

PR:		225343
Reported by:	Borja Marcos <borjam (at) sarenet.es>
Tested by:	jkim@
2021-06-10 12:41:29 +02:00
Peter Holm
4ab5c88da2 stress2: Exclude new syzkaller tests 2021-06-10 04:30:12 +02:00
Warner Losh
36435ca5d3 insetad -> instead 2021-06-09 20:17:22 -06:00
Rich Ercolani
860051f1d1
Added error for writing to /dev/ on Linux
Starting in Linux 5.10, trying to write to /dev/{null,zero} errors out.
Prefer to inform people when this happens rather than hoping they guess
what's wrong.

Reviewed-by: Antonio Russo <aerusso@aerusso.net>
Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes:  #11991
2021-06-09 18:57:57 -06:00
Warner Losh
f4d987cd13 mk: WITH_FOO=no now generates a warning
Many people are used to gnu configure's behavior of changing
--with-foo=no to --without-foo. At the same time, several folks have
WITH_FOO=no in their config files to enable this ironic form of the
option because of an old meme from IRC, a mailing list or the forums (I
forget which). Add a warning to allow to alert people w/o breaking POLA.

Reviewed by:		allanjude, bdrewery, manu
MFC After:		2 weeks
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D30684
2021-06-09 18:10:52 -06:00
наб
327c904615 lib{efi,avl,share,tpool,zfs_core,zfsbootenv,zutil}: -fvisibility=hidden
No symbols affected in libavl
No symbols affected by libtpool, but pre-ANSI declarations got purged
No symbols affected by libzfs_core
No symbols affected by libzfs_bootenv

libefi got cleaned, gained efi_debug documentation in efi_partition.h,
and removes one undocumented and unused symbol from libzfs_core:
  D default_vtoc_map

libnvpair saw removal of these symbols:
  D nv_alloc_nosleep_def
  D nv_alloc_sleep
  D nv_alloc_sleep_def
  D nv_fixed_ops_def
  D nvlist_hashtable_init_size
  D nvpair_max_recursion

libshare saw removal of these symbols from libzfs:
  T libshare_nfs_init
  T libshare_smb_init
  T register_fstype
  B smb_shares

libzutil saw removal of these internal symbols from libzfs_core:
  T label_paths
  T slice_cache_compare
  T zpool_find_import_blkid
  T zpool_open_func
  T zutil_alloc
  T zutil_strdup

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12191
2021-06-09 17:04:32 -07:00
наб
d406a695c6 libefi: remove efi_auto_sense()
It's present (but undocumented) in the illumos gate and used exclusively
by rmformat(1) (which I recommend as a nice blast from the past),
and also the math assumes 512B sectors and is therefore wrong

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12191
2021-06-09 17:03:42 -07:00
Greg V
597cc550e7 LinuxKPI: add fault_flag_allow_retry_first
Used by drm 5.7.

Reviewed by:	bz, hselasky, nc
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30673
2021-06-09 19:11:41 -04:00
Neel Chauhan
8a1a42b2a7 linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock()
In Linux, these are macros to locks in the kernel for scheduling purposes.
But as with other macros in this header, we aren't doing anything with them
so we are doing `do {} while (0)` for now.

This is needed by the drm-kmod 5.7 update.

Approved by:		hselasky (src)
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D30710
2021-06-09 14:41:44 -07:00
Neel Chauhan
fee0d486ef linuxkpi: Add _RET_IP_ macro in kernel.h
This is needed by the drm-kmod 5.7 update.

Approved by:		hselasky (src)
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D30707
2021-06-09 14:41:44 -07:00
наб
4b7ed6a286 zgenhostid.8: revisit
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12212
2021-06-09 14:36:03 -07:00
наб
1b37cc1abe Consistentify miscellaneous style on remaining manpages
Most notably this fixes the vdev_id(8) non-.Xrs in vdev_id.conf.5

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12212
2021-06-09 14:35:53 -07:00
Michael Gmelin
278e370066 freebsd-tips: Add fortune on kern.tty_info_kstacks
Add fortune explaining how to use `sysctl kern.tty_info_kstacks' to
alter the output of ^T (tty info).

Reviewed by: ceri
Differential Revision: https://reviews.freebsd.org/D30388
2021-06-09 23:35:38 +02:00
наб
2badb3457a Move properties, parameters, events, and concepts around manual sections
The pages moved as follows:
  zpool-features.{5 => 7}
  spl{-module-parameters.5 => .4}
  zfs{-module-parameters.5 => .4}
  zfs-events.5 => into zpool-events.8
  zfsconcepts.{8 => 7}
  zfsprops.{8 => 7}
  zpoolconcepts.{8 => 7}
  zpoolprops.{8 => 7}

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Co-authored-by: Daniel Ebdrup Jensen <debdrup@FreeBSD.org>
Closes #12149
Closes #12212
2021-06-09 14:35:30 -07:00
наб
b0f3e8a6eb man: use one Makefile, use OpenZFS for .Os
The prevailing style is to use either nothing, or the originating
organisational umbrella (here: OpenZFS), and these aren't Linux manpages

This also deduplicates the substitution code, and makes adding/removing
sexions simpler in future

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12212
2021-06-09 14:34:47 -07:00