sys: Remove $FreeBSD$: one-line .c patternRemove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
sys: Remove $FreeBSD$: one-line .c comment patternRemove /^/[*/]\s*\$FreeBSD\$.*\n/
sys: Remove $FreeBSD$: two-line .h patternRemove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDThe SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catchup to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDThe SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catchup to that fact and revert to their recommended match of BSD-2-Clause.Discussed with: pfgMFC After: 3 daysSponsored by: Netflix
show more ...
nlm: only access refcounts using dedicated primitivesSponsored by: Rubicon Communications, LLC ("Netgate")
sys/nlm: Use C99 fixed-width integer types.No functional change.Reviewed by: impDifferential Revision: https://reviews.freebsd.org/D33638
nlm: clean up empty lines in .c and .h files
Fix export_args ex_flags field so that is 64bits, the same as mnt_flags.Since mnt_flags was upgraded to 64bits there has been a quirk in"struct export_args", since it hold a copy of mnt_flagsin e
Fix export_args ex_flags field so that is 64bits, the same as mnt_flags.Since mnt_flags was upgraded to 64bits there has been a quirk in"struct export_args", since it hold a copy of mnt_flagsin ex_flags, which is an "int" (32bits).This happens to currently work, since all the flag bits used in ex_flags aredefined in the low order 32bits. However, new export flags cannot be defined.Also, ex_anon is a "struct xucred", which limits it to 16 additional groups.This patch revises "struct export_args" to make ex_flags 64bits and replacesex_anon with ex_uid, ex_ngroups and ex_groups (which points to agroups list, so it can be malloc'd up to NGROUPS in size.This requires that the VFS_CHECKEXP() arguments change, so I also modified thelast "secflavors" argument to be an array pointer, so that thesecflavors could be copied in VFS_CHECKEXP() while the export entry is locked.(Without this patch VFS_CHECKEXP() returns a pointer to the secflavorsarray and then it is used after being unlocked, which is potentiallya problem if the exports entry is changed.In practice this does not occur when mountd is run with "-S",but I think it is worth fixing.)This patch also deleted the vfs_oexport_conv() function, sincedo_mount_update() does the conversion, as required by the old vfs_cmount()calls.Reviewed by: kib, freqlabsRelnotes: yesDifferential Revision: https://reviews.freebsd.org/D25088
Make nfslockd depend on xdr.This is needed after r360036.Reported by: netchildSponsored by: The FreeBSD Foundation
Remove the old NFS lock device driver that uses Giant.This NFS lock device driver was replaced by the kernel NLM around FreeBSD7 andhas not normally been used since then.To use it, the kernel had
Remove the old NFS lock device driver that uses Giant.This NFS lock device driver was replaced by the kernel NLM around FreeBSD7 andhas not normally been used since then.To use it, the kernel had to be built without "options NFSLOCKD" andthe nfslockd.ko had to be deleted as well.Since it uses Giant and is no longer used, this patch removes it.With this device driver removed, there is now a lot of unused codein the userland rpc.lockd. That will be removed on a future commit.Reviewed by: kibDifferential Revision: https://reviews.freebsd.org/D22933
Remove stale FreeBSD_version checks.
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that arestill not MPSAFE (or already are but aren’t properly mark
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that arestill not MPSAFE (or already are but aren’t properly marked).Use it in preparation for a general review of all nodes.This is non-functional change that adds annotations to SYSCTL_NODE andSYSCTL_PROC nodes using one of the soon-to-be-required flags.Mark all obvious cases as MPSAFE. All entries that haven't been markedas MPSAFE before are by default marked as NEEDGIANTApproved by: kib (mentor, blanket)Commented by: kib, gallatin, melifaroDifferential Revision: https://reviews.freebsd.org/D23718
vfs: drop the mostly unused flags argument from VOP_UNLOCKFilesystems which want to use it in limited capacity can employ theVOP_UNLOCK_FLAGS macro.Reviewed by: kib (previous version)Differenti
vfs: drop the mostly unused flags argument from VOP_UNLOCKFilesystems which want to use it in limited capacity can employ theVOP_UNLOCK_FLAGS macro.Reviewed by: kib (previous version)Differential Revision: https://reviews.freebsd.org/D21427
Use syscall_helper_register() to register syscalls and initialize thoughthe module interface.This is the more common approach and the syscall_helper interface iseasier to understand.Reviewed by
Use syscall_helper_register() to register syscalls and initialize thoughthe module interface.This is the more common approach and the syscall_helper interface iseasier to understand.Reviewed by: jhbSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D14251
Do pass removing some write-only variables from the kernel.This reduces noise when kernel is compiled by newer GCC versions,such as one used by external toolchain ports.Reviewed by: kib, andrew(
Do pass removing some write-only variables from the kernel.This reduces noise when kernel is compiled by newer GCC versions,such as one used by external toolchain ports.Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial)Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c)Differential Revision: https://reviews.freebsd.org/D10385
sys: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorpro
sys: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.No functional change intended.
Commit the 64-bit inode project.Extend the ino_t, dev_t, nlink_t types to 64-bit ints. Modifystruct dirent layout to add d_off, increase the size of d_filenoto 64-bits, increase the size of d_na
Commit the 64-bit inode project.Extend the ino_t, dev_t, nlink_t types to 64-bit ints. Modifystruct dirent layout to add d_off, increase the size of d_filenoto 64-bits, increase the size of d_namlen to 16-bits, and changethe required alignment. Increase struct statfs f_mntfromname[] andf_mntonname[] array length MNAMELEN to 1024.ABI breakage is mitigated by providing compatibility using versionedsymbols, ingenious use of the existing padding in structures, andby employing other tricks. Unfortunately, not everything can befixed, especially outside the base system. For instance, third-partyAPIs which pass struct stat around are broken in backward andforward incompatible ways.Kinfo sysctl MIBs ABI is changed in backward-compatible way, butthere is no general mechanism to handle other sysctl MIBS whichreturn structures where the layout has changed. It was consideredthat the breakage is either in the management interfaces, where weusually allow ABI slip, or is not important.Struct xvnode changed layout, no compat shims are provided.For struct xtty, dev_t tty device member was reduced to uint32_t.It was decided that keeping ABI compat in this case is more usefulthan reporting 64-bit dev_t, for the sake of pstat.Update note: strictly follow the instructions in UPDATING. Buildand install the new kernel with COMPAT_FREEBSD11 option enabled,then reboot, and only then install new world.Credits: The 64-bit inode project, also known as ino64, started lifemany years ago as a project by Gleb Kurtsou (gleb). Kirk McKusick(mckusick) then picked up and updated the patch, and acted as aflag-waver. Feedback, suggestions, and discussions were carriedby Ed Maste (emaste), John Baldwin (jhb), Jilles Tjoelker (jilles),and Rick Macklem (rmacklem). Kris Moore (kris) performed an initialports investigation followed by an exp-run by Antoine Brodin (antoine).Essential and all-embracing testing was done by Peter Holm (pho).The heavy lifting of coordinating all these efforts and bringing theproject to completion were done by Konstantin Belousov (kib).Sponsored by: The FreeBSD Foundation (emaste, kib)Differential revision: https://reviews.freebsd.org/D10439
When sleeping waiting for either local or remote advisory lock,interrupt sleeps with the ERESTART on the suspension attempts.Otherwise, single-threading requests are deferred until the locks aregr
When sleeping waiting for either local or remote advisory lock,interrupt sleeps with the ERESTART on the suspension attempts.Otherwise, single-threading requests are deferred until the locks aregranted for NFS files, which causes hangs.When retrying local registration of the remotely-granted adv lock,allow full suspension and check for suspension, for usual reasons.Reported by: markj, phoReviewed by: jillesTested by: phoSponsored by: The FreeBSD FoundationMFC after: 2 weeksApproved by: re (gjb)
Remote and local adv lock servers might de-synchronize (the added commentexplains the plausible scenario), resulting in EDEADLK returned on thelocal registration attempt. Handle this by re-trying
Remote and local adv lock servers might de-synchronize (the added commentexplains the plausible scenario), resulting in EDEADLK returned on thelocal registration attempt. Handle this by re-trying the local op [1].On unmount, local registration abort is indicated as EINTR, abort the nlmcall as well.Reported and tested by: phoSuggested and reviewed by: dfr (previous version, [1])Sponsored by: The FreeBSD FoundationMFC after: 1 weekApproved by: re (delphij)
After the vnode unlock, mount point might be destroyed immediately,dropping the reference on mnt_cred. Prevent this by referencing thetemporal credentials before unlock.Tested by: phoReviewed by
After the vnode unlock, mount point might be destroyed immediately,dropping the reference on mnt_cred. Prevent this by referencing thetemporal credentials before unlock.Tested by: phoReviewed by: dfrSponsored by: The FreeBSD FoundationMFC after: 1 weekApproved by: re (gjb)
Remove slightly used const values that can be replaced with nitems().Suggested by: jhb
Avoid a possible heap overflow in our nlm code by limiting the numberof service to the arbitrary value of 256. Log an appropriate messagethat indicates the hard limit.PR: 208808Submitted by: c
Avoid a possible heap overflow in our nlm code by limiting the numberof service to the arbitrary value of 256. Log an appropriate messagethat indicates the hard limit.PR: 208808Submitted by: [email protected]Reviewed by: dfrObtained from: HardenedBSDMFC after: 2 weeks
Avoid dynamic syscall overhead for statically compiled modules.The kernel tracks syscall users so that modules can safely unregister them.But if the module is not unloadable or was compiled into
Avoid dynamic syscall overhead for statically compiled modules.The kernel tracks syscall users so that modules can safely unregister them.But if the module is not unloadable or was compiled into the kernel, there isno need to do this.Achieve this by adding SY_THR_STATIC_KLD macro which expands to SY_THR_STATICduring kernel build and 0 otherwise.Reviewed by: kib (previous version)MFC after: 2 weeks
Correct a typo in nlm_find_host_by_addr(): the intention of thecode is to give "<unknown>" rather than comparing the bufferagainst it.MFC after: 2 weeks
Intermittent crashes in the NLM (rpc.lockd) code during systemshutdown was reporetd via email. The crashes occurred because theclient side NLM would attempt to use its socket after it had beendest
Intermittent crashes in the NLM (rpc.lockd) code during systemshutdown was reporetd via email. The crashes occurred because theclient side NLM would attempt to use its socket after it had beendestroyed. Looking at the code, it would soclose() once the referencecount on the socket handling structure went to 0. Unfortunately,nlm_host_get_rpc() will simply allocate a new socket handling structurewhen none exists and use the now soclose()d socket. Since there doesn'tseem to be a safe way to determine when the socket is no longer needed,this patch modifies the code so that it never soclose()es the socket.Since there is only one socket ever created, this does not introduce aleak when the rpc.lockd is stopped/restarted. The patch also disablesunloading of the nfslockd module, since it is not safe to do so (andhas never been safe to do so, from what I can see).Reported by: mavTested by: mavMFC after: 2 weeks
123