summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_serv.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Prevent vrele() being called with a NULL argument if nfs_namei() returns ankettenis2012-03-211-6/+7
| | | | | | | | error in several places. Should fix the "vrele: null vp" panic that henning@ has been seeing lately. ok tedu@, krw@, deraadt@
* Rename lookup/relookup to vfs_lookup/vfs_relookup.thib2010-09-091-4/+4
| | | | OK oga@, beck@, matthew@
* Initialize various uninitialized variables. Found by jsg@ via Clang.krw2010-03-291-1/+3
| | | | | | Feedback from miod@ and kettenis@. ok beck@
* antsyjsg2009-10-191-123/+49
| | | | | | no binary change apart from nfsm_reqhead() which is clearly correct. ok thib@
* if nfs_namei() fails, there's no ni_startdir and the pathname buffer hasthib2009-08-301-25/+29
| | | | | | | | | | 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@
* Avoid double-release of vnodes in several functionsblambert2009-08-141-9/+1
| | | | ok thib@
* Initialize len variable; found by Martynas Venckusblambert2009-08-141-2/+2
| | | | ok thib@
* change version 3 post-operation attribute building function to notblambert2009-08-131-56/+55
| | | | | | use mbufs directly, but the shiny new nfsm_info struct ok thib@
* Fix a few bugs in nfsrv_rename() error recovery code.thib2009-08-111-8/+16
| | | | | | | | | | | | | - 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@
* Anotherblambert2009-08-101-9/+10
| | | | | | | | | | error = operation(); memory = malloc(); if (error) free(memory); gets relegated to the dustbin of history ok thib@
* Remove the v2 writegather code. It did help alot back in the 80sthib2009-08-101-372/+1
| | | | | | | | | | 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@
* MLEN < NFS_MAXPATHLEN < MCLBYTES, so there's no need toblambert2009-08-091-43/+27
| | | | | | | | | loop over allocating a chain of mbufs to store <= NFS_MAXPATHLEN bytes. Clean up some variables, which thib@ likes. ok thib@
* error = operation();blambert2009-08-091-9/+8
| | | | | | | | | memory = malloc(); if (error) free(memory); makes no sense; move error checking to above memory allocation ok thib@
* set the mrq pointer (request) in the nfsm_reply() macro, as we can return from it.thib2009-08-091-32/+1
| | | | | | This can cause us to follow garbage in the nfsd loop, causing two kinds of hell. problem noticed by nicm@. OK blambert@.
* group all of the on-stack variables that are uses by the nfsm_macrosthib2009-08-041-350/+529
| | | | | | | | | | | | | | 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@.
* (struct foo *)0 -> NULL, every where I could find it.thib2009-07-201-19/+19
| | | | OK blambert@
* Initialize a variable that was previously using a mystery value inblambert2009-07-171-2/+2
| | | | | | some error cases ok thib@
* Don't allocate an mbuf cluster without checking to see if it willblambert2009-06-061-2/+3
| | | | | | actually get us anything. ok thib@
* Consolidate error handling in read case.blambert2009-06-061-16/+15
| | | | ok thib@
* Consolidate error handling code. Much less atrocious than before.blambert2009-06-061-18/+15
| | | | "get it in" thib@
* bring back rev1.70thib2009-06-051-6/+9
|
* revert to 1.67 to unbreak NFS writes; ok beck@ thib@naddy2009-06-051-49/+45
|
* EPERM from VOP_ACCESS() is always an error, so don't hide it.thib2009-06-051-6/+9
| | | | | | Diff from FreeBSD. OK blambert@
* the following:blambert2009-06-041-10/+13
| | | | | | | | | | error = foo(); if (!error) bar(); is an alien construct; replace with one from this planet ok thib@
* Move code that logically belongs together to be together.blambert2009-06-041-31/+29
| | | | ok thib@
* IO_METASYNC has been a noop since around 4.4BSD-Lite, thethib2009-05-211-10/+3
| | | | | | idea never really caught on anywhere so retire it. "gank this shizzle", blambert@
* Convert macros to functions to reduce kernel memory usage.blambert2009-04-131-4/+4
| | | | In snaps for a while (way too long, according to deraadt@)
* Convert a sizeable macro to a much-leaner function. Saves (IIRC) 5k on i386.blambert2009-03-301-6/+16
| | | | In snaps for a while.
* Introduce splsoftassert(), similar to splassert() but for soft interruptmiod2009-03-151-2/+2
| | | | | | levels. This will allow for platforms where soft interrupt levels do not map to real hardware interrupt levels to have soft ipl values overlapping hard ipl values without breaking spl asserts.
* Correct my timeradd() thinko in nfsrv_writegather()blambert2009-01-271-2/+2
| | | | pointed out by bluhm@, "obvious" thib@
* Use a timespec for the server write deadline and procrastinationthib2009-01-241-10/+11
| | | | | | | | | 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.
* Perform the same access enforcements for set attributesthib2009-01-181-2/+2
| | | | | | | | | | | | | | | as for open/read/write etc, that is assume that the file as already been opened proper, this fixes an ancient ftruncate bug, that is if ftruncate was called on a file with no write modes, we'd return EACCES, this breaks posixy behavior. however, for e.g. truncate() we'll return EACCESS as we should. Diff from PR5880 by mickey. I had forgotten about this PR, and the fix but niklas@ ran into similar issues which prompted another review of this. OK kettenis@
* Low hanging macro fruit. Inline the nfsm_srvstrsiz macro sincethib2008-12-241-2/+9
| | | | | | | | its used only once and nuke its definition. Stolen from blambert's bag'o'diffs. OK blambert@.
* Replace the TRUE/FALSE defines with 1/0 respectively. This doesn'tthib2008-12-241-2/+2
| | | | | | | hurt readability and it was just plain annoying seeing them defined in every other .c file. OK blambert@
* remove #ifndef nolint goothib2008-07-061-4/+3
| | | | ok blambert@
* unroll the NFSMADV() macro and nuke itthib2008-06-151-3/+3
| | | | ok blambert@
* Replace nfsm_build/bcopy with nfsm_{buf,str}tombuf functions inblambert2008-06-141-3/+1
| | | | | | | | | filehandle -> mbuf write macros. Removes `magic' variable cp which was used only in these macros, and should lead to marginally better mbuf packing as well. `slap it in' thib@
* use nfsm_padlen() where appropriate;thib2008-06-141-3/+3
| | | | ok blambert@
* Replace one-line macro which only obfuscated the fact thatblambert2008-06-131-34/+34
| | | | | | the function it was named after took 4 arguments instead of 2. "get it in; get it in; get it in" thib@
* Remove now-vestigial bpos pointer from NFS. For building outgoingblambert2008-06-121-93/+63
| | | | | | | | | 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-1/+2
| | | | | | | | | 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
* Remove bloated and nasty nfsm_clget macro; while here, replace someblambert2008-05-271-127/+33
| | | | | | | handrolled loops with nfsm_strtombuf and nfsm_buftombuf. ok deraadt@ via thib@; ok 'nfs buddy' thib@ testing johan@, merdely@; thanks
* remove the "kerbflag" argument from nfsrv_fhtovp() and nfs_namei()thib2008-04-221-49/+26
| | | | | | | | (the latter only had it to pass it to nfsrv_fhtovp()). appropriate cleanup also; ok blambert@
* Widen some struct statfs fields to support large filesystem stataotto2008-03-161-7/+6
| | | | | and add some to be able to support statvfs(2). Do the compat dance to provide backward compatibility. ok thib@ miod@
* More NFS-related kernel shrinkage...blambert2008-01-061-41/+41
| | | | | | | | | | | 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.
* Fix for PR5365.thib2007-12-271-40/+28
| | | | | | | | | Use the va_blocksize, that is the blocksize of the underlying exported file system instead of the DIRBLKSIZ constant to size the chunks. Diff from Enache Adrian <3n4ch3@gmail.com> Tested by myself and a few others.
* Fix unsafe queue macro useblambert2007-11-081-4/+4
| | | | ok thib@ 'emphatic' ok beck@
* more low hanging fruit; Expand the nfsm_srvwcc_data() macrothib2007-11-071-29/+55
| | | | | | and nuke it's definition. OK krw@, blamers@
* Expand the nfsm_srvfillattr() macro andthib2007-11-061-10/+10
| | | | | | nuke it's definition. OK krw@, blambert@
* Remove the "frev" argument from nfs_rephead(); and clean up the "frev"thib2007-10-281-25/+7
| | | | | | | variables, that are declared all over, since they are passed via macros to nfs_rephead(); which doesn't do anything with it. OK krw@