dragonfly.git
16 months agoMerge branch 'vendor/DHCPCD'
Roy Marples [Fri, 11 Oct 2019 11:49:54 +0000 (12:49 +0100)]
Merge branch 'vendor/DHCPCD'

16 months agoImport dhcpcd-8.1.0 to vendor branch with the following changes:
Roy Marples [Fri, 11 Oct 2019 11:42:26 +0000 (12:42 +0100)]
Import dhcpcd-8.1.0 to vendor branch with the following changes:

 * Fix carrier status after a route socket overflow
 * Allow domain spaced options
 * DHCP: Allow not sending Force Renew Nonce or Reconf Accept
 * IPv4LL: Now passes Apple Bonjour test versions 1.4 and 1.5
 * ARP: Fix a typo and remove pragma (thus working with old gcc)
 * DHCP6: Fix a cosmetic issue with infinite leases
 * DHCP6: SLA 0 and Prefix Len 0 will now add a delegatd /64 address
 * Ignore some virtual interfaces such as Tap and Bridge by default
 * BPF: Move validation logic out of BPF and back into dhcpcd

16 months agolibc/utmp{,x}: Add some __unused.
Sascha Wildner [Thu, 10 Oct 2019 19:11:43 +0000 (21:11 +0200)]
libc/utmp{,x}: Add some __unused.

16 months agocorepower(4): Fix comments based on the Intel SDM.
Sascha Wildner [Thu, 10 Oct 2019 18:57:46 +0000 (20:57 +0200)]
corepower(4): Fix comments based on the Intel SDM.

16 months ago<machine/specialreg.h>: Fix whitespace.
Sascha Wildner [Thu, 10 Oct 2019 18:42:17 +0000 (20:42 +0200)]
<machine/specialreg.h>: Fix whitespace.

16 months agosys/vfs/msdosfs: Spelling fixes
Tomohiro Kusumi [Thu, 10 Oct 2019 14:48:48 +0000 (23:48 +0900)]
sys/vfs/msdosfs: Spelling fixes

bits from freebsd/freebsd@9ed8e933a363f67081dec54601b6262db2a57437

16 months agosys/vfs/msdosfs: Rename DOS_FILESIZE_MAX -> MSDOSFS_FILESIZE_MAX
Tomohiro Kusumi [Thu, 10 Oct 2019 14:12:04 +0000 (23:12 +0900)]
sys/vfs/msdosfs: Rename DOS_FILESIZE_MAX -> MSDOSFS_FILESIZE_MAX

from freebsd/freebsd@e6fd69815f99795031e72e899db2cfba63581fc4

16 months agocorepower(4): Add Coffee Lake support (numbers look reasonable at least).
Sascha Wildner [Thu, 10 Oct 2019 07:44:07 +0000 (09:44 +0200)]
corepower(4): Add Coffee Lake support (numbers look reasonable at least).

16 months agocorepower(4): Fix some Intel microarchitecture names in the comments.
Sascha Wildner [Thu, 10 Oct 2019 07:42:19 +0000 (09:42 +0200)]
corepower(4): Fix some Intel microarchitecture names in the comments.

16 months agoopenssh: Adjust README.DRAGONFLY for recent pam_ssh removal.
Sascha Wildner [Wed, 9 Oct 2019 19:57:53 +0000 (21:57 +0200)]
openssh: Adjust README.DRAGONFLY for recent pam_ssh removal.

16 months agodrm/linux: Add vmalloc_to_page()
François Tigeot [Wed, 9 Oct 2019 19:45:37 +0000 (21:45 +0200)]
drm/linux: Add vmalloc_to_page()

Obtained-from: FreeBSD

16 months ago{i915,radeon}kms.4: Really clean up the manual page naming situation.
Sascha Wildner [Wed, 9 Oct 2019 19:45:28 +0000 (21:45 +0200)]
{i915,radeon}kms.4: Really clean up the manual page naming situation.

Leave only i915.4 and radeon.4. The previous naming was a leftover from
when the modules were renamed but the manpage were not taken care of.

Remove *kms.4 and *drm.4 copies.

16 months agodrm: Remove mentions of i915kms and radeonkms
François Tigeot [Wed, 9 Oct 2019 19:19:14 +0000 (21:19 +0200)]
drm: Remove mentions of i915kms and radeonkms

drm(4) drivers are simply named i915 and radeon like on Linux now.

16 months agosys/vfs/msdosfs: Use vop_stdpathconf()
Tomohiro Kusumi [Wed, 9 Oct 2019 13:31:17 +0000 (22:31 +0900)]
sys/vfs/msdosfs: Use vop_stdpathconf()

from freebsd/freebsd@b4c54ab330a8138d19ec8b649b3ded0465f45331

