summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_socket.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixes for the NFSERR_RETERR commit.thib2009-07-181-16/+8
| | | | | | | | | | | | | | - 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@
* Make the callers of nfs_request() responsible for freeing the reply mbuf,thib2009-07-131-16/+5
| | | | | | | | | 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@.
* typo; init -> in itblambert2009-06-041-2/+2
| | | | ok thib@
* remove cruft that snuck in with previousthib2009-06-031-2/+1
|
* Lift the NFS over UDP retransmit logic from FreeBSD.thib2009-06-031-65/+129
| | | | | | | | | | | | | | 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.
* give the retransmission count booking keeping a facelift,thib2009-06-021-15/+8
| | | | | | | just store the maximun amount of rexmits in one place and cleanup. Also make sure this only effects soft mounts. OK blambert@
* Remove unused procnums (NQNFS leftovers) and cleanup.thib2009-05-301-2/+1
| | | | OK blambert@ sometime ago
* retire the nfs rtt log code, this isnt really all thatthib2009-05-221-22/+2
| | | | | | | usefull, and has been disabled for a long long time. Cleans house a bit. OK blambert@
* nicer (unique) wmesg for the tsleep(9) in nfs_reconnect();thib2009-05-151-2/+2
|
* fix PR 6082: do not create more fd's than will fit in the message onotto2009-02-221-7/+9
| | | | the receiving side when passing fd's. ok deraadt@ kettenis@
* Use a timespec for the server write deadline and procrastinationthib2009-01-241-4/+2
| | | | | | | | | 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.
* magic 8 -> nitems(nfs_backoff)thib2009-01-241-2/+2
| | | | prompted by David <dunnoseriously _att_ gmail.com>
* After the NFS server had sent a reply of size readsize or readdirsize,bluhm2009-01-221-3/+3
| | | | | | | | | | | | 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@
* The variable nfs_reqq was protected by splsoftnet() only in 3 outbluhm2009-01-221-3/+7
| | | | | | | 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@
* Start reworking NFS client mbuf handling by creating an interface whichblambert2009-01-201-20/+35
| | | | | | | | | | | | | 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
* turn nfs_msg into void functions, also make it take an nfsreqthib2009-01-161-14/+10
| | | | | | | argument since all of the info we need is there, makes it and the use it a tad bit nicer. ok blambert@
* Replace the TRUE/FALSE defines with 1/0 respectively. This doesn'tthib2008-12-241-5/+2
| | | | | | | hurt readability and it was just plain annoying seeing them defined in every other .c file. OK blambert@
* Revert last commit; mbuf leaks are not solved by double-freeing mbuf chainsblambert2008-10-311-5/+2
| | | | | | blambert@-- Real solution is to fix NFS mbuf handling.
* Plug mbuf leak in RPC record error case.blambert2008-10-261-2/+5
| | | | ok thib@
* move the declaration of nfsrv3_procs to nfs_syscalls.cthib2008-09-121-32/+1
| | | | ok blambert@
* nuke two bogus ARGSUSEDthib2008-07-101-2/+1
|
* When waking an nfs daemon, use wakeup_one vice wakeup, asblambert2008-07-051-2/+2
| | | | | | | | | 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@
* Remove R_GETONEREP and the code that checks if its setthib2008-07-051-7/+2
| | | | | | (its never set). "please kill it" blambert@
* Replace magic '2' and '3' with defines for nfs version numbersthib2008-06-141-3/+3
| | | | ok blambert@
* Clean up nfsrv_wakenfsd(); variable name change to be in line with theblambert2008-06-141-11/+11
| | | | | | | | | rest of NFS code, canonical for() -> LIST_FOREACH() change, minor readability changes. ANSIfy function while here. ok thib@
* Remove dead-end and never-used kerberos code in nfs. Future workblambert2008-06-131-139/+9
| | | | | | | to support authentication other than AUTH_UNIX will replace this with a (hopefully) much better system. ok thib@
* Remove now-vestigial bpos pointer from NFS. For building outgoingblambert2008-06-121-10/+5
| | | | | | | | | 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...)
* Canonical for() -> queue.h FOREACH macro conversions.blambert2008-06-111-3/+3
| | | | | | | | | 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
* Deal with the situation when TCP nfs mounts timeout and processesthib2008-05-231-4/+4
| | | | | | | | | | | | | 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.
* don't grab the receive lock in nfs_rcvlock if the reply hasthib2008-05-131-7/+10
| | | | | | | | | | already been received while we slept. prevents processes from monopolising the lock. From FreeBSD; ok blambert@ tested by johan@ and a few others
* More NFS-related kernel shrinkage...blambert2008-01-061-5/+5
| | | | | | | | | | | 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.
* nfs_sndlock() is often called with its rep argumentthib2007-12-281-2/+2
| | | | | | | | | as NULL, so make sure its non-NULL before attempting to reference it. Fixes PR5694; Confirmed by submitter. OK art@, krw@
* Remove the "frev" argument from nfs_rephead(); and clean up the "frev"thib2007-10-281-3/+2
| | | | | | | variables, that are declared all over, since they are passed via macros to nfs_rephead(); which doesn't do anything with it. OK krw@
* use TAILQ_FOREACH() where applicable in nfs_timer();thib2007-10-171-8/+6
| | | | ok art@, blambert@
* Remove a set, but unused varible in nfs_socket();thib2007-10-151-5/+2
| | | | | | NQNFS leftover. ok miod@,blambert@
* Remove alot of dead kerberos code (add sane comments too).thib2007-10-131-59/+16
| | | | | | | | | | | | | 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.
* Don't rely on mbuf.h including pool.h (which is going to stop soon)blambert2007-09-201-1/+2
| | | | ok thib@ henning@ art@
* MALLOC/FREE -> malloc/free + M_ZERO.thib2007-09-201-4/+3
| | | | | | Uneeded includes and casts... ok krw@
* replace magic number with a define.thib2007-06-251-2/+2
| | | | | | | (2 -> SHUT_RDWR in calls to soshutdown()). From Iruata Souza. ok deraadt@
* when getting ESTALE from the server, allow the client to retry in thethib2007-05-311-2/+3
| | | | | | | | 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@
* Dont log() send failures in nfs_send(), they arent helpful since we retrythib2007-04-241-5/+2
| | | | | | | | | 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@
* Dont initialize the nm_srtt and nm_sdrtt arraysthib2006-10-281-4/+4
| | | | | | out of bounds. ok pedro@
* Fix the way delays between request retransmissions are calculatedthib2006-09-201-5/+8
| | | | | | | in the case where NFSERR_TRYLATER is received from the server. Adapted from NetBSD. ok pedro@, tedu@
* Fix up mbuf length and do 64-bit alignment where needed, joint workpedro2006-08-041-5/+54
| | | | with Nicholas Marriott <nicm__@ntlworld.com>, closes PR 5036
* Fix NULL dereference on error condition in nfs_reply(). nmp->nm_so canaaron2006-01-241-2/+3
| | | | | become NULL if the nfs_reply() -> nfs_receive() -> nfs_reconnect() datapath fails. pedro@ ok "I think this is a good fix"
* use pool for struct nfsreq; tedu@ pedro@ ok and testing by mark patruck <mark@2ls4agd.net> on several archsmickey2005-04-021-8/+8
|
* Use list and queue macros where applicable to make the code easier to read;miod2004-12-261-5/+5
| | | | no change in compiler assembly output.
* In nfs_connect() move the setting of so->so_rcv.sb_timeo out of themillert2004-12-101-11/+8
| | | | | if () else since it is common to both cases and makes the code clearer. OK pedro@
* on nfs_reconnect(), don't reset the rexmit of all nfs reqs, but onlypedro2004-07-141-4/+4
| | | | of those belonging to the given nfs mount. ok marius@, tedu@
* fix for where a TCP NFS connection could sleep in soreceive() forever,marius2004-07-101-4/+22
| | | | | | | this fixes some problems people have experienced with NFS mounts freezing on NFS server reboot/crash. ok deraadt@ pedro@ tholo@