Commit Graph

911 Commits

Author SHA1 Message Date
yamt 2253872d55 nfsm_srvfhtom: ensure that padding bytes in nfsv2 file handles are zero. 2006-08-08 13:07:32 +00:00
martin b4cb63a646 Make filehandles opaque to userland 2006-07-31 16:34:42 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
christos 1c50629119 When there are too many empty entries in a row, and we need to try to
read the next block, free the cookie buffer before doing so to avoid
a memory leak. Reported by  Mark Davies.
2006-07-20 15:12:23 +00:00
yamt b0c4bb36d9 nfs_getreq: fix a kauth fallout.
pointed by nanashi-san.  http://pc8.2ch.net/test/read.cgi/unix/1145181361/786
2006-07-15 05:54:10 +00:00
martin a3b5baed42 Fix alignement problems for fhandle_t, exposed by gcc4.1.
While touching all vptofh/fhtovp functions, get rid of VFS_MAXFIDSIZ,
version the getfh(2) syscall and explicitly pass the size available in
the filehandle from userland.

Discussed on tech-kern, with lots of help from yamt (thanks!).
2006-07-13 12:00:24 +00:00
yamt ce1a2b18c3 some comments taken from Jed Davis's patch. 2006-07-01 11:30:44 +00:00
yamt e38f237e53 if a file is sillyrename'ed because it's a destination of rename,
make sillyrename (try to) use LINK operation rather than RENAME.
PR/33861 from Jed Davis.  he provided the almost same patch.
according to him, it also happen to be what opensolaris does in this case.

from the PR:
> In nfs_rename(), if the destination appears to exist and is "in use"
> (this check is apparently satisfied even if the file isn't in use by
> anything except the rename itself), it will sillyrename it, then delete
> the sillyrenamed file even if the rename fails -- for instance, because
> the "from" file no longer exists on the server.

> mkdir a b; touch a/x; perl -e 'fork(); rename("a/x","b/x") or die "$!\n"'
>
> Afterwards, neither a/x nor b/x will exist.

> 1) Lookup of b/x; fails with NOENT.
> 2) Rename from a/x to b/x; succeeds.
> 3) Lookup of b/x; fails with NOENT.
> 4) Rename from b/x to b/.nfsA23a3; succeeds.
> 5) Rename from a/x to b/x; fails with NOENT.
> 6) Remove of b/.nfsA23a3; succeeds.
2006-07-01 11:29:42 +00:00
yamt 2246835eec wrap long lines and fix indents after kauth merge. 2006-06-30 09:56:03 +00:00
yamt 3333e8aa5c fix handling of NFSERR_NOTSUPP and NFSERR_BAD_COOKIE,
which have been broken since nfs_socket.c rev.1.115.
2006-06-30 09:55:34 +00:00
yamt 2a9a8246f0 nfs_request: don't bother to handle NFSERR_STALEWRITEVERF
because it isn't a real nfs error value.
2006-06-30 09:55:06 +00:00
yamt 7d3142aa6a - introduce vfs_composefh() and use it where appropriate.
- fix lock/unlock mismatch in sys_getfh.
2006-06-17 07:06:50 +00:00
christos d13a9159e3 stack police: don't allocate statvfs on the stack. 2006-06-09 21:41:14 +00:00
kardel de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
blymn 4a065f3379 Clean up bogus whitespace 2006-05-28 13:23:08 +00:00
yamt 3ef3d785cc nfs_request: use kauth_cred_free rather than kauth_cred_destroy. 2006-05-28 06:47:58 +00:00
yamt 16dbcd1c54 mountnfs: reject wrongly-sized filehandle for nfsv2. 2006-05-20 07:42:02 +00:00
yamt eb04c18e83 nqsrv_getlease: call nfs_init() to fix NFSSERVER && !NFS case. 2006-05-20 07:40:56 +00:00
yamt b245701ca1 - fix compilation problem for !NFSSERVER && NFS.
pointed by Tom Spindler on source-changes@.
- make nfs_srvdesc_pool static.
2006-05-19 13:53:11 +00:00
yamt b861e24c71 - fix some leaks in nfsd, introduced by kauth changes.
- simplify code.
- add some assertions.
- wrap some long lines.
- remove an unnecessary ";".
2006-05-18 12:44:45 +00:00
yamt 635dba4477 - nfs_export_unmount: don't forget to free exports.
- rename clear_exports for consistency.
2006-05-18 10:07:34 +00:00
elad fc9422c9d9 integrate kauth. 2006-05-14 21:31:52 +00:00
christos c0fdc5190f XXX: GCC uninitialized 2006-05-14 05:42:43 +00:00
mrg 084c052803 quell GCC 4.1 uninitialised variable warnings.
XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
2006-05-10 21:53:14 +00:00
blymn 10df330c85 Prefix iostat structure elements with io_ 2006-04-20 12:13:51 +00:00
christos de6470e701 m_freem takes one arg. 2006-04-15 02:49:25 +00:00
christos 2fd9c5d744 s/mfree/m_freem/ 2006-04-15 02:48:32 +00:00
dogcow bbfbd3e91f #if -> #ifdef 2006-04-15 02:46:39 +00:00
christos f540054634 Coverity CID 735: Remove duplicate code. 2006-04-15 01:58:44 +00:00
christos 0b55b29a78 Coverity CID 734: Define NFS_TEST_HEAVY for testing nfsds, and use this to
ifdef out dead code. XXX: Why is this turned on by default?
2006-04-15 01:57:36 +00:00
christos 4ea21306a7 Coverity CID 736: Comment out dead code. 2006-04-15 01:54:46 +00:00
christos 0016be6042 Coverity CID 1175: Remove dead code. 2006-04-15 01:52:44 +00:00
christos 1ee078d67e Coverity CID 744: Conditionally define out dead code (only if it is dead) 2006-04-15 01:51:47 +00:00
christos 35829d71d3 Coverity CID 1141: Add a KASSERT before deref. 2006-04-15 01:45:15 +00:00
christos c3a65fd394 Coverity CID 1142: Add a KASSERT before deref. 2006-04-15 01:41:46 +00:00
christos d008757117 Coverity CID 1143: Prevent NULL deref. 2006-04-15 01:39:15 +00:00
christos 09436af99e Coverity CID 1144: Protect against NULL deref. 2006-04-15 01:37:46 +00:00
christos 6668c9c154 Coverity CID 1162: Prevent NULL deref. 2006-04-15 01:35:12 +00:00
christos b31d7b8b49 Coverity CID 1165: Cannot have nfsiod without an lwp, so remove the superfluous
test.
2006-04-15 01:31:11 +00:00
christos b2bd561652 Coverity CID 2445: Only set from_p if we succeed so that we free it on error. 2006-04-15 01:25:54 +00:00
christos bd57687667 Don't leak mbufs on error. 2006-04-15 01:25:01 +00:00
christos 6555ff0ad3 From my posting of April 3 to tech-kern:
My understanding is that the CLRSIG() is supposed to clear the signal
that was sent to the syncer process to prevent it from being delivered
to the syncer process in case unmounting fails, so that the syncer process
does not die while the filesystem is still mounted. The typical scenario
is, the syncher process is tsleep()ing in the kernel, and waking up when
it needs to do work. If someone sends a signal to it, eg. kill -TERM
the mfs process, then the kernel will try to unmount the mfs filesystem
before delivering the signal to the process. If that unmount fails, then
we should not really kill the process because that will hang the mount.
So we call CLRSIG() to stop the signal from being delivered.

