Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (4h)  netbsd-8 (5d)  netbsd-10 (5d)  netbsd-9 (11d)  thorpej-ifq (175d)  thorpej-altq-separation (178d) 

2024-05-10 07:42:32 UTC Now

2024-04-25 11:25:09 UTC MAIN commitmail json YAML

Increase length of set description to 40 characters so recent additions fit.

Ok: martin@

Fixes PR install/58188 "sysinst fails to display status of base32 set"

(hannken)

2024-04-12 14:22:51 UTC MAIN commitmail json YAML

Files libgcc_eh_g.a and libgcc_s_g.a are debuglib, not debug.

(hannken)

2024-04-06 09:51:34 UTC MAIN commitmail json YAML

Use "%zu" for type "size_t".  Kernel ALL/i386 compiles again.

(hannken)

2024-03-31 14:56:41 UTC MAIN commitmail json YAML

Using a ccd(4) with GPT (dk* at ccd*) the disk framework will call
ccdstrategy() -> ccdstart() -> ccdbuffer()  from softint context.
Allocating the buffer with PR_WAITOK here is forbidden.

Change ccdstart() / ccdbuffer() to report failure back to caller and
pass PR_WAITOK / PR_NOWAIT as an additional argument.

Call ccdstart() with PR_NOPWAIT from ccdstrategy() and on error defer
to the kthread.  Call ccdstart() with PR_WAITOK from kthread so requests
from kthread always succeed to allocate the buffers.

Remove the (non working) throttling on low memory as it is no longer needed.

Fixes PR kern/58043 "kernel crash in assert_sleepable() in -current,
dk(4) driver?"

(hannken)

2024-02-03 15:26:35 UTC MAIN commitmail json YAML

cd9660_mountroot: must initialize new args "fmask" and "dmask".

(hannken)

2024-01-17 10:21:01 UTC MAIN commitmail json YAML

Remove all procfs nodes for this process on process exit.

(hannken)

2024-01-17 10:20:12 UTC MAIN commitmail json YAML

Using the exechook to revoke procfs nodes is racy and may deadlock:

one thread runs doexechooks() -> procfs_revoke_vnodes() and wants to suspend
the file system for vgone(), while another thread runs a forced unmount,
has the file system suspended, tries to disestablish the exechook and
waits for doexechooks() to complete.

Establish/disestablish the exechook on module load/unload instead
mount/unmount and use the hashmap to access all procfs nodes for this pid.

May fix PR kern/57775 ""panic: unmount: dangling vnode" while umounting procfs"

(hannken)

2024-01-17 10:19:21 UTC MAIN commitmail json YAML

2024-01-17 10:18:41 UTC MAIN commitmail json YAML

Protect kernel hooks exechook, exithook and forkhook with rwlock.
Lock as writer on establish/disestablish and as reader on list traverse.

For exechook ride "exec_lock" as it is already take as reader when
traversing the list.  Add local locks for exithook and forkhook.

Move exec_init before signal_init as signal_init calls exechook_establish()
that needs "exec_lock".

PR kern/39913 "exec, fork, exit hooks need locking"

(hannken)

2024-01-17 10:17:29 UTC MAIN commitmail json YAML

Print dangling vnode before panic() to help debug.

PR kern/57775 ""panic: unmount: dangling vnode" while umounting procfs"

(hannken)

2023-12-28 12:49:06 UTC MAIN commitmail json YAML

Initialize mutex fileassoc_global.lock.

(hannken)

2023-12-28 12:48:09 UTC MAIN commitmail json YAML

Include "veriexec.h" and <sys/verified_exec.h> to run
veriexec_unmountchk() on "NVERIEXEC > 0".

(hannken)

2023-11-27 16:13:59 UTC MAIN commitmail json YAML

Restore kpause() accidentially removed with last commit.

(hannken)

2023-11-27 10:03:40 UTC MAIN commitmail json YAML

Implement and use an iterator over LRU lists.

Replace the vdrain kernel thread with two threadpool jobs,
one to process deferred vrele and
one to keep the number of allocated vnodes below limit.

(hannken)

2023-11-06 12:18:59 UTC MAIN commitmail json YAML

Print the inode numbers of persistent snapshots.

PR kern/57675 "persistent file system snapshots aren't obvious"

(hannken)

2023-11-06 12:17:50 UTC MAIN commitmail json YAML

As the number of allocated vnodes goes beyond 106% of desiredvnodes
start throttling threads allocating new vnodes at a rate of ~100 new
vnodes per second and thread.

(hannken)

2023-11-06 12:16:52 UTC MAIN commitmail json YAML

Undo the DPRINTFN part of the last commit.  It breaks i386 at least
when KERNHIST_LOG casts the pointer to uintmax_t.

Kernel ALL/i386 compiles again.

(hannken)

2023-06-15 09:15:54 UTC MAIN commitmail json YAML

Undo unlock/relock for VOP_IOCTL().

PR kern/57450 (unplugging hung USB disk triggers panic via _vstate_assert)

(hannken)

2023-06-15 09:15:13 UTC MAIN commitmail json YAML

2023-06-15 09:13:36 UTC MAIN commitmail json YAML

VOP_IOCTL() is a wrapper around spec_ioctl() aka Xdev_ioctl() and
protected with spec_io_enter()/spec_io_exit() so there is no need
to force specific vnode locking.

Set locking requirement to '= = =' (unchanged, locked or unlocked).

PR kern/57450 (unplugging hung USB disk triggers panic via _vstate_assert)

(hannken)

2023-05-28 08:17:00 UTC MAIN commitmail json YAML

Add RUMPHIJACK option "blanket=/DEV" so mount_ffs may canonicalise
and mount the device path.  Cannot use "/rump/DEV" here as the device
path is embedded in "struct ufs_args" where it doesnt get hijacked.

(hannken)

2023-05-23 20:07:21 UTC MAIN commitmail json YAML

Set PID path back to "/var/run/unbound.pid" so rc scripts work again.

Ok: Christos Zoulas

PR bin/57242 unbound rc.d script does not work with chrooted unbound

(hannken)

2023-04-22 14:30:54 UTC MAIN commitmail json YAML

Remove unused mount member mnt_transinfo.