16 months agosys/vfs/msdosfs: Remove unused msdosfs_args::magic
Tomohiro Kusumi [Wed, 9 Oct 2019 13:30:56 +0000 (22:30 +0900)]
sys/vfs/msdosfs: Remove unused msdosfs_args::magic

bits from freebsd/freebsd@89382b6533d2fd694195b6f534563993a4741fa4

Requires FAT userspace rebuild.

16 months agosys/vfs/msdosfs: vrecycle() vnode with SLOT_EMPTY
Tomohiro Kusumi [Wed, 9 Oct 2019 13:30:39 +0000 (22:30 +0900)]
sys/vfs/msdosfs: vrecycle() vnode with SLOT_EMPTY

from freebsd/freebsd@11cf2ecaee883581cf49f4bea644f97d88e289da

Keep the change from e0ab0dda4467a333f1c9f1d382f74e3d830a5ed9.

16 months agosys/vfs/msdosfs: Use vfs_timestamp()
Tomohiro Kusumi [Wed, 9 Oct 2019 13:30:16 +0000 (22:30 +0900)]
sys/vfs/msdosfs: Use vfs_timestamp()

from freebsd/freebsd@68807f21657b87276bee1a8b8e9ddbf03ef26525

16 months agolibc/tls: Remove some code that has been #if 0'd since 2005.
Sascha Wildner [Tue, 8 Oct 2019 20:16:02 +0000 (22:16 +0200)]
libc/tls: Remove some code that has been #if 0'd since 2005.

17 months agokdump/mksubr: Improve a bit.
Sascha Wildner [Tue, 8 Oct 2019 09:05:37 +0000 (11:05 +0200)]
kdump/mksubr: Improve a bit.

* Change auto_or_type() and auto_or_typelong() to better names,
  auto_or_int() and auto_or_long().

* Use bool type for a boolean variable.

* Fix printf format and drop unnecessary casts.

17 months agoprop_bool.3: Don't use defined type names as variable names.
Sascha Wildner [Tue, 8 Oct 2019 07:42:07 +0000 (09:42 +0200)]
prop_bool.3: Don't use defined type names as variable names.

17 months agoppp(8): Remove references to libradius.
zrj [Tue, 8 Oct 2019 06:21:48 +0000 (09:21 +0300)]
ppp(8): Remove references to libradius.

Reported-by: swildner
17 months agosys/vfs/msdosfs: Don't rely on FSInfo for next free cluster#
Tomohiro Kusumi [Mon, 7 Oct 2019 15:07:29 +0000 (00:07 +0900)]
sys/vfs/msdosfs: Don't rely on FSInfo for next free cluster#

from freebsd/freebsd@2e613b81275b754323270ba112f9d73a553d837a

Remove DragonFly's local changes which care about FSI_Nxt_Free.
68cc29492751172e9897a90c303b1c7fbb18112a
371e4713b969224e811cf5831e0c77a82be6a8a1

17 months agosys/vfs/msdosfs: FSInfo size handling is completely wrong
Tomohiro Kusumi [Mon, 7 Oct 2019 15:07:11 +0000 (00:07 +0900)]
sys/vfs/msdosfs: FSInfo size handling is completely wrong

from freebsd/freebsd@01c1ec9b1ae5e546930028126ab6d950d401c786
from freebsd/freebsd@e8377e738c6b5d23fad5f7125437708639bc0253

17 months agosys/vfs/msdosfs: Rename de_bntodoff() to de_bn2doff()
Tomohiro Kusumi [Mon, 7 Oct 2019 15:06:49 +0000 (00:06 +0900)]
sys/vfs/msdosfs: Rename de_bntodoff() to de_bn2doff()

Rename a DragonFly specific macro.
Follow naming convention of macros.

17 months agosys/vfs/msdosfs: Remove redundant macro xcntodoff()
Tomohiro Kusumi [Mon, 7 Oct 2019 15:06:15 +0000 (00:06 +0900)]
sys/vfs/msdosfs: Remove redundant macro xcntodoff()

Remove a DragonFly specific macro that is only used twice.

17 months agosys/vfs/msdosfs: Rename xcntobn() back to cntobn()
Tomohiro Kusumi [Mon, 7 Oct 2019 15:05:54 +0000 (00:05 +0900)]
sys/vfs/msdosfs: Rename xcntobn() back to cntobn()

4afd80f1a2 in 2006 has renamed cntobn() to xcntobn().
Rename it back to reduce unneeded diff against FreeBSD.

17 months agosys/vfs/msdosfs: Add markvoldirty()
Tomohiro Kusumi [Mon, 7 Oct 2019 15:05:13 +0000 (00:05 +0900)]
sys/vfs/msdosfs: Add markvoldirty()

from freebsd/freebsd@7dde93f1df429cf9a818bf7b716962298f489807
from freebsd/freebsd@47701ffd1e3ae03dfc0c65c3e70cfabc99537681