So the first call to issignal() will return the signal number that was
sent to the syncer process (unless someone malicious was able to send
a lower numbered signal between the time tsleep() returned and we called
issignal()... something that is not really easy to do). But you are
right, we should not be calling it many times as a side effect of this
macro.

Rewrite CLRSIG() clear all the signals and call issignal() the correct
number of times.
2006-04-15 01:16:40 +00:00
christos 881fbaa328 Coverity CID 2509: Initialize cache 2006-04-15 00:45:49 +00:00
christos ff33272e7b Coverity CID 2510-2514: Always initialize cache. 2006-04-15 00:44:18 +00:00
christos 4c9d749d77 Coverity CID 2515-2519: Initialize rexmit on error path. 2006-04-15 00:40:20 +00:00
christos 1099609bd0 Coverity CID 2520: rexmit can be uninitialized on error path. 2006-04-15 00:36:23 +00:00
blymn 3c0adb7d99 Make i/o statistics collection more generic, include tape drives and
nfs mounts in the set of devices that statistics will be reported on.
2006-04-14 13:09:05 +00:00
yamt c5fcdd1719 some cleanups after the introduction of GOP_SIZE_MEM flag.
- remove GOP_SIZE_READ/GOP_SIZE_WRITE flags.
  they have not been used since the change.
- ufs_balloc_range: remove code which has been no-op since the change.
  thanks Konrad Schroder for explaining the original intention of the code.
- ffs_gop_size: don't extend past eof, in the case of GOP_SIZE_MEM.
  otherwise genfs_getpages end up to allocate pages past eof unnecessarily.
2006-03-30 12:40:06 +00:00
martin d6d75eaf5d KASSERT that the returned file id length from VPTOFH is <= the
maximum allowed value (_VFS_MAXFIDSZ).
2006-03-27 20:20:45 +00:00
christos c92b23ffa8 Don't use DEBUG, add a new DEBUG_NFS_BOOT_DHCP variable to provide more
information. Print more information about what fails.
2006-03-16 15:55:20 +00:00