Commit Graph

597 Commits

Author SHA1 Message Date
hannken 2595f06922 Drop v_interlock for zfs_range_lock(), another thread might hold part
of this range and wait for v_interlock.
2018-12-13 10:20:51 +00:00
hannken 398893d51c Operation zfs_range_lock() needs range as (offset,length), not as (low,high). 2018-12-13 10:20:20 +00:00
hannken 0b243f3ebe Don't allow module to init before mp_online. 2018-12-13 10:19:47 +00:00
sevan a8174c34c4 Describe how unaccounted changes are detected without Star Trek references, for
everyone in 2018.

Thanks to maya & gdt
2018-12-10 03:58:30 +00:00
christos ddcb7de5af fix printf warnings. 2018-12-09 18:01:01 +00:00
sevan 861b7e9a71 Spelling 2018-12-08 14:55:53 +00:00
wiz e1f1a9870c Improve man page. 2018-12-08 12:18:37 +00:00
sevan 23472bf8b1 Include ztest(1) in builds. 2018-12-08 01:47:21 +00:00
sevan ee544a8d7f Add a draft manual for ztest(1), based on the comments from zfstest.c (WIP). 2018-12-08 01:28:27 +00:00
hannken e9166d7318 We have component names as counted strings (cn_nameptr, cn_namelen) but
ZFS expects a null-terminated name.

Always create a copy with PNBUF_GET()/strlcpy()/PNBUF_PUT().

For LOOKUP use a small buffer on stack and allocate/free compomnent names
longer than 30 chars.
2018-12-06 10:00:40 +00:00
hannken b4b8646326 Add missing ZFS_OBJ_HOLD_ENTER() / ZFS_OBJ_HOLD_EXIT() to zfs_zget_cleaner(). 2018-12-06 09:58:52 +00:00
hannken 02397a5780 Zfs_write() may hide write errors if uiomove() succeeds but a
further dmu_tx_assign() fails because over quota or no space.

Use the emulated uiocopy() and uioskip() like illumos does.

Fix the uiocopy() emulation to not clobber the iovecs.
2018-11-30 09:53:40 +00:00
hannken 6ac427e315 Redo the access check for setting va_flags in zfs_netbsd_setattr().
Use user flag UF_NODUMP instead of UF_IMMUTABLE for the test as it
is the only user flag supported by all tested file systems.

PR kern/47656 test zfs_flags.
2018-11-28 10:01:28 +00:00
hannken e4ec60fc8e Add missing access check for REMOVE into zfs_netbsd_lookup().
PR kern/47656 test zfs_dirperms.
2018-11-28 09:58:58 +00:00
hannken 5cbc5ce853 Add missing access check for setting va_Xtime into zfs_netbsd_setattr().
PR kern/47656 test zfs_times.
2018-11-28 09:57:59 +00:00
hannken 1d96c4a33f We expect VOP_ACCESS() to return EACCESS as general error.
Change zfs_netbsd_access() to translate the common EPERM to EACCES.
2018-11-28 09:57:16 +00:00
hannken bc6110ce9c Don't try to release a NULL vnode in zfs_netbsd_rename(). 2018-11-28 09:56:40 +00:00
hannken 29da203472 Remove an early test for "source and target are equal" from zfs_rename()
that broke BSD semantics.
2018-11-28 09:56:09 +00:00
hannken 6d68550383 Add missing sa_buf_rele() into zfs_zget_cleaner(). 2018-11-28 09:55:36 +00:00
hannken 1f58a7d1b1 Always unbusy pages in zfs_putapage() after the data has been written
into the DMU.  Running fsx no longer hangs the kernel.
2018-11-28 09:55:06 +00:00
riastradh fe26b32950 Use callout_halt, not callout_stop, for FreeBSD callout_drain shim.
Callers expect callout_drain will wait for it to complete if it has
fired.
2018-11-15 05:43:57 +00:00
riastradh c3426bd36f Need <dev/mm.h> for mm_md_direct_mapped_phys.
It turns out this code always sees __HAVE_MM_MD_DIRECT_MAPPED_PHYS as
disabled on amd64, for reasons that I shall address forthwith, but it
is enabled on aarch64 and so the MKZFS=yes build breaks.
2018-11-15 04:55:49 +00:00
riastradh 6af8fc2044 Be consistent about _KERNEL vs _HARDKERNEL in zfs.
As it happens, on x86 both _HARDKERNEL and _KERNEL get defined; see
the conditional in sys/rump/Makefile.rump that _refrains_ from
defining _RUMPKERNEL on x86.

So the only version of this code that has been tested is the one with
all of it included.  But on, e.g., aarch64, we do not get _HARDKERNEL
here, and the code fails to build because some things use the field
struct spa::spa_deadman_cycid under _KERNEL when it is declared only
under _HARDKERNEL.

