Commit Graph

692 Commits

Author SHA1 Message Date
jmcneill
fa74c92e0a Provide a default ptob() implementation 2019-12-01 20:26:05 +00:00
jmcneill
87afc7bc0f Initialize b_dev before passing buf to d_minphys (ldminphys needs this) 2019-12-01 20:25:31 +00:00
maxv
29441e93f4 Use x86_patch_window_{open,close}. This also fixes a bug: the CR0/PSL
reloads were inverted.
2019-11-13 10:13:41 +00:00
hannken
c4ae6d2fe2 dtrace_trap() gets called from alltraps() -> trap() with interrupts enabled
so we cannot assert for interrupts disabled here.

Should fix PR kern/54603: kernel panic when running dtruss
2019-11-08 11:06:21 +00:00
hannken
e59a8eaee2 Add missing "#ifdef _KERNEL" to fix the build of userland zfs libraries. 2019-10-15 06:58:12 +00:00
hannken
239a7f3a3b Change dmu_diff() back to use a "file" instead of a "vnode".
Command "zfs diff" calls it with a pipe, not a plain file.

Fixes PR kern/54541: kernel panic using "zfs diff"
2019-10-14 13:18:00 +00:00
christos
af4abd50bc make worker thread prototype match the pthread_create signature. 2019-10-13 21:32:07 +00:00
kre
e61903222f This previously had -Wno-format-truncation so I am presuming it should
have been converted to GCC_NO_FORMAT_TRUNCATION rather than
GCC_NO_STRINGOP_TRUNCATION which is what happened.   This might unbreak
the build (olr at least get it further).
2019-10-13 10:07:27 +00:00
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
kre
bab7747200 Only exclude gcc-8 warnings when the gcc we're using is gcc>=8 2019-10-10 02:35:45 +00:00
christos
04c417de37 no error for string truncation 2019-10-09 21:49:50 +00:00
brad
2ab41a9a50 For ZFS on NetBSD there are a number of functions called
zfs_netbsd_{create,mknod,link,etc..} that call functions called
zfs_{create,mknod,link,etc..}.  These later functions may return a
error code along with a *vpp that is NULL.  This situation was not
handled by the zfs_netbsd_* functions and would result in a panic in a
number of cases.  The simplest to trigger it was filling up a dataset
or pool resulting in a over quota condition.  An attempt to create
another file, or directory at that point would panic.
2019-10-04 23:06:19 +00:00
brad
2e0a32871b Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}.  The general effect is to move them
from /usr/lib to /lib.  Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
2019-09-22 18:45:19 +00:00
sevan
69d856e495 Use Pa macro for path
new sentence, new line
2019-09-20 22:47:36 +00:00
brad
5aa9b9d41e Add a copyright to the man page and a bit of history. 2019-09-20 22:38:28 +00:00
wiz
67060edf74 Use more markup. 2019-09-16 04:57:12 +00:00
gutteridge
a55674ceb3 mount_zfs.8: add xref to fstab(5) 2019-09-15 20:51:52 +00:00
brad
12ea0a140d Add support for legacy ZFS filesystems, specified by mountpoint=legacy
in the ZFS properties of the dataset and a simple man page for
mount_zfs.  With this, it is possible to put ZFS filesystems in
/etc/fstab as file system type zfs.

Add a rc.d script that kicks the module ZFS load mostly before
mountall runs simular to what LVM does.  This allows for any legacy
mounts to be specified in critical_local_filesystems and allows for
ZFS pools on top of cgd (probably among other things).  Introduce a
rc.conf variable called zfs which needs to be set to YES, in the usual
manor of things, to get zvols and ZFS dataset support rather then just
assume that 'zfs mount' does that in mountall.  Fix a problem in
mountall if ZFS is not compiled into the system.
2019-09-15 19:38:08 +00:00
hannken
65d6baaaeb Add missing dmu_zfetch_fini() when dnode_create() lost the race. 2019-08-24 12:59:34 +00:00
hannken
799f938b54 Implement kqueue support. 2019-08-24 12:59:05 +00:00
hannken
ace58db59c Implement poll support. 2019-08-24 12:58:24 +00:00
hannken
c72b1aea36 task_executor: prevent use after free, the task function may free
the tasq entry.
2019-08-20 08:12:50 +00:00
hannken
ae0ee8779d Rearrange the evaluation of "dvd_maxphys" so it works for wedges too. 2019-08-20 08:12:14 +00:00
hannken
9075f3bd2d Always open the raw block devices as "<device><unit>" like it
comes from sysctl "hw.disknames" without attaching the raw
partition letter.  Now pools on wedges get imported too.
2019-08-20 08:11:21 +00:00
hannken
97faa474a9 Add missing "defined(__NetBSD__)" to make "zfs promote" work. 2019-08-13 08:03:25 +00:00
maya
b214c01f05 validate the length of args (like other filesystems)
ok riastradh
2019-08-07 20:45:53 +00:00
hannken
706360a664 Handle automatic module loading on device open more like FreeBSD does.
Where FreeBSD uses a module "dtraceall" that depends on all dtrace
modules we now load the basic set "dtrace sdt fbt syscall" on open.
2019-07-24 16:57:45 +00:00
hannken
67361e01b4 Remove unneeded includes. 2019-07-24 16:54:37 +00:00
hannken
d233d0f45b Create "dtrace_taskq" here like FreeBSD does.
PR kern/54397: Panic when loading a DTrace module whilst DTrace is running
2019-07-23 09:06:12 +00:00
hannken
b83fa74ac8 Move local changes to files below "external/cddl/osnet/dist/" and
remove now unneeded files from "external/cddl/osnet/sys/sys/".