Only import the function, unused yet.
Disable B_INVALONERR part.

17 months ago<string.h>: Put memset_s() prototype inside __{BEGIN,END}_DECLS().
Sascha Wildner [Mon, 7 Oct 2019 08:44:12 +0000 (10:44 +0200)]
<string.h>: Put memset_s() prototype inside __{BEGIN,END}_DECLS().

Reported-by: zrj
17 months agodrm: Rename struct drm_file.master to .is_master
François Tigeot [Sun, 6 Oct 2019 19:51:44 +0000 (21:51 +0200)]
drm: Rename struct drm_file.master to .is_master

Reducing differences with Linux

17 months agosys/vfs/msdosfs: usemap_free() after fatentry()
Tomohiro Kusumi [Sun, 6 Oct 2019 18:31:57 +0000 (03:31 +0900)]
sys/vfs/msdosfs: usemap_free() after fatentry()

bits from freebsd/freebsd@eb2b3c8672da21da1d5b72a0b44f0e8c3271cc1e
"Use pm_fatlock to protect fat bitmap."

17 months agousr.sbin/fstyp: Retry fopen(3) if failed
Tomohiro Kusumi [Sun, 6 Oct 2019 18:43:05 +0000 (03:43 +0900)]
usr.sbin/fstyp: Retry fopen(3) if failed

Try argv[0] if fdpath failed.

17 months agoGenerate a fresh /etc/os-release on each installworld.
Sascha Wildner [Sun, 6 Oct 2019 13:53:44 +0000 (15:53 +0200)]
Generate a fresh /etc/os-release on each installworld.

Reported-by: zrj
17 months agousr.sbin/fstyp: Support HAMMER2 PFS label and @name syntax
Tomohiro Kusumi [Sun, 6 Oct 2019 15:15:05 +0000 (00:15 +0900)]
usr.sbin/fstyp: Support HAMMER2 PFS label and @name syntax

SUPROOT is printed only when @name is invalid.
Affects autofs -media mount.

17 months ago<sys/stat.h>: Rename two unused flags to names that we use elsewhere.
Sascha Wildner [Sun, 6 Oct 2019 13:34:36 +0000 (15:34 +0200)]
<sys/stat.h>: Rename two unused flags to names that we use elsewhere.

Reported-by: zrj
17 months agoFix immutable flag handling in our mtree(8) invocations.
Sascha Wildner [Sun, 6 Oct 2019 13:33:04 +0000 (15:33 +0200)]
Fix immutable flag handling in our mtree(8) invocations.

All of this only affects /var/empty so far.

* If NOSCHG isn't set (which is the default), pass -i to mtree(8) when
  installing the system or building an installer img.

* Pass -i always when we install a system from the installer. This
  installer usage of mtree(8) should not be needed. Expand the comment
  a bit.

Reported-by: zrj
17 months agokernel/isa: Bury the intrmask_t type.
zrj [Sun, 6 Oct 2019 07:30:47 +0000 (10:30 +0300)]
kernel/isa: Bury the intrmask_t type.

 It is neither MI nor MD nor pure PD type, it is ISA placeholder type.
 Also it is unfortunately named and implies bad things.  The only way to
 make it consistent is to split it, since this type usage falls under
 standard/isa options.  The vkernel64 was already wrongly declaring it.

 No differences in generated binary outputs.

17 months agokernel: Make chflags syscalls argument types consistent with userland.
zrj [Sun, 6 Oct 2019 07:30:02 +0000 (10:30 +0300)]
kernel: Make chflags syscalls argument types consistent with userland.

 There was an inconsistency between userland and syscalls argument types
 that was inherited after initial fork.  Adjust prototypes to use u_long
 and add missing const char* too.  Rerun sysent.  Change tmpfs/dirfs to
 use u_int for flags since mask for superuser changeable flags is
 SF_SETTABLE 0xffff0000 (most fs use uint32_t), adjust mksubr script.
 Remove no longer needed (u_long) casts I could find elsewhere.

 While there, adjust unistd.h prototypes to use generic types too.

17 months agoworld: Eliminate custom uintfptr_t/fptrdiff_t types.
zrj [Sun, 6 Oct 2019 07:28:35 +0000 (10:28 +0300)]
world: Eliminate custom uintfptr_t/fptrdiff_t types.

 These were not used consistently and have visibility limitations,
 types.h - #indef _KERNEL while profile.h - publicly.  Use cases like:
  "uintfptr_t selfpcdiff;" and "fptrdiff_t frompci;" only confuse.
 Given that underlying structs uprof, rawarc already use plain u_long
 types, there are plenty (u_long) casts elsewhere in the kernel code,
 follow OpenBSD and use use (u_long) casts that are clear what they do.
 The unused intfptr_t type does not make much sense anyway.

