summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_socket.c
AgeCommit message (Collapse)Author
2009-10-19antsyJonathan Gray
no binary change apart from nfsm_reqhead() which is clearly correct. ok thib@
2009-08-25move to having requests on a per nfsmount tailq instead of one global one.Thordur I. Bjornsson
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@
2009-08-10Remove the v2 writegather code. It did help alot back in the 80sThordur I. Bjornsson
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@
2009-08-04group all of the on-stack variables that are uses by the nfsm_macrosThordur I. Bjornsson
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@.
2009-07-30make sure we only ever try to read out post-op attributesThordur I. Bjornsson
or wcc data if we have a proper reply. found the hard way by ariane@, tested by ariane@. OK blambert@
2009-07-22Instead of calculating a number of seconds to sleep, tsleep()ing onBret Lambert
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@
2009-07-20(struct foo *)0 -> NULL, every where I could find it.Thordur I. Bjornsson
OK blambert@
2009-07-20For memory that gets allocated for every NFS request, pools make moreBret Lambert
sense than malloc. ok thib@, who says the puffin still gets it either way
2009-07-18if -> in, and the sentance makes more sense.Thordur I. Bjornsson
2009-07-18Fixes for the NFSERR_RETERR commit.Thordur I. Bjornsson
- 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@
2009-07-13Make the callers of nfs_request() responsible for freeing the reply mbuf,Thordur I. Bjornsson
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@.
2009-06-04typo; init -> in itBret Lambert
ok thib@
2009-06-03remove cruft that snuck in with previousThordur I. Bjornsson
2009-06-03Lift the NFS over UDP retransmit logic from FreeBSD.Thordur I. Bjornsson
OK blambert@ FreeBSD commit message: Refactor the NFS over UDP retransmit timeout estimation logic to allow the estimator to be more easily tuned and maintained. There should be no functional change except there is now a lower limit on the retransmit timeout to prevent the client from retransmitting faster than the server's disks can fill requests, and an upper limit to prevent the estimator from taking to long to retransmit during a server outage.
2009-06-02give the retransmission count booking keeping a facelift,Thordur I. Bjornsson
just store the maximun amount of rexmits in one place and cleanup. Also make sure this only effects soft mounts. OK blambert@
2009-05-30Remove unused procnums (NQNFS leftovers) and cleanup.Thordur I. Bjornsson
OK blambert@ sometime ago
2009-05-22retire the nfs rtt log code, this isnt really all thatThordur I. Bjornsson
usefull, and has been disabled for a long long time. Cleans house a bit. OK blambert@
2009-05-15nicer (unique) wmesg for the tsleep(9) in nfs_reconnect();Thordur I. Bjornsson
2009-02-22fix PR 6082: do not create more fd's than will fit in the message onOtto Moerbeek
the receiving side when passing fd's. ok deraadt@ kettenis@
2009-01-24Use a timespec for the server write deadline and procrastinationThordur I. Bjornsson
timeouts. Rrids us of the ugly cur_sec variable, and some shadows. Also helps with granularity. Diff from blambert@ who asked me to commit this since he's away for some days and we wanted to put this in with the timespec changes in the nfsnode.
2009-01-24magic 8 -> nitems(nfs_backoff)Thordur I. Bjornsson
prompted by David <dunnoseriously _att_ gmail.com>
2009-01-22After the NFS server had sent a reply of size readsize or readdirsize,Alexander Bluhm
the udp receive space got completely filled up. Even if the next packet from the server was a small reply, it got dropped by udp_input(). After a second the client resent the NFS request. Doubling rcvreserve reduces the chance of retransmits by having enough recv space for multiple NFS replies even if there comes a big one. found with pedro@, ok blambert@, thib@, pedro@
2009-01-22The variable nfs_reqq was protected by splsoftnet() only in 3 outAlexander Bluhm
of 5 cases. In the functions nfs_reconnect() and nfs_reply() put the TAILQ_FOREACH over nfs_reqq also inside splsoftnet() protection. found with pedro@, ok blambert@, pedro@, thib@
2009-01-20Start reworking NFS client mbuf handling by creating an interface whichBret Lambert
requires well-formed mbuf chains to work. Existing function name is now a wrapper to this interface. Much, much more work to follow which will build on this. Truly change we can believe in. ok thib@, who would have preferred this in two commits, but I'm impatient :) testing on multiple arches (i386, arm, amd64, and sparc64 at least) by many, thanks to all who did so
2009-01-16turn nfs_msg into void functions, also make it take an nfsreqThordur I. Bjornsson
argument since all of the info we need is there, makes it and the use it a tad bit nicer. ok blambert@
2008-12-24Replace the TRUE/FALSE defines with 1/0 respectively. This doesn'tThordur I. Bjornsson
hurt readability and it was just plain annoying seeing them defined in every other .c file. OK blambert@
2008-10-31Revert last commit; mbuf leaks are not solved by double-freeing mbuf chainsBret Lambert
blambert@-- Real solution is to fix NFS mbuf handling.
2008-10-26Plug mbuf leak in RPC record error case.Bret Lambert
ok thib@
2008-09-12move the declaration of nfsrv3_procs to nfs_syscalls.cThordur I. Bjornsson
ok blambert@
2008-07-10nuke two bogus ARGSUSEDThordur I. Bjornsson
2008-07-05When waking an nfs daemon, use wakeup_one vice wakeup, asBret Lambert
a) we're attempting to wake a specific process which b) sleeps on a unique address which means that there's no need to continue traversing the sleep queue once the process has been found and awakened. "looks good too me" thib@
2008-07-05Remove R_GETONEREP and the code that checks if its setThordur I. Bjornsson
(its never set). "please kill it" blambert@
2008-06-14Replace magic '2' and '3' with defines for nfs version numbersThordur I. Bjornsson
ok blambert@
2008-06-14Clean up nfsrv_wakenfsd(); variable name change to be in line with theBret Lambert
rest of NFS code, canonical for() -> LIST_FOREACH() change, minor readability changes. ANSIfy function while here. ok thib@
2008-06-13Remove dead-end and never-used kerberos code in nfs. Future workBret Lambert
to support authentication other than AUTH_UNIX will replace this with a (hopefully) much better system. ok thib@
2008-06-12Remove now-vestigial bpos pointer from NFS. For building outgoingBret Lambert
NFS mbufs, mbufs now contain all their internal buffer state internally, the way god intended. ok thib@ testing johan@ (and possibly merdely@; this diff's been around for a bit...)
2008-06-11Canonical for() -> queue.h FOREACH macro conversions.Bret Lambert
Also, it is historical practice to #include <sys/queue.h> when using queue.h macros. ok thib@ krw@ special thanks to krw@ for reminders vice violence
2008-05-23Deal with the situation when TCP nfs mounts timeout and processesThordur I. Bjornsson
get hung in nfs_reconnect() because they do not have the proper privilages to bind to a socket, by adding a struct proc * argument to sobind() (and the *_usrreq() routines, and finally in{6}_pcbbind) and do the sobind() with proc0 in nfs_connect. OK markus@, blambert@. "go ahead" deraadt@. Fixes an issue reported by bernd@ (Tested by bernd@). Fixes PR5135 too.
2008-05-13don't grab the receive lock in nfs_rcvlock if the reply hasThordur I. Bjornsson
already been received while we slept. prevents processes from monopolising the lock. From FreeBSD; ok blambert@ tested by johan@ and a few others
2008-01-06More NFS-related kernel shrinkage...Bret Lambert
When you use a macro ~200 times, it tends to bloat your code, so make a function out of it. Shaves ~8.5 kB from my kernel. ok thib@, "looks good" krw@ In snaps for 1+ week with no negative reports.
2007-12-28nfs_sndlock() is often called with its rep argumentThordur I. Bjornsson
as NULL, so make sure its non-NULL before attempting to reference it. Fixes PR5694; Confirmed by submitter. OK art@, krw@
2007-10-28Remove the "frev" argument from nfs_rephead(); and clean up the "frev"Thordur I. Bjornsson
variables, that are declared all over, since they are passed via macros to nfs_rephead(); which doesn't do anything with it. OK krw@
2007-10-17use TAILQ_FOREACH() where applicable in nfs_timer();Thordur I. Bjornsson
ok art@, blambert@
2007-10-15Remove a set, but unused varible in nfs_socket();Thordur I. Bjornsson
NQNFS leftover. ok miod@,blambert@
2007-10-13Remove alot of dead kerberos code (add sane comments too).Thordur I. Bjornsson
Cleanup and partly redo the way we create the RPC header, by having nfsm_rpchead() do a bit more work. Right now this is pretty RPCAUTH_UNIX centric, but since it is the only auth method we support right now thats fine. Make sure we can never generate a zero xid, thats forbidden by the RFC. Misc cleanup. tested by a few.
2007-09-20Don't rely on mbuf.h including pool.h (which is going to stop soon)Bret Lambert
ok thib@ henning@ art@
2007-09-20MALLOC/FREE -> malloc/free + M_ZERO.Thordur I. Bjornsson
Uneeded includes and casts... ok krw@
2007-06-25replace magic number with a define.Thordur I. Bjornsson
(2 -> SHUT_RDWR in calls to soshutdown()). From Iruata Souza. ok deraadt@
2007-05-31when getting ESTALE from the server, allow the client to retry in theThordur I. Bjornsson
nfsv2 client case, this matches v3 behaviour to that extent. This is to work around the fact that when the namecache is large, we dont purge vnodes correctly out of it. ok beck@,pedro@
2007-04-24Dont log() send failures in nfs_send(), they arent helpful since we retryThordur I. Bjornsson
and recover for the client case (or terminate with EINTR if to many retries), and in the server case, if we cant send due to f.x network troubles its up to the client to retry not the server. (server not responding messages are logged in another place though). discussed with deraadt@