Commit Graph

924 Commits

Author SHA1 Message Date
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
dogcow
55ddfc9aae change the MOWNER_INIT define to take two args; fix extant struct mowner
decls to use it. Makes options MBUFTRACE compile again and not whinge about
missing structure declarations. (Also makes initialization consistent.)
2006-10-10 21:49:14 +00:00
drochner
429dff1c3d Flush regular files before setattr also if the mode bits are going to
be set. Linux NFS servers (at least) reset suid/sgid bits if a write
happens afterwards. Add a comment why this is done.
This fixes system builds on diskless systems for me where suid bits
were missing after install(1).
Approved by yamt.
2006-09-29 16:19:50 +00:00
yamt
ff1a471a3b nfs_ispublicfh: fix another instance of cast-qual. 2006-09-04 08:38:16 +00:00
yamt
80fe9dcf8f remove (void *) cast from NFSRVFH_DATA as it sometimes
discards const qualifier.  pointed out by Havard Eidnes.
(it wasn't detected by in-tree gcc4.  seems like a compiler bug.)
2006-09-04 08:27:49 +00:00
yamt
8b789e8490 nfs_fhtovp: try to detect stale or invalid handles by issuing VOP_GETATTR. 2006-09-02 13:37:52 +00:00
yamt
b45e7d3197 nfsdreq_free: remove an assertion which is not true. 2006-09-02 13:30:08 +00:00
yamt
3311de9ddc implement vptofh and fhtovp for nfs. 2006-09-02 12:40:58 +00:00
yamt
d7d8adb6ea nfsd: deal with variable-sized filehandles. 2006-09-02 12:40:36 +00:00
yamt
d70ea60617 #ifdef out nqsrv_getlease and friends unless defined(NFSSERVER). 2006-09-02 12:39:59 +00:00
christos
57eb3ffe77 fix default type decls
fix incomplete initializer
2006-09-02 07:26:47 +00:00
christos
da9052a357 Don't free what we did not allocate. 2006-08-24 12:40:39 +00:00
christos
f73c6e5980 Change iostat_alloc() to take the parent pointer and the name directly, so
that callers are not responsible for initializing the fields. Store the name
inside the struct instead of maintaining a pointer to external storage, or
leaked memory (nfs case).
2006-08-23 17:19:32 +00:00
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