- sys/sys/bitmap.h -> dist/uts/common/sys/bitmap.h
- sys/sys/callb.h -> dist/uts/common/sys/callb.h

Stop including "cpupart.h", not needed for build.
2019-07-23 07:46:22 +00:00
hannken
c7790bc1b7 Always use "netbsd" as kernel name, dt_module_update() already takes
care to load data from the booted kernel image.
2019-07-21 15:38:06 +00:00
hannken
f705610493 Try to load module "dtrace" before opening "/dev/dtrace/dtrace".
Fixes PR kern/54387: DTrace Kernel module does not autoload on first use ...
2019-07-21 15:37:27 +00:00
hannken
bb86f86314 XXX: A crude hack to bring down the number of types for a
GENRIC kernel below 2**15-1 (from ~34000 to ~29800).

Remove the type attributes "volatile", "const" and "restrict",
for DTRACE these attributes are of little value.
2019-07-16 07:27:35 +00:00
hannken
9112aa41cd Add fixup operation to remove private mutex types for x86.
For GENERIC the number of types goes down from 47351 to 33981.
2019-07-16 07:26:41 +00:00
hannken
fcc1d7b138 Always exclude "fbt_*" from the list of FBT probes. 2019-07-16 07:26:00 +00:00
hannken
19f44db6df Change dtrace toxic range to "0 .. VM_MIN_KERNEL_ADDRESS_DEFAULT",
the direct map may be mapped below "VM_MIN_KERNEL_ADDRESS".
2019-07-05 08:29:18 +00:00
hannken
30c4137c4d Change module type to "MODULE_CLASS_MISC" to allow preloading.
Change "dtrace_nullop()" to return zero, it gets casted to "int (*)(...)".
2019-07-05 08:28:52 +00:00
sevan
168837a76f Add rcsid 2019-06-29 20:50:01 +00:00
hannken
544f1cdcc6 import new CDDL dtrace and ZFS code from FreeBSD svn r315983
Add files missing from the initial import.
2019-06-26 11:47:53 +00:00
hannken
f3f87b32db Sync with upstream r315983.
Move files originating from upstream below "dist/":

  OPENSOLARIS.LICENSE -> dist/OPENSOLARIS.LICENSE
  usr.sbin/zdb/zdb.8 -> dist/cmd/zdb/zdb.8
  sbin/zfs/zfs.8 -> dist/cmd/zfs/zfs.8
  sbin/zpool/zpool-features.7 -> dist/cmd/zpool/zpool-features.7
  sbin/zpool/zpool.8 -> dist/cmd/zpool/zpool.8
  include/libintl.h -> dist/head/libintl.h
  include/stdio_ext.h -> dist/head/stdio_ext.h
  include/thread.h -> dist/head/thread.h
  sys/kern/callb.c -> dist/uts/common/os/callb.c
  sys/kern/fm.c -> dist/uts/common/os/fm.c
  sys/sys/extdirent.h -> dist/uts/common/sys/extdirent.h
  sys/sys/isa_defs.h -> dist/uts/common/sys/isa_defs.h
  sys/sys/procset.h -> dist/uts/common/sys/procset.h
  sys/sys/sysmacros.h -> dist/uts/common/sys/sysmacros.h

Adapt "usr.sbin/fstyp/Makefile".
2019-06-24 08:27:19 +00:00
hannken
1a12b22735 Sync with upstream r315983.
FreeBSD splits "zfs_context.h" into:
  "lib/libzpool/common/sys/zfs_context.h" for user space
  "uts/common/fs/zfs/sys/zfs_context.h" for kernel space

Do the same here, move and sync "sys/sys/zfs_context.h" to
"dist/lib/libzpool/common/sys/zfs_context.h" and
"dist/uts/common/fs/zfs/sys/zfs_context.h".

Change "Makefile.zfs" to search includes from "dist/lib"
before "dist/uts" so we get the right include file.

Adapt "usr.sbin/fstyp/Makefile" to get the right include file.
2019-06-22 09:48:39 +00:00
hannken
9c87a63a8c Disable assertion: illumos 7793 ztest fails assertion in dmu_tx_willuse_space 2019-06-21 10:59:50 +00:00
skrll
ebc5b22cbe Toolify 2019-06-20 14:33:04 +00:00
hannken
1c4272293a Sync with upstream r315983. 2019-06-19 08:18:01 +00:00
kamil
3c0a7f49e5 Drop unused retval pointer from do_sys_mknod{,at}()
No functional change intended.
2019-06-18 22:34:25 +00:00
hannken
490062b29c Add native vfs_suspend()/vfs_resume() before and after
zfs_suspend_fs()/zfs_resume_fs() and get rid of dead "z_sa_hdl == NULL"
znodes before vfs_resume() to keep the vnode cache consistent.

Live rollback should work now.

PR port-xen/54273 ("zpool create pool xbd2" panics DOMU kernel)
2019-06-17 08:09:57 +00:00
hannken
77431910a1 Unmap pages when zfs_rezget() re-establishes a znode with its dbufs. 2019-06-17 08:08:50 +00:00
hannken
566111e6f4 Add fstrans_start()/fstrans_done() and bounds check to zfs_netbsd_getpages(). 2019-06-17 08:08:21 +00:00
hannken
3202242d92 Skip atime update on dead "z_sa_hdl == NULL" znodes. 2019-06-17 08:07:56 +00:00
kamil
2b1dd5795a Fix build with -Wgnu-designator in the ZFS code
struct buf buf = { b_bcount: MAXPHYS }; is a legacy style designator
extension and this raised a compiler error reported by a.rin@mix.
2019-06-12 04:20:18 +00:00