Age | Commit message (Collapse) | Author |
|
problem noticed by deraadt@
ok beck@
|
|
already been freed, thus make the callers of nfs_namei() bail out early,
instead of jumping to nfsmout as there they will try to vrele() vnodes
that don't exists (NULL pointers) and free the pathname buffer.
this is way nicer then adding checks after the nfsmout label.
OK blambert@
|
|
Tiny spacing nit.
Fix a typo, pointed out by miod@.
|
|
and worked members. nad_worked becomes NFSAIOD_WAKEUP, which is set after if
an aiod was removed from the idle list and woken up by nfs_asyncio().
don't rely on tsleep wchans being unique, that is keep going back to sleep if
woken up unless the NFSAIOD_WAKEUP flag is set.
fix a divide by zero crash if nfs.vfs.iothreads is set to 0, as that can happen
when we recalculate the maximum buf's to queue up for each aiod.
in nfs_asyncio() set the nad_mnt to NULL before returning the aiod back to the
idle list in the case where we have already queued up to many bufs, otherwise
we trip an assertion.
minimize the time we are holding the nfs_aiodl_mtx to only when we are inserting
or removing from the lists, with the exception of nfs_set_naiod() as it would
make the loops more complicated and its uncommon in any case.
tested by myself and deraadt@
"fine with me" deraadt@
|
|
before inserting it back into the list.
crashes debugged with help from deraadt@ who also tested this fix.
|
|
also make the rexmit timeout per nfsmount, and make sure to start/stop the
timer appropriately.
now the nfs_timer() only fires if there is work todo, not always at nfs_ticks
(it did, even if there where no nfsmounts in the system!).
OK blambert@
|
|
each mount, and when work is "found", peg an aiod to that mount todo the
I/O. Make nfs_asyncio() a bit smarter when deciding when to do asyncio
and when to force it sync, this is done by keeping the aiod's one two lists,
an "idle" and an "all" list, so asyncio is only done when there are aiods
hanging around todo it for us or are already pegged to the mount.
Idea liked by at least beck@ (and I think art@).
Extensive testing done by myself and jasper and a few others on various
arch's.
Ideas/Code from Net/Free.
OK blambert@.
|
|
and rewrite the nfsreq code to use pool_walk().
OK beck@, blambert@
|
|
What can happen is that a recycling of a vnode could pull one from out
under us (since NFS has issues with ref counts...).
Dance around getnewvnode() since we can end up recycling vnodes that
where formerly owned by NFS, causing recursive locking.
We where lucky with the old hashtables has the race was rare but now
with more aggresive recycling we loose, just as theo found out on vax.
help from oga, beck and blambert (beck mostly screamed though).
ok oga@, beck@, blambert@
|
|
ok thib@
|
|
ok thib@
|
|
ok thib@
|
|
use mbufs directly, but the shiny new nfsm_info struct
ok thib@
|
|
prodded by and ok thib@
agreed by art@ and blambert@
|
|
pointer since its just used in one place.
ok blambert@
|
|
- Prevent a double vrele() by setting the vnode pointer to NULL.
- Check if vnode pointers have been set to NULL before trying to
vrele().
- don't double free the component path name buffer.
- Add a workaround for multiple vnode pointers all pointing to the
same vnode and the code doing vrele() on all of them, leading to
botched refcounts. This is a horrible hack, but a real fix is being
worked on.
OK blambert@
|
|
Idea from NetBSD.
OK blambert@
|
|
error = operation();
memory = malloc();
if (error) free(memory);
gets relegated to the dustbin of history
ok thib@
|
|
but extensive performance benchmarking done by myself and jasper@
has shown that it doesn't help, at all - even on vaxens and in some
cases it makes things significantly slower.
"this excites me sexually" jetpack@
Tested by jasper@.
OK blambert@
|
|
High five from thib@
|
|
loop over allocating a chain of mbufs to store <= NFS_MAXPATHLEN
bytes.
Clean up some variables, which thib@ likes.
ok thib@
|
|
memory = malloc();
if (error) free(memory);
makes no sense; move error checking to above memory allocation
ok thib@
|
|
from it.
This can cause us to follow garbage in the nfsd loop, causing two kinds of hell.
problem noticed by nicm@. OK blambert@.
|
|
to keep the data munging "state" into an nfsm_info structure. Each
function now has this structure on its stack, and it and its members
are now passed around so that the macros/functions can work there magic.
this will make removing the nfsm_* macros way easier.
Idea/code picked up from DragonflyBSD.
Tested by krw@, jacekm@ and myself.
OK blambert@.
|
|
or wcc data if we have a proper reply.
found the hard way by ariane@, tested by ariane@.
OK blambert@
|
|
Even if we know that someone safely holds B_BUSY and will not modify
the buf (as was the case in here), we still need to be sure that
the B_BUSY will not be released while we fiddle with the buf.
In this case, it was not safe, since copyout can sleep and whoever was
writing out the buf could finish the write and release the buf which
could then get recycled or unmapped while we slept. Always acquire
B_BUSY ourselves, even when it might give a minor performance penalty.
thib@ ok
|
|
lbolt and waking up every second and checking to see if the correct
number of seconds has passed, just calculate the timeout once and
pass that to tsleep().
ok thib@
|
|
ok blambert@
|
|
OK blambert@
|
|
sense than malloc.
ok thib@, who says the puffin still gets it either way
|
|
|
|
- Make sure to set the mbuf pointers and the dpos pointer correctly
in nfs_request() before returning an error.
- Fix potential mbufs leaks in nfs_{read,write}rpc for v2. The reply
mbuf was not being freed before the jump to nfsmout.
- Reorder error handling to prevent an error case being treated as a
non-error case.
Fixes issues noticed by sthen@ and ajacoutot@. Tested by both of them.
Reviewd by oga@
OK blambert@
|
|
some error cases
ok thib@
|
|
by anyone besides nfsd(8).
ok blambert@
|
|
if the reply is an error and retire the NFS_RETERR hack. For NFSv3 mounts
the flag was set and reply mbuf not freed to allow the callers to handle
the post-op attributes, or just free the mbuf for NFSv2.
Tested by myself and jasper@ on various arch's.
OK blambert@.
|
|
which is exactly what the macro does.
Macro's that are nothing more then:
#define FUNCTION(arg) function(arg)
are almost always pointless and should go away.
OK blambert@
Agreed by many.
|
|
OK blambert@
|
|
where doing bremfree() befure calling buf_acquire().
This is causing us headache pinning down a bug that showed up
when deraadt@ too cvs to current, and will have to be done
anyway as a preperation for backouts.
OK deraadt@
|
|
ok thib@
|
|
actually get us anything.
ok thib@
|
|
ok thib@
|
|
Just put it in the buf_acquire function.
oga@ ok
|
|
"get it in" thib@
|
|
|
|
|
|
|
|
ok thib@
|
|
Diff from FreeBSD.
OK blambert@
|
|
ok thib@
|
|
error = foo();
if (!error)
bar();
is an alien construct; replace with one from this planet
ok thib@
|