Ride 10.99.4

(hannken)

2023-04-22 14:30:17 UTC MAIN commitmail json YAML

Remove unused specdev member sd_rdev.

Ride 10.99.4

(hannken)

2023-04-06 09:49:12 UTC MAIN commitmail json YAML

Fix StaticSpinMutex::CheckLocked() on sparc32.

The lock gets set with atomic_exchange() -> __sync_lock_test_and_set()
which sets the value to 255 instead of 1.  Check for a taken lock
with "!= 0" instead of "== 1".  This should work on all architectures.

Ok: Matthew Green

(hannken)

2023-04-05 07:41:38 UTC MAIN commitmail json YAML

Fix StaticSpinMutex::CheckLocked() on sparc32.

The lock gets set with atomic_exchange() -> __sync_lock_test_and_set()
which sets the value to 255 instead of 1.  Check for a taken lock
with "!= 0" instead of "== 1".  This should work on all architectures.

Ok: Matthew Green

(hannken)

2023-03-22 21:14:46 UTC MAIN commitmail json YAML

Pass B_PHYS when reading from device.  Xbd(4) at least checks
this flag and may trigger an assertion.

(hannken)

2023-03-21 08:31:30 UTC MAIN commitmail json YAML

Use "sigjmp_buf loc" after switch to sigsetjmp()/siglongjmp().

Fixes errors and aborts on sparc at least.

(hannken)

2023-03-20 11:19:30 UTC MAIN commitmail json YAML

Adjust pc/npc before syscall allowing EJUSTRETURN to return
to the next instruction.  Only ERESTART should return to
the same instruction.  Differences to sparc64 reduced.

Test t_ptrace_wait:syscallemu1 now passes on sparc.

Fixes PR kern/52166 "syscallemu does not work on sparc (32-bit)"

Ok: Martin Husemann

(hannken)

2023-03-14 12:55:43 UTC MAIN commitmail json YAML

Do not limit the number of pending requests for the worker thread.

With wedge on vnd it prevents a deadlock when requests get queued with
biodone() -> dkstart() -> vndstrategy().

Fixes PR kern/57263 "vnd locks up when using vn_rdwr"

(hannken)

2023-03-03 10:02:51 UTC MAIN commitmail json YAML

Fix genfs_can_chtimes() to also handle the condition:

  If the time pointer is null, then write permission
  on the file is also sufficient.

From FreeBSD.

Should fix PR kern/57246 "NFS group permissions regression"

(hannken)

2023-03-03 10:01:31 UTC MAIN commitmail json YAML

Adapt zfs_netbsd_access() to ACL support.  As ZFS itself only
handles VREAD, VWRITE, VEXEC and VAPPEND we use kauth_authorize_vnode()
to handle VADMIN.

From FreeBSD.

(hannken)

2023-02-13 08:39:40 UTC MAIN commitmail json YAML

When mounting a union file system set its lower mount only on success.

Reported-by: syzbot+b81b69971581b4f4db00@syzkaller.appspotmail.com

(hannken)

2023-02-06 10:33:32 UTC MAIN commitmail json YAML

Set IMNT_MPSAFE only if all lower layers have it set.

(hannken)

2023-02-06 10:32:58 UTC MAIN commitmail json YAML

Set IMNT_MPSAFE only if the lower layer has it set.

(hannken)

2023-01-13 15:46:40 UTC MAIN commitmail json YAML

It is not sufficient to have a comment /* Sanity check the size. */,
also check the size is greater than zero and a multiple of DEV_BSIZE.

Reported-by: syzbot+318187e5124846542f8d@syzkaller.appspotmail.com

(hannken)

2023-01-03 18:30:33 UTC MAIN commitmail json YAML

One more fix to build binutils with read-only source trees:

don't try to rebuild .../dist/binutils/doc/c++filt.1

Ok: Matthew Green

(hannken)

2023-01-02 20:49:59 UTC MAIN commitmail json YAML

2023-01-02 16:08:13 UTC MAIN commitmail json YAML

Change getdiskinfo() to no longer infer the partition from the device name.
Since 2016-06-16 we create disk devices "<type><<unit>" as an alias
for "<type><<unit><part>" where "<part>" is the raw partition.
These devices are treated as invalid partitions and a zero geometry
is returned.

Take the partition from "st_rdev" instead.

Fix for PR kern/57134: st_size of stat on vnd raw partition sometimes
is 0, causing newfs to fail

(hannken)

2022-12-20 09:40:09 UTC MAIN commitmail json YAML

When partitioning a mbuf chain with m_split() the last mbuf of the returned
tail chain is not necessarily the same as the last mbuf of the initial chain.

Always set "slp->ns_rawend" to the last mbuf of the tail chain to prevent
mbuf leaks and corruption.

(hannken)

2022-12-09 10:33:18 UTC MAIN commitmail json YAML

Harden layered file systems usage of field "mnt_lower" against
forced unmounts of the lower layer.

- Dont allow "dead_rootmount" as lower layer.

- Take file system busy before a vfs operation walks down the stack.

Reported-by: syzbot+27b35e5675b1753cec03@syzkaller.appspotmail.com
Reported-by: syzbot+99071492e3de2eff49e9@syzkaller.appspotmail.com

(hannken)

2022-11-21 10:37:14 UTC MAIN commitmail json YAML

When testing whiteout support on the underlying file system
union_mount() should not use a NULL componentname as not all
file systems can handle it.

Use static { LOOKUP, NOCRED } componentname instead.

Reported-by: syzbot+ecda308a1dd9652836d0@syzkaller.appspotmail.com
Reported-by: syzbot+9b687847ee5f43e94ca3@syzkaller.appspotmail.com
Reported-by: syzbot+9f9d1a841734f9f50de2@syzkaller.appspotmail.com

(hannken)

2022-11-10 10:55:01 UTC MAIN commitmail json YAML

If built with DEBUG Limit the depth of file system stack so kernel sanitizers
may stress mount/unmount without exhausting the kernel stack.

(hannken)

2022-11-10 10:54:14 UTC MAIN commitmail json YAML

Tmpfs_mount() uses tmpfs_unmount() for cleanup if set_statvfs_info() fails.
This will not work as tmpfs_unmount() needs a suspended file system.

