| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The O_RESOLVE_BENEATH openat(2) flag restricts name lookups such that
they remain under the directory referenced by the dirfd. This commit
introduces an implicit version of the flag, FD_RESOLVE_BENEATH, stored
in the file descriptor entry. When the flag is set, any lookup relative
to that fd automatically has O_RESOLVE_BENEATH semantics. Furthermore,
the flag is sticky, meaning that it cannot be cleared, and it is copied
by dup() and openat().
File descriptors with FD_RESOLVE_BENEATH set may not be passed to
fchdir(2) or fchroot(2). Various fd lookup routines are modified to
return fd flags to the caller.
This flag will be used to address a case where jails with different root
directories and the ability to pass SCM_RIGHTS messages across the jail
boundary can transfer directory fds in such as way as to allow a
filesystem escape.
PR: 262180
Reviewed by: kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D50371
(cherry picked from commit f35525ff2053e026a423e852136d73ed93c95803)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MNT_IGNORE flag can be used to mark certain filesystem mounts so
that utilities such as df(1) and mount(8) can filter out those mounts by
default. This can be used, for instance, to reduce the noise from
running container workloads inside jails which often have at least three
and sometimes as many as ten mounts per container.
The flag is supplied by the nmount(2) system call and is recorded so
that it can be reported by statfs(2). Unfortunately several filesystems
override the default behaviour and mask out the flag, defeating its
purpose. This change preserves the MNT_IGNORE flag for those filesystems
so that it can be reported correctly.
MFC after: 1 week
(cherry picked from commit b5c4616582cebdcf4dee909a3c2f5b113c4ae59e)
|
| |
|
|
|
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
Similar commit in current:
(cherry picked from commit 95ee2897e98f)
|
| |
|
|
|
|
| |
PR: 272127
(cherry picked from commit 3905309dfeeb89f03b09c347f7ac0a863faa3975)
|
| |
|
|
|
|
| |
option"
(cherry picked from commit 9c3bfe2ad07170cd7d3645a7c24f4d80a509c2b7)
|
| |
|
|
|
|
| |
PR: 272127
(cherry picked from commit 3bffa2262328e4ff1737516f176107f607e7bc76)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pseudo file systems (devfs, fdescfs, procfs, etc.) report total
and available blocks and inodes despite being synthetic with no
underlying storage device to which those values could be applied.
The current code of these file systems tends to report a fixed number
of total blocks but no free blocks, and in the case of procfs,
libprocfs, linsysfs also no free inodes.
This can be irritating in e.g. the "df" output, since 100% of the
resources seem to be in use, but it can also create warnings in
monitoring tools used for capacity management.
This patch makes these file systems return the same value for the
total and free parameters, leading to 0% in use being displayed by
"df". Since there is no resource that can be exhausted, this appears
to be a sensible result.
Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D39442
(cherry picked from commit 88a795e80c03ff1d960d830ee273589664ab06cc)
|
| |
|
|
| |
(cherry picked from commit 13262b07a06910edd5e58e6bb2e1d4786a7b7d8e)
|
| |
|
|
| |
(cherry picked from commit 7dca8fd1cb3f91e7a3c07b7f57af6d9d43d0c71c)
|
| |
|
|
| |
(cherry picked from commit 8d97282a394278d29883e7afa98ed6294efab35e)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In fdesc_lookup(), vn_vget_ino_gen() may fail without invoking the
callback, in which case the ref on fp is leaked. This happens if the
fdescfs mount is being concurrently unmounted. Moreover, we cannot
safely drop the ref while the dvp is locked.
So:
- Use a flag variable to indicate whether the ref is dropped.
- Reorganize things to handle the leak.
Reported by: C Turt <ecturt@gmail.com>
Reviewed by: mjg, kib
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39189
(cherry picked from commit 0f5b6f9a041e9cca3b376f6ec909374938887a3b)
|
| |
|
|
| |
(cherry picked from commit 51b8ffb95c4fe45f6825d551bd093889820a8115)
|
| |
|
|
| |
(cherry picked from commit fa3ea81b77e41e3f33a611e51fd8bcbb2f4c8a95)
|
| |
|
|
|
|
| |
with O_PATH
(cherry picked from commit 156745b42d9e6dfa3d9c6dc480db7836683850cf)
|
| |
|
|
| |
(cherry picked from commit f9b1e711f0d8c27f2d29e7a8e6276947d37a6a22)
|
| |
|
|
|
|
| |
Eliminates fdescfs from lock profile when running poudriere.
(cherry picked from commit 4fe925b81e75b5885ec6d504c6217f848439164a)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
semantic patch:
@@
expression rights, r;
@@
- cap_rights_init(&rights, r)
+ cap_rights_init_one(&rights, r)
|
| |
|
|
| |
Notes:
svn path=/head/; revision=365070
|
| |
|
|
|
|
|
|
|
| |
Note VOP_VPTOCNP keeps getting it as temporary compatibility for zfs.
Tested by: pho
Notes:
svn path=/head/; revision=364633
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was already asserted to be curthread.
Semantic patch:
@@
expression arg1, arg2, arg3;
@@
- vget(arg1, arg2, arg3)
+ vget(arg1, arg2)
Notes:
svn path=/head/; revision=364271
|
| |
|
|
|
|
|
|
|
|
|
| |
Filesystems which want to use it in limited capacity can employ the
VOP_UNLOCK_FLAGS macro.
Reviewed by: kib (previous version)
Differential Revision: https://reviews.freebsd.org/D21427
Notes:
svn path=/head/; revision=356337
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This eliminates the following loop from all VOP calls:
while(vop != NULL && \
vop->vop_spare2 == NULL && vop->vop_bypass == NULL)
vop = vop->vop_default;
Reviewed by: jeff
Tesetd by: pho
Differential Revision: https://reviews.freebsd.org/D22738
Notes:
svn path=/head/; revision=355790
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current vnode layout is not smp-friendly by having frequently read data
avoidably sharing cachelines with very frequently modified fields. In
particular v_iflag inspected for VI_DOOMED can be found in the same line with
v_usecount. Instead make it available in the same cacheline as the v_op, v_data
and v_type which all get read all the time.
v_type is avoidably 4 bytes while the necessary data will easily fit in 1.
Shrinking it frees up 3 bytes, 2 of which get used here to introduce a new
flag field with a new value: VIRF_DOOMED.
Reviewed by: kib, jeff
Differential Revision: https://reviews.freebsd.org/D22715
Notes:
svn path=/head/; revision=355537
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Directory entries must be padded to maintain alignment; in many
filesystems the padding was not initialized, resulting in stack
memory being copied out to userspace. With the ino64 work there
are also some explicit pad fields in struct dirent. Add a subroutine
to clear these bytes and use it in the in-tree filesystems. The
NFS client is omitted for now as it was fixed separately in r340787.
Reported by: Thomas Barabosch, Fraunhofer FKIE
Reviewed by: kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=340856
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The d_off field has been added to the dirent structure recently.
Currently filesystems don't support this feature. Support has been
added and tested for zfs, ufs, ext2fs, fdescfs, msdosfs and unionfs.
A stub implementation is available for cd9660, nandfs, udf and
pseudofs but hasn't been tested.
Motivation for this feature: our usecase is for a userspace nfs server
(nfs-ganesha) with zfs. At the moment we cache direntry offsets by
calling lseek once per entry, with this patch we can get the offset
directly from getdirentries(2) calls which provides a significant
speedup.
Submitted by: Jack Halford <jack@gandi.net>
Reviewed by: mckusick, pfg, rmacklem (previous versions)
Sponsored by: Gandi.net
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17917
Notes:
svn path=/head/; revision=340431
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add macros to allow preinitialization of cap_rights_t.
- Convert most commonly used code paths to use preinitialized cap_rights_t.
A 3.6% speedup in fstat was measured with this change.
Reported by: mjg
Reviewed by: oshogbo
Approved by: sbruno
MFC after: 1 month
Notes:
svn path=/head/; revision=333425
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
by doing most of the work in a new function prison_add_vfs in kern_jail.c
Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, and
the rest is taken care of. This includes adding a jail parameter like
allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allowed.
Both of these used to be a static list of known filesystems, with
predefined permission bits.
Reviewed by: kib
Differential Revision: D14681
Notes:
svn path=/head/; revision=333263
|
| |
|
|
|
|
|
| |
MFC after: 1 week
Notes:
svn path=/head/; revision=330681
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
pathconf(2) and fpathconf(2) both return a long. The kern_[f]pathconf()
functions now accept a pointer to a long value rather than modifying
td_retval directly. Instead, the system calls explicitly store the
returned long value in td_retval[0].
Requested by: bde
Reviewed by: kib
Sponsored by: Chelsio Communications
Notes:
svn path=/head/; revision=328099
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The method handles NAME_MAX and LINK_MAX explicitly. For all other
pathconf variables, the method passes the request down to the underlying
file descriptor. This requires splitting a kern_fpathconf() syscallsubr
routine out of sys_fpathconf(). Also, to avoid lock order reversals with
vnode locks, the fdescfs vnode is unlocked around the call to
kern_fpathconf(), but with the usecount of the vnode bumped.
MFC after: 1 month
Sponsored by: Chelsio Communications
Notes:
svn path=/head/; revision=326986
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mainly focus on files that use BSD 3-Clause license.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
Notes:
svn path=/head/; revision=326023
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux specific things to the native fdescfs file system.
Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic
links to the actual files, which the process has open.
A readlink(2) call on this file returns a full path in case of regular file
or a string in a special format (type:[inode], anon_inode:<file-type>, etc..).
As well as in a FreeBSD, opening the file in the Linux fdescfs directory is
equivalent to duplicating the corresponding file descriptor.
Here we have mutually exclusive requirements:
- in case of readlink(2) call fdescfs lookup() method should return VLNK
vnode otherwise our kern_readlink() fail with EINVAL error;
- in the other calls fdescfs lookup() method should return non VLNK vnode.
For what new vnode v_flag VV_READLINK was added, which is set if fdescfs has beed
mounted with linrdlnk option an modified kern_readlinkat() to properly handle it.
For now For Linux ABI compatibility mount fdescfs volume with linrdlnk option:
mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd
Reviewed by: kib@
MFC after: 1 week
Relnotes: yes
Notes:
svn path=/head/; revision=321839
|
| |
|
|
|
|
|
| |
MFC after: 2 week
Notes:
svn path=/head/; revision=321460
|
| |
|
|
|
|
|
| |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=320837
|
| |
|
|
|
|
|
| |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=320836
|
| |
|
|
|
|
|
| |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=320820
|
| |
|
|
|
|
|
| |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=320819
|
| |
|
|
|
|
|
| |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=320818
|
| |
|
|
|
|
|
| |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=320817
|
| |
|
|
|
|
|
| |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=320816
|
| |
|
|
|
|
|
| |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=320815
|
| |
|
|
|
|
|
| |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=320814
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend the ino_t, dev_t, nlink_t types to 64-bit ints. Modify
struct dirent layout to add d_off, increase the size of d_fileno
to 64-bits, increase the size of d_namlen to 16-bits, and change
the required alignment. Increase struct statfs f_mntfromname[] and
f_mntonname[] array length MNAMELEN to 1024.
ABI breakage is mitigated by providing compatibility using versioned
symbols, ingenious use of the existing padding in structures, and
by employing other tricks. Unfortunately, not everything can be
fixed, especially outside the base system. For instance, third-party
APIs which pass struct stat around are broken in backward and
forward incompatible ways.
Kinfo sysctl MIBs ABI is changed in backward-compatible way, but
there is no general mechanism to handle other sysctl MIBS which
return structures where the layout has changed. It was considered
that the breakage is either in the management interfaces, where we
usually 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 useful
than reporting 64-bit dev_t, for the sake of pstat.
Update note: strictly follow the instructions in UPDATING. Build
and 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 life
many years ago as a project by Gleb Kurtsou (gleb). Kirk McKusick
(mckusick) then picked up and updated the patch, and acted as a
flag-waver. Feedback, suggestions, and discussions were carried
by Ed Maste (emaste), John Baldwin (jhb), Jilles Tjoelker (jilles),
and Rick Macklem (rmacklem). Kris Moore (kris) performed an initial
ports 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 the
project to completion were done by Konstantin Belousov (kib).
Sponsored by: The FreeBSD Foundation (emaste, kib)
Differential revision: https://reviews.freebsd.org/D10439
Notes:
svn path=/head/; revision=318736
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and getboottimebin(9) KPI. Change consumers of boottime to use the
KPI. The variables were renamed to avoid shadowing issues with local
variables of the same name.
Issue is that boottime* should be adjusted from tc_windup(), which
requires them to be members of the timehands structure. As a
preparation, this commit only introduces the interface.
Some uses of boottime were found doubtful, e.g. NLM uses boottime to
identify the system boot instance. Arguably the identity should not
change on the leap second adjustment, but the commit is about the
timekeeping code and the consumers were kept bug-to-bug compatible.
Tested by: pho (as part of the bigger patch)
Reviewed by: jhb (same)
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302
Notes:
svn path=/head/; revision=303382
|
| |
|
|
| |
Notes:
svn path=/head/; revision=298853
|
| |
|
|
| |
Notes:
svn path=/head/; revision=298846
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
CID 1018688 is a false positive.
The initialization is done by calling vn_start_write(... &mp, flags).
mp is only an output parameter unless (flags & V_MNTREF), and fdesc
doesn't put V_MNTREF in flags.
Pointed out by: bde
Notes:
svn path=/head/; revision=295371
|
| |
|
|
|
|
|
| |
CID: 1018688
Notes:
svn path=/head/; revision=295359
|
| |
|
|
| |
Notes:
svn path=/head/; revision=285172
|
| |
|
|
|
|
|
| |
This is is a step towards removal of spurious arguments.
Notes:
svn path=/head/; revision=284446
|