Age | Commit message (Collapse) | Author |
|
udp_send() and following udp{,6}_output() do not append packets to
`so_snd' socket buffer. This mean the sosend() and sosplice() sending
paths are dummy pru_send() and there is no problems to simultaneously
run them on the same socket.
Push shared solock() deep down to sesend() and take it only around
pru_send(), but keep somove() running unedr exclusive solock(). Since
sosend() doesn't modify `so_snd' the unlocked `so_snd' space checks
within somove() are safe. Corresponding `sb_state' and `sb_flags'
modifications are protected by `sb_mtx' mutex(9).
Tested and OK bluhm.
|
|
ok miod@ mlarkin@
|
|
ok mglocker@
|
|
nfs_getreq() is in nfs_socket.c and not called from nfs_vnops.c
|
|
while here, ensure all vop_remove field are set, and always call the function.
the change is very conservative: it only adds vnode ref drop/unlock where it was
absent because it should be unreachable (and if it wasn't, it should fix
things).
ok miod@
|
|
|
|
|
|
ok miod@
|
|
ok miod@ mpi@
|
|
This is a no-op since we only care about the low 12 bits in NFS anyway.
ok jsg@ semarie@
|
|
ok jsg@ semarie@
|
|
appropriate extra arguments.
This (hopefully) completes the unmessyfication work started by thib@ a long,
long time ago (in a galaxy far away).
The conversion logic has been:
- nfsm_dissect has been turned into an rvalue expression, leaving the
cast operation up to its caller.
- macros which had three different exit paths (return, goto nfsmout or
fallthrough) have been split so that no macros have more than two exit paths.
- then they have been modified to return a value, which lets the caller
figure out what exit path is needed.
- local variables abused by the macros are now local variables of the new
inline functions.
This single commit is the sum of 25 intermediate diffs, which have all been
carefully reviewed by (at least) jsg@ and semarie@.
Tested with v2 and v3 servers and clients.
ok jsg@ semarie@
|
|
platforms.)
ok mpi@
|
|
Unfortunately, this is recommended by rfc 2623 and used by Linux
nfs-utils to mount NFS exports. So until nfs-utils switches into
using reserved ports, this is needed to mount OpenBSD file-systems
on most (all?) Linux distros.
Bits from claudio, ok millert
|
|
no functional change, found by smatch warnings
ok miod@ bluhm@
|
|
sbappend*() and soreceive() of SB_MTXLOCK marked sockets uses `sb_mtx'
mutex(9) for protection, meanwhile buffer usage check and corresponding
sbwait() sleep still serialized by solock(). Mark udp(4) as SB_OWNLOCK
to avoid solock() serialization and rely to `sb_mtx' mutex(9). The
`sb_state' and `sb_flags' modifications must be protected by `sb_mtx'
too.
ok bluhm
|
|
checks from all the filesystems that support hardlinks at all into
the VFS layer. Simplify, EPERM description in link(2).
ok miod@ mpi@
|
|
For TCP connections do the check when adding the socket via nfssvc(2).
For UDP do the check early after soreceive().
On top of this limit the sockets added via nfssvc(2) to IPv4 TCP and UDP
sockets.
OK millert@ deraadt@
|
|
solock() is still held because other 'sockbuf' members require it, but
in so{g,s}etopt() paths solock() is avoided.
ok bluhm
|
|
If the server doesn't close the socket immediately and starts waiting
for the client to reconnect, then the TCP connection will remain open.
The client will have to wait for the connection to be closed in order
to reconnect with the same source port; this never happens, resulting
in a freeze until the file system is umounted.
This change fixes Linux NFS clients freezing after 5 min of inactivity.
ok miod, help from claudio
|
|
mechanical 'selinfo' to 'klist' replacement in 'vnode' structure because
knote(9) API is already used.
<sys/selinfo.h> headers added where is was required.
ok bluhm
|
|
This movement required because buffers related SO_SND* and SO_RCV*
socket options should be protected with sblock(). However, standalone
sblock() has different lock order with solock() and `so_snd' and
`so_rcv' buffers. At least sblock() for `so_snd' buffer will always be
taken before solock() in the sosend() path.
The (*pr_ctloutput)() call was removed from the SOL_SOCKET level 'else'
branch. Except the SO_RTABLE case where it handled in the special way,
this is null op call.
For SO_SND* and SO_RCV* cases solock() will be replaced by sblock() in
the future.
Feedback from bluhm
Tested by bluhm naddy
ok bluhm
|
|
noticed by miod@
ok kettenis@
|
|
ok claudio@ kettenis@
|
|
ok miod@ millert@
|
|
This is helpful for the following (*pr_usrreq)() split to multiple
handlers. But right now this makes code more readable.
Also add '#ifndef _SYS_SOCKETVAR_H_' to sys/socketvar.h. This prevents the
collisions when both sys/protosw.h and sys/socketvar.h are included
together. Both 'socket' and 'protosw' structures are required to be
defined before pru_*() wrappers, so we need to include sys/socketvar.h to
sys/protosw.h.
ok bluhm@
|
|
Buffer cache related struct vnode fields can be accessed in interrupt
context. Be more consistent with the use of splbio().
OK mpi@
|
|
Make the silly file removal happen after the vnode has been unlocked.
This avoids a file-directory reversal in the vnode locking order.
OK jca@
|
|
OK mpi@
|
|
for the lock operation and to pass a value to the unlock operation.
sofree() still needs an extra flag to know if sounlock() should be called
or not. But sofree() is called less often and mostly without keeping the lock.
OK mpi@ mvs@
|
|
ok kettenis@
|
|
Tested in snaps for a week.
OK bluhm@
|
|
OK bluhm@
|
|
no binary change
|
|
net/if_pppx.c pointed out by jsg@
ok gnezdo@ deraadt@ jsg@ mpi@ millert@
|
|
OK stsp@ (without assuming any responsibility for NFS)
|
|
ok jmc@
|
|
Pass the device vnode as a parameter to VOP_STRATEGY() to allow calling
the correct vop_strategy callback. Now the vnode is also available
in the callback.
OK mpi@
|
|
Make __EV_POLL specific to kqueue-based poll(2), to remove overlap
with __EV_SELECT that only select(2) uses.
OK millert@ mpi@
|
|
(both kernel and userland bits)
GENERIC + VFSLCKDEBUG is broken with it.
|
|
This flag is currently used to mark or unmark a vnode to actively
check vnode locking semantic (when compiled with VFSLCKDEBUG).
Currently, VLOCKSWORK flag isn't properly set for several FS
implementation which have full locking support. This commit enable
proper checking for them too (cd9660, udf, fuse, msdosfs, tmpfs).
Instead of using a particular flag, it directly check if
v_op->vop_islocked is nullop or not to activate or not the vnode
locking checks.
ok mpi@
|
|
use VOP_LOCK / VOP_UNLOCK wrappers.
VOP_LOCK() is prefered over vn_lock() here in order to keep equivalent code.
ok mpi@ visa@ (as part of larger diff)
|
|
It replaces spec_badop, fifo_badop, dead_badop and mfs_badop, which
are only calls to panic(9), to one unique function vop_generic_badop().
No intented behaviour changes (outside the panic message which isn't
the same).
ok mpi@
|
|
|
|
ok dlg@
|
|
We can simulate the current behavior without lbolt by sleeping for 1
second on the &nowake channel.
ok mpi@
|
|
Rename klist_{insert,remove}() to klist_{insert,remove}_locked().
These functions assume that the caller has locked the klist. The current
state of locking remains intact because the kernel lock is still used
with all klists.
Add new functions klist_insert() and klist_remove() that lock the klist
internally. This allows some code simplification.
OK mpi@
|
|
valid valuse of tv_sec but an invalid value for tv_nsec.
Noticed by guenther@. ok beck@ deraadt@
|
|
timestamps.
This issue was iscovered after rsync 3.2 changed behaviour on an NFS
mounted partition.. Change lifted from NetBSD (r 1.204).
ok beck@, kn@, deraadt@
|
|
we expected. Remove the `else' path from nfs_boot_init(). If
`nfsbootdevname' is not set something goes wrong and this is the panic
condition. Also we exclude the case where we can get `ifp' which we don't
expect.
OK mpi@
|