aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge ufs_fhtovp() into ffs_inotovp().Konstantin Belousov2021-02-123-30/+17
| | | | | | | | | | The function alone was not used for anything but ffs_fstovp() for long time. Suggested by: mckusick Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* ffs_inotovp(): interface to convert (ino, gen) into alive vnodeKonstantin Belousov2021-02-124-29/+40
| | | | | | | | | | | | It generalizes the VFS_FHTOVP() interface, making it possible to fetch the inode without faking filehandle. Also it adds the ffs flags argument which allows to control ffs_vgetf() call. Requested by: mckusick Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* ffs: Add FFSV_REPLACE_DOOMED flag to ffs_vgetf()Konstantin Belousov2021-02-122-4/+8
| | | | | | | | | | | | It specifies that caller requests a fresh non-doomed vnode. If doomed vnode is found in the hash, it should behave similarly to FFSV_REPLACE. Or, to put it differently, the flag is same as FFSV_REPLACE, but only when the found hashed vnode is doomed. Reviewed by: chs, mkcusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* ffs: call ufsdirhash_dirtrunc() right after setting directory sizeKonstantin Belousov2021-02-123-6/+13
| | | | | | | | | | | Later processing of ffs_truncate() might temporary unlock the directory vnode, causing unsychronized dirhash and inode sizes if update is postponed to UFS_TRUNCATE() callers. Reviewed by: chs, mkcusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* buf SU hooks: track buf_start() calls with B_IOSTARTED flagKonstantin Belousov2021-02-123-7/+27
| | | | | | | | | | | | | | | | | and only call buf_complete() if previously started. Some error paths, like CoW failire, might skip buf_start() and do bufdone(), which itself call buf_complete(). Various SU handle_written_XXX() functions check that io was started and incomplete parts of the buffer data reverted before restoring them. This is a useful invariant that B_IO_STARTED on buffer layer allows to keep instead of changing check and panic into check and return. Reported by: pho Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundations
* ffs_vnops.c: Move opt_*.h includes to the top.Konstantin Belousov2021-02-121-2/+3
| | | | | | | | | | as it is done in other places. Header files might need options defined for correct operation. Reviewed by: chs, mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
* pkg(7): address minor nits (mostly clang-analyze complaints)Kyle Evans2021-02-122-5/+3
| | | | | | | | | | | | | | | | - One (1) spurious whitespace. - One (1) occurrence of "random(3) bad, arc4random(3)" good. - Three (3) writes that will never be seen. The latter two points are complaints from clang-analyze. Switching to arc4random(3) is decidedly a good idea because we weren't doing any kind of PRNG seeding anyways. The discarded assignments are arguably good for future-proofing, but it's better to improve the S/N ratio from clang-analyze. Reviewed by: bapt, manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28525
* pkg(7): add an -r reponame option for bootstrap and addKyle Evans2021-02-124-19/+91
| | | | | | | | | | | | | | | | | This is limited to bootstrap/add because some real pkg(8) commands have -r flags with an incompatible meaning/usage, e.g., pkg-audit. pkg(7) will still commence the search as it has, but it will ignore any repo objects without the given name so that overrides and whatnot still work as expected. The use of it for add is noted in the manpage; notably, that the signature config for that repository will be used over global config if it's specified. i.e., pkg(7) should assume that the given pkg did come from that repository and treat it appropriately. Reviewed by: bapt, manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28524
* yacc: Regen test cases for the previous commitJung-uk Kim2021-02-1188-313/+313
|
* yacc: Use NULL instead of 0 for pointersJung-uk Kim2021-02-114-14/+14
| | | | | Note araujo tried to fix it in r298241 but he only touched generated files for bootstrap. This commit properly fixes the problem.
* lex: Use NULL instead of 0 for pointersJung-uk Kim2021-02-111-1/+1
| | | | | Note araujo tried to fix it in r298241 but he only touched generated files for bootstrap. This commit properly fixes the problem.
* efibootmgr: Check for efi supported after parsing argsWarner Losh2021-02-111-2/+3
| | | | | Move the check for efi variables being supported to after parsing the args. This allows '-h' to produce both as a normal user as well as on all systems.
* Fix blackhole/reject routes.Alexander V. Chernikov2021-02-111-2/+56
| | | | | | | | | | | | | | | | | | | Traditionally *BSD routing stack required to supply some interface data for blackhole/reject routes. This lead to varieties of hacks in routing daemons when inserting such routes. With the recent routeing stack changes, gateway sockaddr without RTF_GATEWAY started to be treated differently, purely as link identifier. This change broke net/bird, which installs blackhole routes with 127.0.0.1 gateway without RTF_GATEWAY flags. Fix this by automatically constructing necessary gateway data at rtsock level if RTF_REJECT/RTF_BLACKHOLE is set. Reported by: Marek Zarychta <zarychtam at plan-b.pwste.edu.pl> Reviewed by: donner MFC after: 1 week
* cam: Properly find the sim in the assertion in xpt_pollwait().John Baldwin2021-02-111-1/+2
| | | | | | | | I had missed merging this fixup into 447b3557a9cc5f00a301be8404339f21a9a0faa8 before pushing it. Pointy hat to: jhb MFC after: 2 weeks
* iscsi: Mark iSCSI CAM sims as non-pollable.John Baldwin2021-02-111-9/+1
| | | | | | | | | | | | | Previously, iscsi_poll() just panicked. This meant if you got a panic on a box when using the iSCSI initiator, the attempt to shutdown would trigger a nested panic and never write out a core. Now, CCB's sent to iSCSI devices (such as the sychronize-cache request in dashutdown()) just fail with a timeout during a panic shutdown. Reviewed by: scottl, mav MFC after: 2 weeks Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D28455
* cam: Don't permit crashdumps on non-pollable devices.John Baldwin2021-02-113-4/+7
| | | | | | | | | | | If a disk's SIM doesn't support polling, then it can't be used to store crashdumps. Leave d_dump NULL in that case so that dumpon(8) fails gracefully rather than having dumps fail at crash time. Reviewed by: scottl, mav, imp MFC after: 2 weeks Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D28454
* cam: Permit non-pollable sims.John Baldwin2021-02-113-1/+15
| | | | | | | | | | | | | | Some CAM sim drivers do not support polling (notably iscsi(4)). Rather than using a no-op poll routine that always times out requests, permit a SIM to set a NULL poll callback. cam_periph_runccb() will fail polled requests non-pollable sims immediately as if they had timed out. Reviewed by: scottl, mav (earlier version) Reviewed by: imp MFC after: 2 weeks Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D28453
* Widen ifnet_detach_sxlock coverageKristof Provost2021-02-113-7/+11
| | | | | | | | | Widen the ifnet_detach_sxlock to cover the entire vnet sysuninit code. This ensures that we can't end up having the vnet_sysuninit free the UDP pcb while the detach code is running and trying to purge the UDP pcb. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28530
* release.sh: fix OSVERSION and UNAME_r overridesGlen Barber2021-02-111-0/+7
| | | | | | | | | Add PBUILD_FLAGS and UNAME_r overrides to extra_chroot_setup() to fix building ports for 14-CURRENT builds on 13.x. MFC after: 3 days MFC with: c511a5ab53ba335dc85f7ac93843872eb5763602 Sponsored by: Rubicon Communications, LLC ("Netgate")
* mlx4, mthca: Silence warnings about no-op alignment operationsMark Johnston2021-02-114-9/+13
| | | | | | | | | | | | | Since commit 8fa6abb6f4f64f ("Expose clang's alignment builtins and use them for roundup2/rounddown2"), clang emits warnings for several alignment operations in these drivers because the operation is a no-op. The compiler is arguably being too strict here, but in the meantime let's silence the warnings by conditionally compiling the alignment operations. Reviewed by: arichardson, hselasky MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28576
* VOP_ADVLOCK(9): fix a typoGuangyuan Yang2021-02-111-2/+2
| | | | | | Submitted by: Ka Ho Ng <khng300@gmail.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28575
* Fix lib/msun/test builds on platforms without 80-bit long doublesDimitry Andric2021-02-111-0/+4
| | | | | | | | | | | After d3338f3355a612cf385632291f46c5777bba8d18, the lib/msun test case 'hypotl_near_underflow' would fail to compile on platforms where long doubles weren't 80 bit, like on x86. Disable this particular test on such platforms for now. PR: 253313 MFC after: 1 week X-MFC-With: d3338f3355a612cf385632291f46c5777bba8d18
* [udp] fix possible mbuf and lock leak in udp_input().Andrey V. Elsukov2021-02-111-5/+8
| | | | | | | | | | | | | | In error case we can leave `inp' locked, also we need to free mbuf chain `m' in the same case. Release the lock and use `badunlocked' label to exit with freed mbuf. Also modify UDP error statistic to match the IPv6 code. Remove redundant INP_RUNLOCK() from the `if (last == NULL)' block, there are no ways to reach this point with locked `inp'. Obtained from: Yandex LLC MFC after: 3 days Sponsored by: Yandex LLC
* [udp6] fix possible panic due to lack of locking.Andrey V. Elsukov2021-02-111-33/+28
| | | | | | | | | | | | | | | | | The lookup for a IPv6 multicast addresses corresponding to the destination address in the datagram is protected by the NET_EPOCH section. Access to each PCB is protected by INP_RLOCK during comparing. But access to socket's so_options field is not protected. And in some cases it is possible, that PCB pointer is still valid, but inp_socket is not. The patch wides lock holding to protect access to inp_socket. It copies locking strategy from IPv4 UDP handling. PR: 232192 Obtained from: Yandex LLC MFC after: 3 days Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D28232
* Merge bmake-20210206Simon J. Gerraty2021-02-11130-2153/+3225
|\ | | | | | | | | | | | | | | | | | | | | Changes of interest o unit-tests: use private TMPDIR to avoid errors from other users o avoid strdup in mkTempFile o always use vfork o job.c: do not create empty shell files in jobs mode reduce unnecessary calls to waitpid o cond.c: fix debug output for comparison operators in conditionals
| * Import bmake-20210206vendor/NetBSD/bmake/20210206Simon J. Gerraty2021-02-11127-2133/+3156
| | | | | | | | | | | | | | | | | | | | | | Changes of interest o unit-tests: use private TMPDIR to avoid errors from other users o avoid strdup in mkTempFile o always use vfork o job.c: do not create empty shell files in jobs mode reduce unnecessary calls to waitpid o cond.c: fix debug output for comparison operators in conditionals
* | kldload(8): Improve phrasingDaniel Ebdrup Jensen2021-02-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Mountroot isn't documented in the extant manual pages - so this phrasing, while less absolute and concise, still conveys which modules are recommended to be handled via loader.conf(5), and it also does a better job of elucidating that the modules can include filesystem drivers. Submitted by: kevans (earlier version) Reported by: imp, kevans, eugen Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D28542
* | usleep(3): replace 'process' with 'calling thread'Konstantin Belousov2021-02-111-5/+5
| | | | | | | | | | | | | | PR: 253395 Reported by: zegang.luo@qq.com MFC after: 3 days Sponsored by: The FreeBSD Foundation
* | release: fix overriding UNAME_rGlen Barber2021-02-111-0/+4
| | | | | | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* | Fix incorrect hypotl(3) result with subnormal numbersDimitry Andric2021-02-103-1/+22
| | | | | | | | | | | | | | | | | | | | | | This adjusts the factor used to scale the subnormal numbers, so it becomes the right value after adjusting its exponent. Thanks to Steve Kargl for finding the most elegant fix. Also enable the hypot tests, and add a test case for this bug. PR: 253313 MFC after: 1 week
* | arm64: if_dwc is also needed by intel stratix10 platformEmmanuel Vadot2021-02-101-2/+3
| | | | | | | | MFC after: 3 days
* | arm64: Add a SOC_BRCM_NS2 optionEmmanuel Vadot2021-02-103-3/+5
| | | | | | | | | | | | | | | | Only compile files needed for this platform if the option is enabled in the kernel config file. Add the option to GENERIC. MFC after: 3 days
* | arm64: Make thunderx vnic file depend on soc_cavm_thunderxEmmanuel Vadot2021-02-101-4/+4
| | | | | | | | MFC after: 3 days
* | arm64: Order sys/conf/files.arm64Emmanuel Vadot2021-02-101-420/+474
| | | | | | | | | | | | | | | | This is now easier to read and see what's compiled-in No functional changes intended. MFC after: 3 days
* | netgraph/ng_bridge: Add counters for the first link, tooLutz Donnerhacke2021-02-101-21/+38
| | | | | | | | | | | | | | | | | | | | | | For broadcast, multicast and unknown unicast, the replication loop sends a copy of the packet to each link, beside the first one. This special path is handled later, but the counters are not updated. Factor out the common send and count actions as a function. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28537
* | systat.1: Fix synopsisMateusz Piotrowski2021-02-101-1/+1
| | | | | | | | | | | | | | systat does not have a "-display" flag. Use Ar to indicate that "display" is meant to be substituted with an actual display command. MFC after: 1 week
* | systat.1: Remove Tn macrosMateusz Piotrowski2021-02-101-41/+14
| | | | | | | | | | | | They are no longer supported by mdoc(7). MFC after: 1 week
* | localedef: Fix bootstrapping on Ubuntu 16.04Jessica Clarke2021-02-101-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Glibc's stdlib.h defines various prototypes for GNU extensions that take a locale_t. Newer versions use locale_t directly and include an internal bits/types/locale_t.h in order to get its definition, but older versions include xlocale.h for that, for which our bootstrap version is empty. Moreover it expects to use the glibc-specific __locale_t type. Thus, provide dummy definitions of both types in order to ensure the prototypes don't give any errors, and guard against the header being inadvertently included between the bootstrapping namespace.h and un-namespace.h, where locale_t is #define'd. This header is not used when bootstrapping on FreeBSD and exists solely to stub out glibc's, so this should have no impact on FreeBSD hosts. Reviewed by: arichardson, emaste (comment only) Differential Revision: https://reviews.freebsd.org/D28317
* | vm: Honour the "noreuse" flag to vm_page_unwire_managed()Mark Johnston2021-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This flag indicates that the page should be enqueued near the head of the inactive queue, skipping the LRU queue. It is used when unwiring pages from the buffer cache following direct I/O or after I/O when POSIX_FADV_NOREUSE or _DONTNEED advice was specified, or when sendfile(SF_NOCACHE) completes. For the direct I/O and sendfile cases we only enqueue the page if we decide not to free it, typically because it's mapped. Pass "noreuse" through to vm_page_release_toq() so that we actually honour the desired LRU policy for these scenarios. Reported by: bdrewery Reviewed by: alc, kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28555
* | Always build the sanitizer runtimes when compiling with clangAlex Richardson2021-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | This allows instrumenting e.g. test binaries even when compiling with an external clang (e.g. CROSS_TOOLCHAIN=llvm11). I have some upcoming patches that allow building the entire base system with ASan/UBSan/etc. instrumentation and this is required in preparation for this. Reviewed By: dim, emaste Differential Revision: https://reviews.freebsd.org/D28532
* | usr.sbin/makefs: fix use-after-free in read_mtree_keywords()Alex Richardson2021-02-101-0/+2
| | | | | | | | | | | | | | | | | | | | The st variable is used as a shortcut for &node->inode->st, but in one branch just before the exit we update node->inode without changing st. Reported by: AddressSanitizer Reviewed By: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28570
* | MFV d60fa10fd872db7e3d8cb1e161cfdae026c43b14:Cy Schubert2021-02-1077-686/+1700
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Update unbound 1.13.0 --> 1.13.1. Includes numerous bugfixes documented at: https://www.nlnetlabs.nl/projects/unbound/download/#unbound-1-13-1 MFC after: 1 month
| * | Vendor import of Unbound 1.13.1.vendor/unbound/1.13.1Cy Schubert2021-02-09106-6963/+9754
| | | | | | | | | | | | | | | Includes numerous bugfixes documented at: https://www.nlnetlabs.nl/projects/unbound/download/#unbound-1-13-1
* | | Fix non-IPv6 build post 57785538c6e0d7e8ca0f161ab95bae10fd304047.Cy Schubert2021-02-101-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 57785538c6e0d7e8ca0f161ab95bae10fd304047 change the test for FreeBSD from __FreeBSD_version to __FreeBSD__. However this test was performed before sys/param.h was included, therefore __FreeBSD_version was never defined. As the test was never true opt_random_ip_id.h was never included. Submitted by: bdragon Reported by: bdragon MFC after: 1 week X-MFC with: 57785538c6e0d7e8ca0f161ab95bae10fd304047
* | | libsysdecode: fix decoding of TCP_NOPUSH and TCP_MD5SIGMichael Tuexen2021-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TCP_FASTOPEN_MIN_COOKIE_LEN was incorrectly registered as a name of a IPPROTO_TCP level socket option, which overwrote TCP_NOPUSH. TCP_FASTOPEN_PSK_LEN was incorrectly registered as a name of an IPPROTO_TCP level socket option, which overwrote TCP_MD5SIG. MFC after: 3 days Sponsored by: Netflix, Inc.
* | | Add test case for 93fc67896550 (incorrect powf(3) result)Dimitry Andric2021-02-091-0/+22
| | | | | | | | | | | | | | | | | | | | | This adds the test case to contrib/netbsd-tests/lib/libm/t_pow.c, as it is currently the only place testing pow(3) and friends. MFC after: 1 week
* | | bsd.compiler.mk: Detect distribution-provided GCC when executed as ccJessica Clarke2021-02-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang always prints "clang $VERSION" regardless of the name used to execute it, whereas GCC prints "$progname $VERSION", meaning if CC is set to cc and cc is GCC it will print "cc $VERSION". We are able to detect some of those cases since it then prints "($PKGVERSION)", where the default is "GCC", but many distributions override that to print their name and the package version number (e.g. "Debian 10.2.1-6"), so nothing tells us it's GCC other than the fact that it's not Clang (and that there's an FSF copyright disclaimer). However, GCC's -v option will always print "gcc version $VERSION", so fall back on using that to detect GCC. Whilst Clang also supports this option, we should never get here, so Clang handling is not added. Reviewed by: brooks, emaste, arichardson Differential Revision: https://reviews.freebsd.org/D28315
* | | Fix lib/msun's ctrig_test/test_inf_inputs test case with clang >= 10Dimitry Andric2021-02-094-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This sprinkles a few strategic volatiles in an attempt to defeat clang's optimization interfering with the expected floating-point exception flags. Reported by: lwhsu PR: 244732 MFC after: 3 days
* | | netgraph/ng_bridge: Document staleness in multithreaded operationLutz Donnerhacke2021-02-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the data path of ng_bridge(4), the only value of the host struct, which needs to be modified, is the staleness, which is reset every time a frame is received. It's save to leave the code as it is. This patch is part of a series to make ng_bridge(4) multithreaded. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28546
* | | netgraph/ng_bridge: Merge internal structuresLutz Donnerhacke2021-02-092-48/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a earlier version of ng_bridge(4) the exernal visible host entry structure was a strict subset of the internal one. So internal view was a direct annotation of the external structure. This strict inheritance was lost many versions ago. There is no need to encapsulate a part of the internal represntation as a separate structure. This patch is a preparation to make the internal structure read only in the data path in order to make ng_bridge(4) multithreaded. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28545