17 months ago<unistd.h>: Fix profil(2) prototype.
zrj [Sun, 6 Oct 2019 07:27:18 +0000 (10:27 +0300)]
<unistd.h>: Fix profil(2) prototype.

 First off the vm_offset_t is somewhat bogus in this context, same could
 be said about size_t variant in sys/sysproto.h.  Just use plain u_long
 type like it is already used in "struct uprof" and fix forth argument
 to take u_int.  In public headers prefer to use generic types.

17 months ago<sys/stdint.h>: Move out two MD types.
zrj [Sun, 6 Oct 2019 07:26:29 +0000 (10:26 +0300)]
<sys/stdint.h>: Move out two MD types.

 The <cpu/types.h> would be a better place for these, however it needs
 proper cleanup first and would only complicate visibility on other
 standard headers at the moment.

17 months ago<sys/types.h>: Eliminate __nl_item type.
zrj [Sun, 6 Oct 2019 07:26:02 +0000 (10:26 +0300)]
<sys/types.h>: Eliminate __nl_item type.

 It is MI type, so just use standard int type as per POSIX.

17 months ago<runetype.h>: Convert __rune_t to internal typedef.
zrj [Sun, 6 Oct 2019 07:25:29 +0000 (10:25 +0300)]
<runetype.h>: Convert __rune_t to internal typedef.

 The __ct_rune_t is a basic type for __rune_t/__wint_t/__wchar_t.
 No functional change.

 While there, remove two trailing white spaces.

17 months agoNuke legacy non standard rune_t type.
zrj [Sun, 6 Oct 2019 07:25:02 +0000 (10:25 +0300)]
Nuke legacy non standard rune_t type.

 Not used anywhere and comments indicate it is meant not to be used
 outside lib/libc/locale anyway.

17 months agosbin/fsck_hammer2: More refactoring
Tomohiro Kusumi [Sun, 6 Oct 2019 01:02:08 +0000 (10:02 +0900)]
sbin/fsck_hammer2: More refactoring

17 months agosbin/fsck_hammer2: Refactor zone/blockref scanning
Tomohiro Kusumi [Sat, 5 Oct 2019 21:52:39 +0000 (06:52 +0900)]
sbin/fsck_hammer2: Refactor zone/blockref scanning

Refactor duplicated code from zone/blockref scanning with support
for multiple options.

17 months agosbin/fsck_hammer2: Add -b to only scan best zone
Tomohiro Kusumi [Sat, 5 Oct 2019 21:20:39 +0000 (06:20 +0900)]
sbin/fsck_hammer2: Add -b to only scan best zone

17 months agolibc: Add __errno_location() for language binding benefits.
zrj [Sat, 5 Oct 2019 10:04:12 +0000 (13:04 +0300)]
libc: Add __errno_location() for language binding benefits.

 Some languages have restrictions when it comes to C style TLS handling
 (thread local might be feature-gated) or simply it is inconvenient to
 add various OS specific binding wrappers just to access C errno values.

 The __errno_location() symbol provides externally callable version of
 __error() inline function.

 While there, add __WANT_NO_INLINED___ERROR guard for few python parsers
 in DPorts that are unable to parse inlined __error() code yet.

17 months agoppp(8): Re-enable RADIUS support.
zrj [Sat, 5 Oct 2019 10:00:16 +0000 (13:00 +0300)]
ppp(8): Re-enable RADIUS support.

 Until it is really decided to remove it from ppp(8).

 While there, add patches from DPorts to use newer
 LibreSSL/OpenSSL v1.1.x API.

17 months agoBump __DragonFly_version for libradius/libtacplus removal.
zrj [Sat, 5 Oct 2019 09:57:50 +0000 (12:57 +0300)]
Bump __DragonFly_version for libradius/libtacplus removal.

 While there, add entry to UPDATING.

17 months agoNuke libradius(3).
zrj [Sat, 5 Oct 2019 09:55:44 +0000 (12:55 +0300)]
Nuke libradius(3).

 It was moved to DPorts.

 For now keep radlib.c code directly in ppp(8). Other BSDs have it atm.

17 months agoppp(8): Disable RADIUS support.
zrj [Sat, 5 Oct 2019 09:54:45 +0000 (12:54 +0300)]
ppp(8): Disable RADIUS support.

 If there are still users making use of RADIUS support in ppp(8),
 then it could be added back directly into ppp(8).

 Add __unused for few arguments to pet WARNS in case of -DNORADIUS.

17 months agoNuke libtacplus(3).
zrj [Sat, 5 Oct 2019 09:54:16 +0000 (12:54 +0300)]
Nuke libtacplus(3).

 It was moved to DPorts.

