Don't try to zget the parent, whose znode id may have been recycled
by now.
It's not clear to me how Solaris avoids this, but maybe I'm just
missing something obvious.
- Restore some zfs locking and unlocking that got lost randomly.
- Enable use of the BSD vnode lock. Lock order: all BSD vnode locks
are taken before all zfs internal locks. There remains an issue with
O_EXCL, to be solved later (famous last words). KASSERT the locking
scheme up the wazoo.
- Take our cruft out of zfs_lookup and move it to zfs_netbsd_lookup.
Restore much of the way zfs_lookup looked to make merging future
versions easier. Disable use of the namecache for now because its
locking dance is too scary to contemplate.
- Implement BSD semantics for rename, to appease our tests. This is
a provisional kludge; eventually we need VOP_RENAME to take a flag
specifying whether to use BSD semantics or POSIX semantics.
- Simplify zfs_netbsd_reclaim and make it work. Now that getnewvnode
never tries to vclean anything itself, we need not worry about
recursion of ZFS_OBJ_MUTEX locks.
- Clarify and fix genfs node initialization and destruction.
zfs passes most of our atf vfs tests now, including the rename races.
Still to do:
- fix the impedance mismatch between our permissions model and zfs's;
- fix O_EXCL (nontrivial);
- throw dirconc at it and see how badly it explodes;
- find why zpool sometimes wedges itself during mkfs; and
- find why pool caches sometimes seem to get corrupted.
Avoid cv_broadcast(&cv); cv_destroy(&cv); which works in Solaris only
by abuse of the condvar abstraction.
There are parts of this code that should be factored into smaller
subroutines, mainly range lock allocation and initialization, but
that would make it harder to merge newer versions of zfs, so for now
I've just expanded those parts further in-line.
Solaris relies on cv_broadcast(&cv); cv_destroy(&cv) working, but
that hoses our cv_wait, which needs to continue using cv after it is
woken. Solaris's idiom is an abuse of the condvar abstraction, but
we can get the same effect with reference counting.
rename "xcpu" back to "cpu" now that the conflicting global variable
has been renamed out of the way. this also fixes some cases
where references to the local variable "cpu" had not been renamed
and thus were accidentally referring to the former global "cpu".
caches, merge together pool_drain_start() and pool_drain_end() into
bool pool_drain(struct pool **ppp);
"bool" value indicates whether reclaiming was fully done (true) or not (false)
"ppp" will contain a pointer to the pool that was drained (optional).
See http://mail-index.netbsd.org/tech-kern/2012/06/04/msg013287.html
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)
releng@ acknowledged
GCC can generate bogus dwarf attributes with DW_AT_byte_size set to 0xFFFFFFFF.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35998 .
GCC is currently doing this for external/bsd/tmux/dist/compat/imsg-buffer.c:
readelf -a --debug-dump imsg-buffer.o
...
<2><6e3>: Abbrev Number: 32 (DW_TAG_union_type)
<6e4> DW_AT_byte_size : 0xffffffff
<6e8> DW_AT_decl_file : 1
<6e9> DW_AT_decl_line : 229
<6ea> DW_AT_sibling : <0x705>
This resulted in ctfconvert generating a faulty CTF entry which then caused the
segfault in ctfmerge.
The fix has ctfconvert check for the bogus 0xFFFFFFFF value and works around it.
It also adds some protection to ctfmerge to avoid the segfault and fail
more gracefully if the error should occur in the future.
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
for vdev. This makes ztest survive ztest_vdev_LUN_growth test. Replace dummy
VOP_GETATTR with vn_getattr routine which reset vp_size and vattr_size accordingly
to reality.
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.
Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).
The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.