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
show more ...
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
Remove the support for using non-mpsafe filesystem modules.In particular, do not lock Giant conditionally when calling into thefilesystem module, remove the VFS_LOCK_GIANT() and relatedmacros. St
Remove the support for using non-mpsafe filesystem modules.In particular, do not lock Giant conditionally when calling into thefilesystem module, remove the VFS_LOCK_GIANT() and relatedmacros. Stop handling buffers belonging to non-mpsafe filesystems.The VFS_VERSION is bumped to indicate the interface change which doesnot result in the interface signatures changes.Conducted and reviewed by: attilioTested by: pho
Fix grammar.Submitted by: jhMFC after: 1 week
Add a sysctl kern.pid_max, which limits the maximum pid the system isallowed to allocate, and corresponding tunable with the samename. Note that existing processes with higher pids are left intact.
Add a sysctl kern.pid_max, which limits the maximum pid the system isallowed to allocate, and corresponding tunable with the samename. Note that existing processes with higher pids are left intact.MFC after: 1 week
jwd@ reported a problem via email to freebsd-fs@ on Aug 25, 2011under the subject "F_RDLCK lock to FreeBSD NFS fails to R/O target file".This occurred because the server side NLM always checked for
jwd@ reported a problem via email to freebsd-fs@ on Aug 25, 2011under the subject "F_RDLCK lock to FreeBSD NFS fails to R/O target file".This occurred because the server side NLM always checked for VWRITEaccess, irrespective of the type of lock request. This patchreplaces VOP_ACCESS(..VWRITE..) with one appropriate tothe lock operation. It allows unlock and lock cancellationto be done without a check of VOP_ACCESS(), so that filescan't be left locked indefinitely after the file permissionshave been changed.Discussed with: zackSubmitted by: jwd (earlier version)Reviewed by: dfrMFC after: 2 weeks
Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.The SYSCTL_NODE macro defines a list that stores all child-elements ofthat node. If there's no SYSCTL_DECL macro anywhere else,
Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.The SYSCTL_NODE macro defines a list that stores all child-elements ofthat node. If there's no SYSCTL_DECL macro anywhere else, there's noreason why it shouldn't be static.
In order to maximize the re-usability of kernel code in user space thispatch modifies makesyscalls.sh to prefix all of the non-compatibilitycalls (e.g. not linux_, freebsd32_) with sys_ and updates
In order to maximize the re-usability of kernel code in user space thispatch modifies makesyscalls.sh to prefix all of the non-compatibilitycalls (e.g. not linux_, freebsd32_) with sys_ and updates the kernelentry points and all places in the code that use them. It alsofixes an additional name space collision between the kernel functionpsignal and the libc function of the same name by renaming the kernelpsignal kern_psignal(). By introducing this change now we will ease futureMFCs that change syscalls.Reviewed by: rwatsonApproved by: re (bz)
Add a lock flags argument to the VFS_FHTOVP() file systemmethod, so that callers can indicate the minimum vnodelocking requirement. This will allow some file systems to chooseto return a LK_SHARED
Add a lock flags argument to the VFS_FHTOVP() file systemmethod, so that callers can indicate the minimum vnodelocking requirement. This will allow some file systems to chooseto return a LK_SHARED locked vnode when LK_SHARED is specifiedfor the flags argument. This patch only adds the flag. Itdoes not change any file system to use it and all callersspecify LK_EXCLUSIVE, so file system semantics are not changed.Reviewed by: kib
sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.Commit the kernel changes.
Fix the nlm so that it no longer depends on the regularnfs client and, as such, can be loaded for the experimentalnfs client without the regular client.Reviewed by: jhbMFC after: 2 weeks
Modify the NFS clients and the NLM so that the NLM can be usedby both clients. Since the NLM uses various fields of thenfsmount structure, those fields were extracted and put in aseparate nfs_moun
Modify the NFS clients and the NLM so that the NLM can be usedby both clients. Since the NLM uses various fields of thenfsmount structure, those fields were extracted and put in aseparate nfs_mountcommon structure stored in sys/nfs/nfs_mountcommon.h.This structure also has a function pointer for a function thatextracts the required information from the mount point and nfs vnodefor that particular client, for information stored differently by theclients.Reviewed by: jhbMFC after: 2 weeks
Make the RPC specific __rpc_inet_ntop() and __rpc_inet_pton() generalin the kernel (just as inet_ntoa() and inet_aton()) are and sync theirprototype accordingly with already mentioned functions.S
Make the RPC specific __rpc_inet_ntop() and __rpc_inet_pton() generalin the kernel (just as inet_ntoa() and inet_aton()) are and sync theirprototype accordingly with already mentioned functions.Sponsored by: Sandvine IncorporatedReviewed by: emaste, rstoneApproved by: dfrMFC after: 2 weeks
Handle GRANTED_RES messages more gracefully: Send along a grant cookieto reference the lock, look up the grant cookie when the GRANTED_REScomes back. Properly handle the case of an error on the gra
Handle GRANTED_RES messages more gracefully: Send along a grant cookieto reference the lock, look up the grant cookie when the GRANTED_REScomes back. Properly handle the case of an error on the grant. Add ashort expiration window so that granted locks are not freed immediately.Approved by: dfr (mentor)MFC after: 2 weeks
unifdef NFSCLIENT because the nlm depends on the nfsclient even if NFSCLIENTis not defined.Now the nfslockd module works with the nfsclient module.Reviewed by: kibMFC after: 3 days
123