17 months agoNuke pam_radius(8).
zrj [Sat, 5 Oct 2019 09:53:32 +0000 (12:53 +0300)]
Nuke pam_radius(8).

 It was moved to DPorts.

 While there, remove deps from MINUSPAM (including last dep on crypto).

17 months agoNuke pam_tacplus(8).
zrj [Sat, 5 Oct 2019 09:52:46 +0000 (12:52 +0300)]
Nuke pam_tacplus(8).

 It was moved to DPorts.

 While there, remove deps from MINUSPAM.

17 months agolib: Update dependencies.
zrj [Sat, 5 Oct 2019 09:51:55 +0000 (12:51 +0300)]
lib: Update dependencies.

 No libraries depend on libprivate_ssh, it can be built with rest.
 We could remove libprivate_ssh.so as and link with static version as it
 is done in upstream version, but for now save few bytes.

 While there, remove LIBSSH from MINUSPAM list.

17 months agoNuke pam_ssh(8). It was moved to DPorts.
zrj [Sat, 5 Oct 2019 09:51:26 +0000 (12:51 +0300)]
Nuke pam_ssh(8). It was moved to DPorts.

 Having it as security/pam_ssh solves several issues when using multiple
 LibreSSL/OpenSSL versions. Also this module poses a security risk for
 unsuspecting system admins, because users might create private ssh keys
 using very weak passphrases.

17 months agosys/vfs/msdosfs: Fix panic on corrupted fs in pcbmap()
Tomohiro Kusumi [Sat, 5 Oct 2019 19:44:56 +0000 (04:44 +0900)]
sys/vfs/msdosfs: Fix panic on corrupted fs in pcbmap()

from freebsd/freebsd@1d085394336dc06a0fd195ff4225080701b6fa5f

17 months agosys/vfs/msdosfs: Invalid filesystem might brelse(bp) with NULL
Tomohiro Kusumi [Sat, 5 Oct 2019 19:24:22 +0000 (04:24 +0900)]
sys/vfs/msdosfs: Invalid filesystem might brelse(bp) with NULL

from freebsd/freebsd@3dd6e87cb09dc334c97ca50dd65e567cfe453006

17 months agosys/vfs/msdosfs: Change the return on impossible condition into KASSERT()
Tomohiro Kusumi [Sat, 5 Oct 2019 19:01:33 +0000 (04:01 +0900)]
sys/vfs/msdosfs: Change the return on impossible condition into KASSERT()

from freebsd/freebsd@cc5d11fa86957084473b9eebf17dcdd1f3e7633d

Don't apply vnode lock assertion part yet.

17 months agosys/vfs/msdosfs: Ensure cluster allocation is within volume limits
Tomohiro Kusumi [Sat, 5 Oct 2019 18:07:41 +0000 (03:07 +0900)]
sys/vfs/msdosfs: Ensure cluster allocation is within volume limits

from freebsd/freebsd@097a1d5fbb7990980f8f806c6878537c964adf32

17 months agosys/vfs/msdosfs: Style
Tomohiro Kusumi [Sat, 5 Oct 2019 17:45:43 +0000 (02:45 +0900)]
sys/vfs/msdosfs: Style

from freebsd/freebsd@7721974753e2594dfeba7b2d625f7ea681c82a9b

17 months agosys/vfs/msdosfs: Verify BPB_Media value in FAT[0] in fillinusemap()
Tomohiro Kusumi [Sat, 5 Oct 2019 17:37:07 +0000 (02:37 +0900)]
sys/vfs/msdosfs: Verify BPB_Media value in FAT[0] in fillinusemap()

from freebsd/freebsd@18480c36c8d3d1f6b8996ceebd5b9c7d5daa9273

17 months agosys/vfs/msdosfs: Properly update ClnShutBitMask in FAT[1] in updatefats()
Tomohiro Kusumi [Sat, 5 Oct 2019 16:51:59 +0000 (01:51 +0900)]
sys/vfs/msdosfs: Properly update ClnShutBitMask in FAT[1] in updatefats()

from freebsd/freebsd@35907051bb7af5a3d9532671d959a88be064bce7

17 months agosys/vfs/msdosfs: Clear cluster bitmap on chainalloc() failure
Tomohiro Kusumi [Sat, 5 Oct 2019 15:56:15 +0000 (00:56 +0900)]
sys/vfs/msdosfs: Clear cluster bitmap on chainalloc() failure

from freebsd/freebsd@65a0ccdfc80cbc095717bdbc98bd3d061d9885ef

17 months agosys/vfs/msdosfs: Add clusteralloc1()
Tomohiro Kusumi [Sat, 5 Oct 2019 15:41:44 +0000 (00:41 +0900)]
sys/vfs/msdosfs: Add clusteralloc1()

bits from freebsd/freebsd@eb2b3c8672da21da1d5b72a0b44f0e8c3271cc1e
"Use pm_fatlock to protect fat bitmap."