If there's a reason _not_ to use this in rump -- and it's not obvious
to me why -- then all access to the field needs to agree to use
_HARDKERNEL.
2018-11-15 04:55:38 +00:00
riastradh 3c01401a94 Omit unused definition with broken cpp conditional. 2018-11-15 04:55:26 +00:00
riastradh ec4edf7a44 Omit conflicting definition that breaks build on aarch64. 2018-11-15 04:55:17 +00:00
riastradh 30279c00db "PRIu64", not llu, to print uint64_t. 2018-11-15 04:55:06 +00:00
riastradh 44773f2a69 Define _LP64 or _ILP32 for all architectures.
Rather than write out a table for each architecture, rely on the C
compiler to define _LP64 for 64-bit ones, on the assumption that
anything not LP64 is ILP32, and on CTASSERTs to verify this
assumption so that if it's wrong it'll fail safely with a noisy build
failure.

Gives zfs half a chance of building on, e.g., powerpc.
2018-11-14 17:09:08 +00:00
christos 550eae4327 Avoid conflicts with "our" (the FreeBSD) nvpair/nvlist implementation by
prefixing all symbols with "opensolaris_".
2018-10-23 22:26:14 +00:00
christos b87aa2b0b0 prefix all nv* symbols with opensolaris_ 2018-10-23 22:25:21 +00:00
sevan 1982879545 Sync with version on Brendan's site
http://www.brendangregg.com/DTrace/iosnoop
2018-10-01 13:28:07 +00:00
sevan bee48df196 Fix comment markers.
https://github.com/opendtrace/toolkit/issues/11
2018-09-29 19:40:58 +00:00
martin b30151731a Do not initialize .vfs_fhtovp twice 2018-09-16 06:09:01 +00:00
christos be58bd6f37 The macros kidmap_getsidby{u,g}id always return 1 from sid.h on NetBSD,
and clang is complaining about the impossible... So initialize rid and
be done with it, it is the least intrusive fix.
2018-09-14 19:06:53 +00:00
christos 3085e9459c handle clang stupidity 2018-09-07 02:25:40 +00:00
christos 7c0e6d1ccc remove duplicate typedef (it is in sunddi.h) 2018-09-06 00:44:43 +00:00
riastradh d1579b2d70 Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)
2018-09-03 16:29:22 +00:00
christos 49c18b3098 Avoid uninitialized warning. 2018-08-20 06:47:16 +00:00
christos 54ddcf50a8 use the right variables (fix cut-n-pastos) 2018-08-18 12:00:11 +00:00
christos 3d1aec003a make sure rid and idx are initialized. 2018-08-18 11:59:25 +00:00
christos 4122fc0e66 vdev_inuse might not be called and spare_guid contains random stuff. 2018-08-18 11:58:59 +00:00
christos 2df913e657 get rid of kernelbase 2018-08-16 14:14:51 +00:00
christos bb6b99b5bf handle variable kernel vm min address 2018-08-12 16:07:27 +00:00
hannken 1471f8ff92 Initialize z_lockf for new znodes.
Ok: Chuck Silvers
2018-07-31 09:33:50 +00:00
maxv 753a273974 Replace KERN_BASE by VM_MIN_KERNEL_ADDRESS. Also add XXX on INKERNEL. 2018-07-27 07:32:59 +00:00
kamil cd35dc3d84 Rework the changes to DTRACE/ZFS files that were fixing Clang/LLVM build
Rever changes to upstream files and replace them with additional -Wno-
compiler argument flags.

Tested with base LLVM.

Requested by <chuq>
2018-06-29 11:33:46 +00:00
gson 7c2276b8da Use space between words 2018-06-16 15:18:33 +00:00
maya 93c55cb558 Avoid declaring ulonglong_t.
Comment here already says it isn't necessary and will be removed.
Hasten the process for us and avoid the problematic typedef.

This is useful because u_longlong_t would otherwise need to be
provided by compat headers.
2018-06-13 04:21:21 +00:00
kamil d2d2a14700 Replace HAVE_GCC with ACTIVE_CC == gcc checks
Kernel modules build with GCC and Clang/LLVM.

Requested by <joerg>
2018-06-07 13:21:44 +00:00
kamil 60490a027e Correct compilation of osnet/dev/systrace/systrace.c under Clang
Mark arguments to dtrace_probe_lookup() with __UNCONST().
The proper fix constifying it causes pollution of const in too many files.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 17:47:10 +00:00
kamil 3982d87926 Correct compilation of osnet/dev/profile/profile.c under Clang
Constify char* types when initialized with liternals.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>
2018-06-06 17:19:49 +00:00