Just call set_statvfs_info() before allocating the root vnode and add
and use a common error exit label.

Reported-by: syzbot+343f2bfea65a32ab4222@syzkaller.appspotmail.com

(hannken)

2022-11-10 10:53:29 UTC MAIN commitmail json YAML

Some changes to "fs->fs_fmod" and "fs->fs_clean":
- clear "fs->fs_fmod" after reading the super block.
- assert we don't write a super block when mounted read-only.
- make sure "fs->fs_clean" is one of FS_ISCLEAN or FS_WASCLEAN.
- print "file system not clean" on every mount.

Should fix PR kern/57010: ffs: mounting unclean non-root fs read-only
causes spurious write to superblock

(hannken)

2022-11-04 11:20:40 UTC MAIN commitmail json YAML

2022-08-26 11:03:53 UTC MAIN commitmail json YAML

Two defects in vfs_getnewfsid():

- Parallel mounts may get the same fsid.  Always increment "xxxfs_mntid"
  to make it unlikely.

- Directly walk "mountlist" to prevent a rare deadlock where one thread
  holds a vnode locked, calls vfs_getnewfsid() and the iterator has to
  wait for a suspended file system while the thread suspending needs
  this vnode lock.

(hannken)

2022-08-22 13:57:24 UTC MAIN commitmail json YAML

Sprinkle "#include <machine/pmap_private.h>", kernel ALL/amd64
compiles again.

(hannken)

2022-08-22 09:14:59 UTC MAIN commitmail json YAML

Use fstrans_start()/fstrans_done() to cross the mount in lookup_crossmount().
It is sufficient here as it prevents the file system from unmount and
makes it safe to use VFS_ROOT() here.

Removes a rare deadlock where one thread has "foundobj" locked and waits
for "foundobj->v_mountedhere" to resume while the thread holding the file
system suspended tries to lookup a node and needs a lock on "foundobj".

(hannken)

2022-08-22 09:14:24 UTC MAIN commitmail json YAML

Protect changing "v_mountedhere" with file system suspension instead
of vnode lock.

(hannken)

2022-08-22 09:13:08 UTC MAIN commitmail json YAML

Don't allocate lwp info for fstrans_held() and fstrans_is_owner().
If it doesn't exist we cannot hold a transaction or suspension.

(hannken)

2022-08-13 17:46:26 UTC MAIN commitmail json YAML