Reduce diff against FreeBSD.

MP lock part is ignored.
sys/vfs/msdosfs isn't MPSAFE'd yet.

17 months agosys/vfs/msdosfs: ANSIfy sys/fs/msdosfs
Tomohiro Kusumi [Sat, 5 Oct 2019 15:22:04 +0000 (00:22 +0900)]
sys/vfs/msdosfs: ANSIfy sys/fs/msdosfs

bits from freebsd/freebsd@9d6a34744f8b822b0ba909b701876a2dd8f9c987

17 months agosys/vfs/msdosfs: Use struct dirent
Tomohiro Kusumi [Fri, 4 Oct 2019 16:36:39 +0000 (01:36 +0900)]
sys/vfs/msdosfs: Use struct dirent

Fix/sync the code diverged by DragonFly commits from around 2009
with FreeBSD.

Keep mbnambuf_flush() call in VOP_REDDIR() the same for now using
compat version. FreeBSD has other fixes here from recent years.

17 months agosys/vfs/msdosfs: Remove diff noises vs FreeBSD from iconv support
Tomohiro Kusumi [Fri, 4 Oct 2019 15:35:55 +0000 (00:35 +0900)]
sys/vfs/msdosfs: Remove diff noises vs FreeBSD from iconv support

commits in 2009 or so.

17 months agosys/vfs/msdosfs: Long names of files are created incorrectly
Tomohiro Kusumi [Fri, 4 Oct 2019 15:21:49 +0000 (00:21 +0900)]
sys/vfs/msdosfs: Long names of files are created incorrectly

from freebsd/freebsd@1ac70fc5481e16dc0207e50e5d6ec4336cc00162

17 months agosys/vfs/msdosfs: Prevent buffer overflow when expanding win95 names
Tomohiro Kusumi [Fri, 4 Oct 2019 15:10:12 +0000 (00:10 +0900)]
sys/vfs/msdosfs: Prevent buffer overflow when expanding win95 names

from freebsd/freebsd@b91af2a23dcf0bf7ce2d13ab11bd3c5256d02745

17 months agosys/vfs/msdosfs: Use __DECONST()
Tomohiro Kusumi [Thu, 3 Oct 2019 23:20:07 +0000 (08:20 +0900)]
sys/vfs/msdosfs: Use __DECONST()

from freebsd/freebsd@07f28f1df7815f81403f5d937040fa604d8b915c

17 months agosys/vfs/msdosfs: Discarding local array based on return values
Tomohiro Kusumi [Fri, 4 Oct 2019 00:44:47 +0000 (09:44 +0900)]
sys/vfs/msdosfs: Discarding local array based on return values

from freebsd/freebsd@e043036a251d22e3cb85c0db5bd28c8ee58cbd24

17 months agosys/vfs/msdosfs: Fixes for undefined behavior
Tomohiro Kusumi [Thu, 3 Oct 2019 20:53:47 +0000 (05:53 +0900)]
sys/vfs/msdosfs: Fixes for undefined behavior

freebsd/freebsd@c0db7289c3de290d821311942d5533f2284af77f

These were found by the Undefined Behaviour GsoC project at NetBSD.

17 months agosys/vfs/msdosfs: Avoid excessive flushing of FSInfo hints in updatefats()
Tomohiro Kusumi [Thu, 3 Oct 2019 17:07:59 +0000 (02:07 +0900)]
sys/vfs/msdosfs: Avoid excessive flushing of FSInfo hints in updatefats()

freebsd/freebsd@5cdc06872e1ac2b6529e1182078d48fa6fe57ff0
freebsd/freebsd@e5238fcb15d4fbacf835cb112ac49dcb28ff894d

17 months agosys/vfs/msdosfs: Use FSInfo instead of random# on cluster allocation
Tomohiro Kusumi [Thu, 3 Oct 2019 15:12:03 +0000 (00:12 +0900)]
sys/vfs/msdosfs: Use FSInfo instead of random# on cluster allocation

freebsd/freebsd@fb1dc96e7297ef975bb8867201aa88d1a1d7f379

Provides *huge* performance improvement, that FAT is finally
usable on DragonFly.

17 months agosys/vfs/msdosfs: Add FULL_RUN for (u_int)-1
Tomohiro Kusumi [Wed, 2 Oct 2019 22:57:44 +0000 (07:57 +0900)]
sys/vfs/msdosfs: Add FULL_RUN for (u_int)-1

freebsd/freebsd@1e5991e49446d3096b0c8d3e0a184180ad5c3dff

17 months agosbin/fsck_hammer2: Test icrc_volheader in verify_volume_header()
Tomohiro Kusumi [Wed, 2 Oct 2019 22:09:49 +0000 (07:09 +0900)]
sbin/fsck_hammer2: Test icrc_volheader in verify_volume_header()

icrc_volheader is untested on mount time, but sbin/hammer2 "volhdr"
does test this.

17 months agosys/vfs/msdosfs: Fix loading msdos_iconv.ko
Tomohiro Kusumi [Wed, 2 Oct 2019 19:50:58 +0000 (04:50 +0900)]
sys/vfs/msdosfs: Fix loading msdos_iconv.ko

Temporary fix.
Will eventually be fully synced with FreeBSD.

17 months agosys/vfs/msdosfs: Fix build break on LINT64 by 411df81600
Tomohiro Kusumi [Wed, 2 Oct 2019 19:17:17 +0000 (04:17 +0900)]
sys/vfs/msdosfs: Fix build break on LINT64 by 411df81600

17 months agokernel - Fix lockfz wait state
Matthew Dillon [Wed, 2 Oct 2019 16:43:22 +0000 (09:43 -0700)]
kernel - Fix lockfz wait state

* Fix a bug in the lockf code which could degenerate into
  a situation where it tsleep()'s uninterruptibly and
  ignores signals, making it impossible to kill the related
  process.

* Fixes issues when trying to kill postfix's smtpd daemons.

17 months agosbin/fsck_hammer2: Refactor verify_blockref()
Tomohiro Kusumi [Wed, 2 Oct 2019 16:50:56 +0000 (01:50 +0900)]
sbin/fsck_hammer2: Refactor verify_blockref()

Not interested in blockref with no data once counter is incremented,
so just return if !bytes.

17 months agosbin/fsck_hammer2: Print blockref stats once if -q
Tomohiro Kusumi [Wed, 2 Oct 2019 16:50:25 +0000 (01:50 +0900)]
sbin/fsck_hammer2: Print blockref stats once if -q

Better with this when redirecting output.

17 months agosbin/fsck_hammer2: Fix return value on -f
Tomohiro Kusumi [Wed, 2 Oct 2019 16:49:54 +0000 (01:49 +0900)]
sbin/fsck_hammer2: Fix return value on -f

17 months agosbin/fsck_hammer2: Add -p and -l option for per PFS scan
Tomohiro Kusumi [Tue, 1 Oct 2019 21:48:40 +0000 (06:48 +0900)]
sbin/fsck_hammer2: Add -p and -l option for per PFS scan

17 months agosbin/hammer2: Use old "show"/"freemap" format for -q
Tomohiro Kusumi [Tue, 1 Oct 2019 23:23:57 +0000 (08:23 +0900)]
sbin/hammer2: Use old "show"/"freemap" format for -q

which existed until aa2131f062.

The original format had better readability and grep-ability for
-q where only blockref itself was printed without referenced data.
A single line format works out better for this.

17 months agosbin/hammer2: Assert bytes > 0 for inode/indirect in "show"/"freemap"
Tomohiro Kusumi [Tue, 1 Oct 2019 22:50:37 +0000 (07:50 +0900)]
sbin/hammer2: Assert bytes > 0 for inode/indirect in "show"/"freemap"

`bytes` must not be 0 for blockref types which refer to data.

17 months agosys/vfs/msdosfs: Assert mount is not read-only when FAT modifications requested
Tomohiro Kusumi [Wed, 2 Oct 2019 16:05:19 +0000 (01:05 +0900)]
sys/vfs/msdosfs: Assert mount is not read-only when FAT modifications requested

freebsd/freebsd@95e51995786685d7cceb893fae4a6c359ce7aee9

17 months agosys/vfs/msdosfs: Add assertions for FAT bitmap state
Tomohiro Kusumi [Wed, 2 Oct 2019 16:04:40 +0000 (01:04 +0900)]
sys/vfs/msdosfs: Add assertions for FAT bitmap state

freebsd/freebsd@452113665587ed27ad543c49c84d142ef8bd5481

17 months agosys/vfs/msdosfs: Remove unused global statistic about fat cache usage
Tomohiro Kusumi [Wed, 2 Oct 2019 15:14:03 +0000 (00:14 +0900)]
sys/vfs/msdosfs: Remove unused global statistic about fat cache usage

freebsd/freebsd@9be56bb3cbf4a01715415777c05d15ed42ba4c63

17 months agosys/vfs/msdosfs: Remove unused find_lcode()
Tomohiro Kusumi [Wed, 2 Oct 2019 15:02:05 +0000 (00:02 +0900)]
sys/vfs/msdosfs: Remove unused find_lcode()

17 months agosys/vfs/msdosfs: Mount msdosfs with longnames support by default
Tomohiro Kusumi [Tue, 1 Oct 2019 18:27:35 +0000 (03:27 +0900)]
sys/vfs/msdosfs: Mount msdosfs with longnames support by default