When run from py-anita/amd64 this test fails with:

  cgdconfig: getfsspecname failed: no match for `wd0e'

as the virtual machine has root on dk0, dk0 at wd0 and trying to
open wd0e fails.

This tests runs without a rump kernel and therefore should not
even try to open configured devices on the host.  Replace the
disks "wd0e" and "ld1e" with non-existant disks "dska" and "dskb".

(hannken)

2022-08-11 10:17:44 UTC MAIN commitmail json YAML

Finish previous, evaluate the lowest mount on first access
to "struct mount_info" and store it here so we no longer
derefence the "struct mount" from fstrans_alloc_lwp_info().

Reported-by: syzbot+5a79214d043395b550d8@syzkaller.appspotmail.com

(hannken)

2022-07-08 07:44:18 UTC MAIN commitmail json YAML

Make dead vfs ops "vfs_statvfs" and "vfs_vptofh" return EOPNOTSUPP.
Both operations may originate from (possible dead) vnodes.

Reported-by: syzbot+eceb203d44457742be3b@syzkaller.appspotmail.com

(hannken)

2022-07-08 07:43:48 UTC MAIN commitmail json YAML

Don't use LK_RETRY as we need an active vnode here.

(hannken)

2022-07-08 07:43:19 UTC MAIN commitmail json YAML

Suspend file system after VFS_MOUNT() and before taking mnt_updating.
Prevents deadlock against concurrent unmounts of layered file systems.

(hannken)

2022-07-08 07:42:47 UTC MAIN commitmail json YAML

While one thread runs vgone() it is possible for another thread to grab
a "v_mount" that will be freed before it uses this mount for fstrans_start().

Add a hashtab to lookup our private mount data "fstrans_mount_info" and
use "mp" as an opaque key for lookup.

Reported-by: syzbot+54dc9ac0804a97b59bc6@syzkaller.appspotmail.com

(hannken)

2022-07-08 07:42:06 UTC MAIN commitmail json YAML

Handle IMNT_GONE on the file system we want suspended not its
lowest mount we really suspend.

(hannken)

2022-07-06 15:24:14 UTC MAIN commitmail json YAML

Add missing brace.

(hannken)

2022-06-29 16:33:09 UTC MAIN commitmail json YAML

Synchronize SYS_SYSCALL() with other syscall implementations and
call trace_exit() even if trace_enter() returned an error.

PR kern/52166 "syscallemu does not work on sparc (32-bit)"
PR toolchain/56117 "New test failures on amd64 since switch to gcc10"

(hannken)

2022-06-24 16:50:00 UTC MAIN commitmail json YAML

Remove an incorrect assertion.

Just issue a readahead near the end of the vnode and enqueue an async read.
Now let nfs_setattr() truncate the vnode, set its new size and
nfs_vinvalbuf() waits for the pages from the readahead to become unbusy.

The async read gets processed and returns with uio_resid > 0 because there
is a hole and no write after the hole has been pushed yet.  As the vnode
size already got truncated to the new size the KASSERT() incorrectly fires.

(hannken)

2022-06-17 09:00:08 UTC MAIN commitmail json YAML

Remove now obsolete "#define DEFSWAPSIZE (-1)" to fix the build.

(hannken)

2022-06-15 08:31:34 UTC MAIN commitmail json YAML

Set provider to NULL -- "pam" is not a valid security key helper library.
Now ssh-agent no longer fails key addition with

    error: Cannot add provider: RSA is not an authenticator-hosted key

(hannken)

2022-06-01 08:42:38 UTC MAIN commitmail json YAML

tmpfs_read: respect MNT_NOATIME.

(hannken)

2022-05-22 08:59:34 UTC MAIN commitmail json YAML

Use PRIxBUSADDR for bus_addr_t in debug printf.

Kernel i386/ALL compiles again.

(hannken)

2022-05-03 13:55:29 UTC MAIN commitmail json YAML

2022-05-03 13:54:18 UTC MAIN commitmail json YAML

Really depend the lockdebug checks on option VNODE_LOCKDEBUG -- were
enabled by accident.

(hannken)

2022-05-03 08:35:11 UTC MAIN commitmail json YAML

2022-05-03 08:34:00 UTC MAIN commitmail json YAML

Make option VNODE_LOCKDEBUG more functional.

- Add "LOCKED=EXCL" option for vnode operations needing exclusive locked nodes.

- As it is impossible to check for shared locks held by current thread avoid
  false assertions by testing for exclusive lock only in the "LOCKED=NO" case.

- New option "RUMP_VNODE_LOCKDEBUG" enables VNODE_LOCKDEBUG for the rump kernel.

(hannken)

2022-05-03 07:36:20 UTC MAIN commitmail json YAML

Lock vnode for VOP_LOOKUP().

(hannken)

2022-05-03 07:35:43 UTC MAIN commitmail json YAML

No IO_NODELOCKED for unlocked vnode.

(hannken)

2022-05-03 07:34:38 UTC MAIN commitmail json YAML

Lock devvp for kauth KAUTH_REQ_SYSTEM_MOUNT_DEVICE.

(hannken)

2022-05-03 07:33:07 UTC MAIN commitmail json YAML

2022-04-27 17:38:52 UTC MAIN commitmail json YAML

As VOP_GETATTR() needs a shared lock at least move the preopattr lookup
inside nfs_namei() where we may lock the start directory without violating
the lock order.

(hannken)

2022-04-26 15:39:00 UTC MAIN commitmail json YAML

As the quota type comes from the kernel and is only valid when
quota is on get the type before quota_off and after quota_on.

(hannken)

2022-04-26 15:37:25 UTC MAIN commitmail json YAML

Keep flag "UFS_QUOTA" set until the last quota is closed.

Prevents a live lock when dqrele() finds a struct with "dq_cnt == 1"
and flag "DQ_MOD" and cannot sync as flag UFS_QUOTA is unset.

(hannken)

2022-04-26 15:36:42 UTC MAIN commitmail json YAML

Fix default quota file names, both user and group quota used the
same default name "QUOTAFILENAME, names[USRQUOTA])" resulting in
diagnostic assertion and possibly corrupted quota data.

(hannken)

2022-04-24 10:35:15 UTC MAIN commitmail json YAML

Cast read()/write() result to size_t to make this compile again.

(hannken)

2022-04-24 09:55:48 UTC MAIN commitmail json YAML

Add missing argument to debug printf.

(hannken)

2022-04-23 16:22:23 UTC MAIN commitmail json YAML

2022-04-16 08:00:55 UTC MAIN commitmail json YAML

Unlock vnode for VOP_IOCTL() and wapbl_flush().

(hannken)

2022-04-16 07:59:46 UTC MAIN commitmail json YAML

Take the link count from the inode.

(hannken)

2022-04-16 07:59:02 UTC MAIN commitmail json YAML

Lock vnode for VOP_PATHCONF().

(hannken)

2022-04-16 07:58:21 UTC MAIN commitmail json YAML

Lock vnode for vinvalbuf().

(hannken)

2022-04-16 07:57:33 UTC MAIN commitmail json YAML

Unlock vnode for VOP_IOCTL().

(hannken)

2022-04-16 07:56:45 UTC MAIN commitmail json YAML

2022-03-30 08:26:45 UTC MAIN commitmail json YAML

_rtld_map_object(): no need to mmap an empty bss segment.

(hannken)

2022-03-27 20:18:05 UTC MAIN commitmail json YAML

Make mmap() with "len == 0" an error if not MAP_ANON.  We should return
an error for MAP_ANON too but unfortunately our /libexec/ld.elf_so
sometimes creates an empty anon mapping for the bss of a shared library.

At least FreeBSD and Solaris return this error too and according to POSIX
"If len is zero, mmap() shall fail and no mapping shall be established".

Fixes PR pkg/56338 Installing qt5-qtdeclarative leaves a dangling reference

The dangling reference here originates from vn_mmap() taking a vnode
reference for this empty mapping that will never be released.

(hannken)

2022-03-25 08:57:51 UTC MAIN commitmail json YAML

Prevent memory corruption from wg_send_handshake_msg_init() on
LP64 machines with "MSIZE == 256", sparc64 for example.

wg_send_handshake_msg_init() tries to put 148 bytes into a buffer
of 144 bytes and overwrites 4 bytes following the mbuf.  Check
for "sizeof() > MHLEN" and use a cluster in this case.

With help from Taylor R Campbell <riastradh@>

(hannken)

2022-03-25 08:57:15 UTC MAIN commitmail json YAML

It is impossible for VOP_LOCK() to return ENOENT with LK_RETRY flag.
Remove the second call to VOP_LOCK().

Enable assertion "vrefcnt(vp) > 0" and assert all possible errors
for all LK_RETRY/LK_NOWAIT combinations.

(hannken)

2022-03-25 08:56:36 UTC MAIN commitmail json YAML

As VV_LOCKSWORK is gone remove LOCKSWORK from VNODE_FLAGBITS string.
Also convert illegal octal number 18 to 20.

(hannken)

2022-03-19 13:53:33 UTC MAIN commitmail json YAML

2022-03-19 13:52:45 UTC MAIN commitmail json YAML

Remove now unused genfs_nolock(), genfs_nounlock() and genfs_noislocked().

(hannken)

2022-03-19 13:52:11 UTC MAIN commitmail json YAML

2022-03-19 13:51:35 UTC MAIN commitmail json YAML

2022-03-19 13:51:01 UTC MAIN commitmail json YAML

2022-03-19 13:50:28 UTC MAIN commitmail json YAML

Lock vnode across VOP_OPEN.

(hannken)

2022-03-19 13:50:02 UTC MAIN commitmail json YAML

Lock vnode across VOP_OPEN.

(hannken)

2022-03-19 13:49:21 UTC MAIN commitmail json YAML

Lock vnode across VOP_OPEN/VOP_IOCTL/VOP_CLOSE.

(hannken)

2022-03-19 13:48:42 UTC MAIN commitmail json YAML

Switch MFS device node to real vnode locking, VV_LOCKSWORK now.

(hannken)

2022-03-19 13:48:04 UTC MAIN commitmail json YAML

As FSTRANS is part of VOP_*LOCK() since June 4, 2017 the vdead_check()
from union_lock() is no longer needed.

Adapt union_lock() to the recent addition of upgrade or downgrade.

VV_LOCKSWORK now.

(hannken)

2022-03-15 15:27:43 UTC MAIN commitmail json YAML

vrelel(): No need to test usecount if VGET marker is clear.
Assert "usecount == 1" instead.

(hannken)

2022-03-09 08:43:28 UTC MAIN commitmail json YAML

vrelel(): after all locks are in place check for new reference again.

Should fix assertion "vp->v_iflag & VI_TEXT" under load.

(hannken)

2022-02-28 08:45:36 UTC MAIN commitmail json YAML

Revert the hack from the last commit now that VOP_UNLOCK()
no longer may hold v_interlock or vmobjlock.

(hannken)

2022-02-28 08:44:04 UTC MAIN commitmail json YAML

vrelel(): no VOP_UNLOCK() with v_interlock or vmobjlock held.

(hannken)

2022-02-21 17:07:45 UTC MAIN commitmail json YAML

Fix wrong assertion, the negatiopn of "a && b" is "!a || !b" so we
need "DIP(ip, blocks) != 0" here.

Should fix PR kern/56725 (Panic when ls directory with device nodes
on an older ffs)

(hannken)

2022-02-17 14:39:51 UTC MAIN commitmail json YAML

Do the space accounting before VOP_INACTIVE() so we may
unlock the vnode after VOP_INCATIVE().

This was the last call from vrelel() to VOP_UNLOCK() with v_interlock held.

(hannken)

2022-02-17 14:39:14 UTC MAIN commitmail json YAML

Add a marker VUSECOUNT_VGET to v_usecount that gets set whenever
vcache_vget() or vache_tryvget() succeeds.

Use it to rerun VOP_INACTIVE() if another thread ran a vget()..vrele()
cycle while we inactivated our last reference.

(hannken)

2022-02-17 14:38:06 UTC MAIN commitmail json YAML

If the vnode to vrelel() is already reclaimed there is no need
to lock or defer it.  Jump straight to decrement usecount and requeue.

(hannken)

2022-02-11 10:55:15 UTC MAIN commitmail json YAML

A component name is a counted string (cn_nameptr, cn_namelen),
not a zero terminated string cn_nameptr.

Change the following operations to work with counted strings:

v7fs_file_lookup_by_name()
v7fs_file_allocate()
v7fs_file_deallocate()
v7fs_directory_add_entry()
v7fs_directory_remove_entry()
v7fs_file_rename()
v7fs_file_link()
v7fs_dirent_filename()

Adapt all vnode operations with component names as argument.

(hannken)

2022-02-10 10:59:12 UTC MAIN commitmail json YAML

Remove the assertion "searchdir != foundobj" from lookup_crossmount().

It will trigger whenever we lookup "." on a directory that becomes
mounted

    fd = open("/mnt")
    mount(..., "/mnt", ...)
    fd2 = openat(fd, ".")

or

    Unlocked searchdir gets mounted mounted on between
    lookup_fastforward()/lookup_once() and the test for
    foundobj->v_mountedhere.

May address syzkaller:

Reported-by: syzbot+9197ac681ce50f707d9a@syzkaller.appspotmail.com
Reported-by: syzbot+eb4854df8ee3c9bc278d@syzkaller.appspotmail.com
Reported-by: syzbot+3cc5b4126ab554f145d3@syzkaller.appspotmail.com
Reported-by: syzbot+7eae48a3ea952efee8c8@syzkaller.appspotmail.com
Reported-by: syzbot+b7f662083ccf8be3e669@syzkaller.appspotmail.com

(hannken)

2022-02-08 08:57:11 UTC MAIN commitmail json YAML

Operation vfs_suspend() returns ENOENT if the mount is gone (IMNT_GONE).

Adjust the KASSERT() appropriately.

(hannken)

2022-02-05 17:32:59 UTC MAIN commitmail json YAML

Initialize "replun" -- found with KMSAN.

(hannken)

2022-02-04 15:33:57 UTC MAIN commitmail json YAML

Stop clearing "v_mountedhere" in mount_domount() error path.

We did not set it and may clear the value from another mount.

(hannken)

2022-01-11 11:10:46 UTC MAIN commitmail json YAML

Use a single "p" variable.

Should fix PR kern/56614: kernel panic on tmux

(hannken)

2022-01-01 11:57:44 UTC MAIN commitmail json YAML

Protect KASSERT() with "#ifdef DIAGNOSTIC" as its expression is
undefined otherwise.

(hannken)

2022-01-01 11:56:15 UTC MAIN commitmail json YAML

Remove an "#ifdef DIAGNOSTIC", KASSERT() always conumes its expression.

(hannken)

2021-12-23 17:13:13 UTC MAIN commitmail json YAML

Disable amdgpu as it uses floating point arithmetics and subr_kcov
doesnt handle it.

Ok: riastradh@

(hannken)

2021-12-23 17:11:41 UTC MAIN commitmail json YAML

Initialize crtc_state to suppress false warning it may be used uninitialized.

Ok: riastradh@

(hannken)

2021-12-23 17:09:25 UTC MAIN commitmail json YAML

2021-12-23 17:05:49 UTC MAIN commitmail json YAML

Keep constants 32 bit, why does __BIT() return uintmax_t?

(hannken)

2021-12-10 09:20:38 UTC MAIN commitmail json YAML

Fix previous, don't copy up if the underlying node is unreadable.

(hannken)

2021-12-05 16:16:58 UTC MAIN commitmail json YAML

In union_access() copy up regular files before checking permissions.

Unionfs is meant to provide a writable layer above a read-only layer
and should not fail here just because the lower layer is mounted
read-only.

(hannken)

2021-11-25 14:17:22 UTC MAIN commitmail json YAML

Consistently use "drvctl -l qemufwcfg0" to check if
running under qemu in general.

(hannken)

2021-11-21 09:35:39 UTC MAIN commitmail json YAML

Test kernel/kqueue/t_timer, subtests abstime, basic_timer and timer_units
often fail when run on QEMU because QEMU misses clock interrupts.

Always check timespec against expected "tv_sec" and use an "4 * tv_sec"
upper bound when run under QEMU.

Now becomes part of PR kern/43997 "Kernel timer discrepancies".

(hannken)

2021-11-13 14:52:08 UTC MAIN commitmail json YAML

If lookup_fastforward() loses an intermediate searchdir, has to roll
back and retry it must use the initial searchdir from *searchdir_ret
for lookup_parsepath().

(hannken)

2021-11-07 09:22:58 UTC MAIN commitmail json YAML

Libtsan intercepts the pthread exported functions with
dlsym(RTLD_NEXT, func_name).  This fails for pthread_join() as it
is present both as a stub in libc and as real operation in libpthread
and the search order is "libtsan.so libc.so libpthread.so".

Force the order "libtsan.so libpthread.so libc.so" so symbols
get intercepted from libpthread first.

Ok: Matthew Green <mrg@netbsd.org>

(hannken)

2021-11-01 14:33:42 UTC MAIN commitmail json YAML

Test lib/libc/sys/t_timerfd often fails when run on QEMU because
QEMU misses clock interrupts.

Always check values against [ lower, upper ] bounds and use "4 * upper"
when run under QEMU.

Now becomes part of PR kern/43997 "Kernel timer discrepancies".

(hannken)

2021-10-30 13:43:40 UTC MAIN commitmail json YAML

Obvious typo ':' -> ';'.

(hannken)

2021-10-30 09:53:47 UTC MAIN commitmail json YAML

With the recent "centralize vnode kevent handling" kevent(2) no
longer raises NOTE_LINK when removing a hard linked node.

It now behaves as FreeBSD and raises NOTE_DELETE.

Adapt the test to the new behaviour.

(hannken)

2021-10-23 17:43:08 UTC MAIN commitmail json YAML

After converting msdosfs_rename() to use genfs_sane_rename() the
MSDOS tests should pass.

Tested on QEMU/nvmm archs i386 and amd64.

Should resolve PR kern/43626 (directory renaming more than a little racy)

(hannken)

2021-10-23 07:45:03 UTC MAIN commitmail json YAML

Convert msdosfs_rename() to use genfs_sane_rename().

Based on work by Taylor R Campbell.

(hannken)

2021-10-23 07:41:38 UTC MAIN commitmail json YAML

2021-10-23 07:38:33 UTC MAIN commitmail json YAML

2021-10-18 08:15:00 UTC MAIN commitmail json YAML

Use a local static variable to hold "pktq_rps_hash_default"
like the other devices do.

Kernel ALL/amd64 compiles again.

OK: Kengo NAKAHARA <knakahara@netbsd.org>

(hannken)

2021-10-02 07:35:41 UTC MAIN commitmail json YAML

Fix a deadlock where one thread writes to a pipe, has more data
and no space in the pipe and waits on "pipe_wcv" while the reader
is closing the pipe and waits on "pipe_draincv".

Swap the test for "PIPE_EOF" and the "cv_wait_sig()" in "pipe_write()".

PR bin/56422 "zgrep -l sometimes hangs"

(hannken)

2021-08-23 13:08:18 UTC MAIN commitmail json YAML

Return immediately from uvm_swap_shutdown() if there are
no (more) swap devices configured.

(hannken)

2021-07-17 15:37:04 UTC MAIN commitmail json YAML

Mark vlan_safe_ifpromisc_locked() as "__unused" to appease LLVM.

Maybe completely remove this short helper?

(hannken)

2021-07-04 11:25:07 UTC MAIN commitmail json YAML

Add VOP_PARSEPATH to zfs control dir vnode op table.

(hannken)

2021-07-04 11:24:09 UTC MAIN commitmail json YAML

Fix union_parsepath(), either the upper or the lower dvp may be NULL.

(hannken)

2021-06-08 10:02:04 UTC MAIN commitmail json YAML

Document NFSSVC_REPLACEEXPORTSLIST instead of NFSSVC_SETEXPORTSLIST.

The latter is deprecated and kept only for backwards compatibility.

(hannken)

2021-06-07 14:07:32 UTC MAIN commitmail json YAML

Bitmaps (TS_BITS and TS_CLRI) dont use the "c_addr" array as they
cannot have holes.  As bitmaps are written without TS_ADDR records
"c_count" may be larger than the "c_addr" size resulting in a
segmentation violation reading "c_addr" beyond its end.

Compute "blks" for TS_INODE and TS_ADDR only -- its used for multi
volume dumps and the bitmaps must both be on the first volume.

(hannken)

2021-06-05 08:26:34 UTC MAIN commitmail json YAML

Fix typo, its the element not the array ...

(hannken)

2021-06-04 10:48:07 UTC MAIN commitmail json YAML

Test "mountdhup" has to pass now.

(hannken)

2021-06-04 10:46:57 UTC MAIN commitmail json YAML

Change get_exportlist() to collect all exports and emit all
exports for a single mount in one call to nfssvc(2).

Should finally fix PR kern/5844 (NFS server sends "permission denied"
while mound re-read exports).

(hannken)

2021-06-04 10:46:01 UTC MAIN commitmail json YAML

Restructure do_nfssvc() and simplify the left cases GT_HOST and GT_NET.

Add a helper add_export_arg() that emits a single export_args item and
does the IPv6 check.
Always use the path of the mount point for the export.

(hannken)

2021-06-04 10:44:59 UTC MAIN commitmail json YAML

Add flag/command NFSSVC_REPLACEEXPORTSLIST to nfssvc(2) system call.

Works like NFSSVC_SETEXPORTSLIST but supports "mel_nexports > 1"
and will atomically update the complete exports list for a file system.

(hannken)

2021-05-21 17:32:49 UTC MAIN commitmail json YAML

Replace the Solaris style endian check (exactly one of
_LITTLE_ENDIAN or _BIG_ENDIAN is defined) with standard check
"#if BYTE_ORDER == BIG_ENDIAN" like we do it elseware.

Should fix PR 56191 (ZFS tests fail on sparc64)

(hannken)

2021-05-18 11:02:58 UTC MAIN commitmail json YAML

Make this compile without DIAGNOSTIC.

(hannken)

2021-05-18 08:59:44 UTC MAIN commitmail json YAML

Remove a superfluous VOP_GETATTR() from elf_load_interp() and replace
the LK_EXCLUSIVE lock with a LK_SHARED lock.

The attributes requested were not used since Rev 1.25 of exec_elf32.c
from 1997/05/08 when mycroft GCd the va_mode check.

(hannken)

2021-05-13 08:57:29 UTC MAIN commitmail json YAML

ntfs_loadntnode(): Use bread() when ntm_sysvn[NTFS_MFTINO] is NULL.

May happen when loading node 0 (MFT) during mount and some
attributes are stored in another ntnode.

PR kern/56160 (Mount ntfs usb disk)

(hannken)

2021-05-07 09:54:43 UTC MAIN commitmail json YAML

Track the number of cdev and bdev opens and fail dm_detach()
on open devices unless detach is forced.

PR kern/54969 (Disk cache is no longer flushed on shutdown)

(hannken)

2021-05-07 09:53:39 UTC MAIN commitmail json YAML

Make sure the unit number of device-mapper devices matches their minor number.

(hannken)

2021-05-01 15:08:14 UTC MAIN commitmail json YAML

Make sure fdesc_lookup() never returns VNON vnodes.

Should fix PR kern/56130 (fdescfs create nodes with wrong major number)

(hannken)

2021-04-21 10:02:34 UTC MAIN commitmail json YAML

Prevent blocking l2arc_feed_thread() forever, skip the
cv_timedwait() for negative or zero ticks.

(hannken)

2021-02-19 13:20:44 UTC MAIN commitmail json YAML

When turning off swap during reboot we have to lock with LK_RETRY
as regular files got reclaimed during unmount.

Adresses PR kern/54969 (Disk cache is no longer flushed on shutdown)

(hannken)

2021-02-16 10:02:42 UTC MAIN commitmail json YAML

Enable "/etc/zfs/exports" from "zfs share" in rc.d/mountd and rc.d/mountall.

(hannken)

2021-02-16 10:00:27 UTC MAIN commitmail json YAML

Add support for multiple exports files. This will be useful for example for
ZFS, where we have an automatically generated /etc/zfs/exports file, which
should not be edited directly.

(hannken)

2021-02-16 09:58:35 UTC MAIN commitmail json YAML

Split get_exportlist() into get_exportlist() and get_exportlist_one()
in preparation to support multiple input files.

No functional change intended.

(hannken)

2021-02-16 09:56:32 UTC MAIN commitmail json YAML

Reorganize uvm_swap_shutdown() a bit, make sure the vnode gets
locked and referenced across the call to swap_off() and finally
use it from vfs_unmountall1() to remove swap after unmounting
the last file system.

Adresses PR kern/54969 (Disk cache is no longer flushed on shutdown)

(hannken)

2021-02-16 09:54:17 UTC MAIN commitmail json YAML

Use the right uid / gid for nobody:nobody like FreeBSD does.

Prevents null pointer dereferences when ZFS replaces this
illegal (according to IS_EPHEMERAL()) id with another
illegal id in operation zfs_fuid_create_cred() and
finally zfs_log_create() dereferences fuidp being NULL.

Adresses PR misc/55042 (Panic when creating a directory on a NFS served ZFS)

(hannken)

2020-11-20 10:08:47 UTC MAIN commitmail json YAML

When validating the mount device string make sure its length
is below *data_len and below PATH_MAX.

Reported-by: syzbot+2d3af801141509cc858c@syzkaller.appspotmail.com

(hannken)

2020-11-19 10:47:47 UTC MAIN commitmail json YAML

We have to ignore interrupts when suspending here the same way
we have to do with revoke.

Reported-by: syzbot+0cfb253b382a9836450a@syzkaller.appspotmail.com

(hannken)

2020-11-19 10:45:37 UTC MAIN commitmail json YAML

Bozohttpd clobbers files greater than 4GB on 32bit archs.

Make sure the alignment mask derived from pagesize is an off_t.

(hannken)

2020-11-18 16:13:34 UTC MAIN commitmail json YAML

Make this at least compile.
Looks like a missing part from "Round of uvm.h cleanup (2020-09-05 18:30)".

(hannken)

2020-11-14 11:42:56 UTC MAIN commitmail json YAML

Rewrite coda_readdir() to directly process the container file.

Passing this operation down to the file system holding the container
cannot work for anything but UFS and UFS doesn't allow reading
directory from a plain file since ~2015.

Fixes PR kern/55775 Coda client, its in-kernel part, opens wrong files ...

(hannken)

2020-11-14 11:42:05 UTC MAIN commitmail json YAML

Add coda_pathconf() always returning EINVAL.

(hannken)

2020-11-14 11:41:29 UTC MAIN commitmail json YAML

Respect "lktype" in all paths in coda_root().

(hannken)

2020-10-13 13:15:39 UTC MAIN commitmail json YAML

Suspend file system before unmounting in mount_domount() error path
to prevent diagnostic assertions from unmount/flush.

Reported-by: syzbot+8d557f49c8b7888182eb@syzkaller.appspotmail.com
Reported-by: syzbot+e87fe1e769a3426d9bf3@syzkaller.appspotmail.com
Reported-by: syzbot+9c5b86e651e98c5bf438@syzkaller.appspotmail.com
Reported-by: syzbot+610b614af0d66179ca78@syzkaller.appspotmail.com
Reported-by: syzbot+7818ff113a1535ebc724@syzkaller.appspotmail.com

(hannken)

2020-10-12 08:21:21 UTC MAIN commitmail json YAML

Stub groupmember() has to test both group list and current group id.

Fixes kern/55675: ZFS mounts do not work with setuid programs

(hannken)

2020-08-28 16:13:48 UTC MAIN commitmail json YAML

Glue operation secpolicy_fs_mount() passes wrong arguments to
operation kauth_authorize_system().

KAUTH_SYSTEM_MOUNT / KAUTH_REQ_SYSTEM_MOUNT_NEW wants the to be
covered vnode and the mount flags, not the mount structure.

Fix for PR kern/55602: zpool panic on mounting zfs filesystem

(hannken)

2020-08-28 07:29:00 UTC MAIN commitmail json YAML

Another typo -- its vfs_newvnode().

(hannken)

2020-08-27 09:57:34 UTC MAIN commitmail json YAML

2020-08-18 09:44:07 UTC MAIN commitmail json YAML

Operation union_readdirhook() stores the lower directory as un_uppervp.
This breaks the assumption that un_uppervp->v_mount is the upper mount.

Fix by storing the directory as un_lowervp and adapt union_readdir().

Should fix PR kern/55552: panic with union mount

(hannken)

2020-05-26 08:39:27 UTC MAIN commitmail json YAML

Replace vp->v_count with vrefcnt(vp) and
remove now unneeded "#define v_count ...".

(hannken)

2020-05-24 10:42:28 UTC MAIN commitmail json YAML

2020-05-20 12:47:36 UTC MAIN commitmail json YAML

Suppress GCC warnings and fix a UVMHIST_LOG() statement.

Kernels ALL/amd64 and ALL/i386 and port sparc64 build again.

(hannken)

2020-05-18 08:30:06 UTC MAIN commitmail json YAML

2020-05-18 08:29:34 UTC MAIN commitmail json YAML

VOP_STRATEGY() may still deadlock with devices.

Change FSTRANS from LAZY to NO.

(hannken)

2020-05-18 08:28:44 UTC MAIN commitmail json YAML

Assert ufs_strategy() always gets used while current thread
holds a fstrans lock.

(hannken)

2020-05-18 08:27:54 UTC MAIN commitmail json YAML

vrele_flush(): yield() every 100ms like we do it in vflush().

(hannken)

2020-05-16 17:42:07 UTC MAIN commitmail json YAML

Add __diagused, amd64 kernel ALL compiles again.

(hannken)

2020-05-13 09:21:30 UTC MAIN commitmail json YAML

Add operation fstrans_held(struct mount *), true if the current thread
holds a fstrans lock.

Ride 9.99.61

(hannken)

2020-05-07 09:13:06 UTC MAIN commitmail json YAML

Operation zfs_zget_cleaner() cannot fail, comment and add assertions.

(hannken)

2020-05-07 09:12:32 UTC MAIN commitmail json YAML

Revert Rev. 1.31 as it is no longer possible for the handle to be NULL.

(hannken)

2020-05-07 09:12:03 UTC MAIN commitmail json YAML

Revert Rev. 1.63 and add a comment why we have to zil_commit() here:

Operation zfs_znode.c::zfs_zget_cleaner() depends on this
zil_commit() as a barrier to guarantee the znode cannot
get freed before its log entries are resolved.

(hannken)

2020-05-01 14:16:15 UTC MAIN commitmail json YAML

Use PRIxPADDR for paddr_t to make i386/ALL compile.

(hannken)

2020-05-01 14:15:41 UTC MAIN commitmail json YAML

Remove wd* at umass?, it was dropped.

(hannken)

2020-05-01 08:45:01 UTC MAIN commitmail json YAML

Undo Rev. 1.79, it breaks root-on-raid where it destroys the component
disks before the raid:

  forcefully unmounting / (/dev/raid0a)...
  sd1: detached
  sd0: detached
  raid0: cache flush to component /dev/sd0a failed.
  raid0: cache flush to component /dev/sd1a failed.
  fatal page fault in supervisor mode
  Stopped in pid 2356.2356 (reboot) at netbsd:sdstrategy+0x36

Reopens PR kern/54969: Disk cache is no longer flushed on shutdown

(hannken)

2020-05-01 08:43:37 UTC MAIN commitmail json YAML

There is no difference between a zero-sized and not yet
reclaimed directory vnode and a non-existent vnode.

Teach ufs_fhtovp() to treat zero-sized directories as stale.

PR kern/55211 (fs/vfs/t_vnops:nfs_dir_rmdirdotdot test fails)

(hannken)

2020-05-01 08:43:00 UTC MAIN commitmail json YAML

Resolve delayed truncation from nfs_inactive() too.

Should prevent "locking against self" from nfs_unlock().

(hannken)

2020-04-19 13:26:18 UTC MAIN commitmail json YAML

Destroy anonymous device vnodes on reboot once the last file system
got unmounted and the mount list is empty.

PR kern/54969: Disk cache is no longer flushed on shutdown

(hannken)

2020-04-19 13:25:00 UTC MAIN commitmail json YAML

Take some pressure from vdrain lock:

- Use cv_signal() instead of cv_broadcast(), there is only one waiter.
- No need to signal if number of vnodes doesn't increase.
- Use kpause(1) instead of yield().

(hannken)

2020-04-06 14:31:06 UTC MAIN commitmail json YAML

udf_get_node(): fix typo and honor "lktype" argument.

(hannken)

2020-03-20 08:26:01 UTC MAIN commitmail json YAML

With zfs_netbsd_reclaim() no longer doing an unconditional
zil commit dmu_buf_get_user() may return a NULL handle when
the znode already disappeared.

(hannken)

2020-02-13 16:53:32 UTC MAIN commitmail json YAML

zfs_netbsd_setattr: ignore size changes on device nodes.

(hannken)

2019-12-03 11:50:45 UTC MAIN commitmail json YAML

Make sure the assignment to "idepth" is done inside the loop to prevent
preemption between loop end and dereference of "l_cpu->ci_depth".

(hannken)

2019-12-03 11:50:16 UTC MAIN commitmail json YAML

Make cpu_intr_p() work with "curlwp->l_cpu == NULL" and
assert "curlwp == &lwp0" in this case.

Prevents crash during early boot with "options LOCKDEBUG".

(hannken)

2019-11-08 11:06:21 UTC MAIN commitmail json YAML

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

(hannken)

2019-10-24 08:21:18 UTC MAIN commitmail json YAML

With TLSv1.3 a client has to receive and process metadata.

Update dispatch_tls_eof() to check for metadata and
rearm on success.

Ok: christos@

(hannken)