The old behavior depended on the FAT version and on what files were in the
root directory. "mount_msdosfs -o shortnames" is still supported.

(If any *real* user issue with this, we could consider reverting this.)

freebsd/freebsd@ca02d20de1b306a2e855e41dda6a9087a04b841a

17 months agosys/vfs/msdosfs: Fix wrong memcpy(3) usage
Tomohiro Kusumi [Tue, 1 Oct 2019 16:54:44 +0000 (01:54 +0900)]
sys/vfs/msdosfs: Fix wrong memcpy(3) usage

* Fix 65c1174772fa185d24d1d0978367da3f4b6582f3.

* Pick up missing memset(3) conversion from
  freebsd/freebsd@304b0a16bbe84af211b6bd820b44b90ed9405012.

17 months agosys/vfs/msdosfs: Extend fatcache size for extend write performance
Tomohiro Kusumi [Tue, 1 Oct 2019 15:57:48 +0000 (00:57 +0900)]
sys/vfs/msdosfs: Extend fatcache size for extend write performance

freebsd/freebsd@317819a5f62502c2daad8b2f578f62e1cd7f4017
freebsd/freebsd@9d167f82e426b3c6481ebd3bcdba5afbae063a7d

17 months agosys/vfs/hammer2: Use correct typedef for uint64_t for inode#
Tomohiro Kusumi [Tue, 1 Oct 2019 15:06:07 +0000 (00:06 +0900)]
sys/vfs/hammer2: Use correct typedef for uint64_t for inode#

17 months agoFix two comments (in trek and the installer): whereever -> wherever.
Sascha Wildner [Tue, 1 Oct 2019 09:39:58 +0000 (11:39 +0200)]
Fix two comments (in trek and the installer): whereever -> wherever.

17 months agohammer2.8: Fix some mdoc and other issues.
Sascha Wildner [Tue, 1 Oct 2019 09:00:47 +0000 (11:00 +0200)]
hammer2.8: Fix some mdoc and other issues.

* Remove an unneeded .Pp.

* Use a numbered list instead of rolling our own numbers.

* Use .Er for an errno.

* Start sentences on a new line.

* Capitalize UUID and CPU.

17 months agosys/vfs/msdosfs: msdos_iconv -> msdosfs_iconv (minimize diff noises)
Tomohiro Kusumi [Mon, 30 Sep 2019 15:10:05 +0000 (00:10 +0900)]
sys/vfs/msdosfs: msdos_iconv -> msdosfs_iconv (minimize diff noises)

and also fix/sync some typos/etc with FreeBSD.

17 months agosbin/hammer2: Use hammer2_uuid_to_str()
Tomohiro Kusumi [Sun, 29 Sep 2019 18:18:36 +0000 (03:18 +0900)]
sbin/hammer2: Use hammer2_uuid_to_str()

17 months agosbin/hammer2: Align usage output for "emergency-mode-disable"
Tomohiro Kusumi [Sun, 29 Sep 2019 18:15:46 +0000 (03:15 +0900)]
sbin/hammer2: Align usage output for "emergency-mode-disable"

17 months agohammer2 - Add emergency mode to allow recovery of ENOSPC edge cases
Matthew Dillon [Sun, 29 Sep 2019 18:06:08 +0000 (11:06 -0700)]
hammer2 - Add emergency mode to allow recovery of ENOSPC edge cases

* Because HAMMER2 is a copy-on-write filesystem, even 'rm' operations
  require block allocations.  H2 gives 'rm' operations extra reserve
  but it is still relatively easy to get into a situation where the
  normal copy-on-write allocation fails and the filesystem gets stuck
  in a ENOSPC situation that cannot be recovered from under normal
  operation.

  We add two directives, 'emergency-mode-enable' and
  'emergency-mode-disable' as a fail-safe to allow recovery of
  filesystems that have gotten into this situation.

* When this mode is enabled HAMMER2 will still attempt to use a
  copy-on-write operation for any blocks that might have been
  snapshotted.  However, any blocks which have not been snapshotted
  (or if the copy-on-write fails) will now be modified in-place,
  allowing chflags and rm operations to be run even when the filesystem
  is over-full.

  Such operation is fragile because the tree cannot be updated safely,
  so this mode can permanently destroy the filesystem if power is lost
  or a panic occurs during the file removal or chflags/chmod operations.
  Great care must be taken when using this mode.

  In addition, use of this mode will likely corrupt any snapshots sharing
  the same meta-data.  If you use this mode and have snapshots it is
  recommended that the snapshots be deleted.

* If you have to use this mode, be sure to disable it after the
  filesystem is operational again.

* The bulkfree scan now reports which PFS(es) a CRC failure occurs on.
  Bulkfree will attempt to alert the user as to which snapshots are
  corrupt, but it isn't perfect.