]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 years agoIf the mech_type argument to gss_display_status is null, use a default
dfr [Thu, 5 Jul 2007 13:40:07 +0000 (13:40 +0000)]
If the mech_type argument to gss_display_status is null, use a default
mechanism.

Approved by: re (kensmith)

17 years agoIn preparation for 7.0 privilege cleanup, clean up style:
rwatson [Thu, 5 Jul 2007 13:16:04 +0000 (13:16 +0000)]
In preparation for 7.0 privilege cleanup, clean up style:

- Sort copyrights by date.
- Re-wrap, and in some cases, fix comments.
- Fix tabbing, white space, remove extra blank lines.
- Remove commented out debugging printfs.

Approved by: re (kensmith)

17 years agoAdopt snp to the destroy_dev_sched() KPI after reverting of destroy_dev()
kib [Thu, 5 Jul 2007 13:07:12 +0000 (13:07 +0000)]
Adopt snp to the destroy_dev_sched() KPI after reverting of destroy_dev()
to not call destroy_dev_sched().

Tested by: Peter Holm
Approved by: re (kensmith)

17 years agoRevert destroy_dev() to the state before destroy_dev_sched() was introduced.
kib [Thu, 5 Jul 2007 13:04:59 +0000 (13:04 +0000)]
Revert destroy_dev() to the state before destroy_dev_sched() was introduced.
Attempt to spawn destroy_dev_sched() from it causes inadmissible races.

Requested by: tegge
Approved by: re (kensmith)

17 years agoProperly unlock mutex before returning. There was a slight mishap
ariff [Thu, 5 Jul 2007 10:22:37 +0000 (10:22 +0000)]
Properly unlock mutex before returning. There was a slight mishap
during last major locking cleanup.

Reported by: Thierry Herbelot <thierry@herbelot.com>
Approved by: re (mux)

17 years agoRemove reference to the old ftp-proxy implementation,
delphij [Thu, 5 Jul 2007 09:46:53 +0000 (09:46 +0000)]
Remove reference to the old ftp-proxy implementation,
which was replaced during the pf 4.1 import.

Approved by: re (mux)

17 years agoTurn on -Werror for i386 kernel builds.
peter [Thu, 5 Jul 2007 09:30:34 +0000 (09:30 +0000)]
Turn on -Werror for i386 kernel builds.

Approved by: re (rwatson)

17 years agoAllow the LACP state to be queried from userland which at the moment is the
thompsa [Thu, 5 Jul 2007 09:18:57 +0000 (09:18 +0000)]
Allow the LACP state to be queried from userland which at the moment is the
actor and partner peer info. Print out the active aggregator and per port data
in verbose mode from ifconfig.

Approved by: re (mux)

17 years agoRemove the -DFAST_IPSEC from Makefiles again.
bz [Thu, 5 Jul 2007 08:56:46 +0000 (08:56 +0000)]
Remove the -DFAST_IPSEC from Makefiles again.

This was needed during the IPSEC->FAST_IPSEC->IPSEC transition
period to not break the build after picking up netipsec header
files. Now that the FAST_IPSEC kernel option is gone and the
default is IPSEC again those defines are superfluous.

Approved by: re (rwatson)

17 years agoRemove netkey directory from cscope/TAGs generation and replace
bz [Thu, 5 Jul 2007 08:55:14 +0000 (08:55 +0000)]
Remove netkey directory from cscope/TAGs generation and replace
it with netipsec now that KAME IPsec is gone.
While here add missing netinet6 directories.

Add comments about the ports needed to be able to run those targets.

Reviewed by: philip
Approved by: re (rwatson)

17 years agoFix a build breakage as result of disabling parts of I4B.
bz [Thu, 5 Jul 2007 08:53:21 +0000 (08:53 +0000)]
Fix a build breakage as result of disabling parts of I4B.
Check for (temporary gone) kernel options to be defined before using
them.

Reported by: peter
Approved by: re (rwatson)

17 years agoQuiet framelen uninitialized warning. I think it was a false alarm.
peter [Thu, 5 Jul 2007 07:46:33 +0000 (07:46 +0000)]
Quiet framelen uninitialized warning.  I think it was a false alarm.
If check_fhdr() returns false, the frame_ok variable should protect any
meaningful evaluations of framelen.

Approved by: re (rwatson)

17 years agoQuiet warnings. I believe gcc is incorrect about these.
peter [Thu, 5 Jul 2007 07:38:17 +0000 (07:38 +0000)]
Quiet warnings.  I believe gcc is incorrect about these.

Approved by:  re (rwatson)

17 years ago__packed has no effect on u_int8_t's except to cause a warning (and
peter [Thu, 5 Jul 2007 07:28:38 +0000 (07:28 +0000)]
__packed has no effect on u_int8_t's except to cause a warning (and
never has had any effect).

Approved by:  re (rwatson)

17 years agoTurn -Werror back on for amd64 for kernel builds.
peter [Thu, 5 Jul 2007 07:06:17 +0000 (07:06 +0000)]
Turn -Werror back on for amd64 for kernel builds.

Approved by:  re (rwatson)

17 years agoCompile pf/pf_subr.c and netnatm/cc_conn.c without -Werror for the time
peter [Thu, 5 Jul 2007 07:04:17 +0000 (07:04 +0000)]
Compile pf/pf_subr.c and netnatm/cc_conn.c without -Werror for the time
being.

Approved by:  re (rwatson)

17 years agoQuiet warnings. These do not appear to be actually used uninitialized,
peter [Thu, 5 Jul 2007 06:59:14 +0000 (06:59 +0000)]
Quiet warnings.  These do not appear to be actually used uninitialized,
but gcc's optimizer isn't smart enough to see that.  Pre-initializing
seems harmless enough.

Approved by:  re (rwatson)

17 years agoFix a stray splx() that caused a new warning.
peter [Thu, 5 Jul 2007 06:54:03 +0000 (06:54 +0000)]
Fix a stray splx() that caused a new warning.

Approved by:  re (rwatson)

17 years agoInitialize DWBuf[3].
peter [Thu, 5 Jul 2007 06:51:49 +0000 (06:51 +0000)]
Initialize DWBuf[3].

Approved by:  re (rwatson, blanket)

17 years agoFix a bunch of warnings due to a missing forward declaration of a struct.
peter [Thu, 5 Jul 2007 06:45:37 +0000 (06:45 +0000)]
Fix a bunch of warnings due to a missing forward declaration of a struct.

Approved by: re (rwatson)

17 years agoPrefer device_printf to printf("%s: ...", device_get_nameunit()). On
imp [Thu, 5 Jul 2007 06:42:14 +0000 (06:42 +0000)]
Prefer device_printf to printf("%s: ...", device_get_nameunit()).  On
amd64, we save about 240 bytes (this is about 20 per instance).

Approved by: re (blanket)

17 years agoPrefer device_printf to printf("%s:...", device_get_nameunit(),...);
imp [Thu, 5 Jul 2007 06:28:46 +0000 (06:28 +0000)]
Prefer device_printf to printf("%s:...", device_get_nameunit(),...);
This saves ~300 bytes for uvscom.c and ~100 for uvisor.c

Approved by: re (blanket)

17 years agoFix 'assignment used as truth value' warning
peter [Thu, 5 Jul 2007 06:27:15 +0000 (06:27 +0000)]
Fix 'assignment used as truth value' warning

Approved by: re (rwatson)

17 years agoTemporarily turn nowerror on for i386 and amd64 pmap.c. I'd like to study
peter [Thu, 5 Jul 2007 06:12:40 +0000 (06:12 +0000)]
Temporarily turn nowerror on for i386 and amd64 pmap.c.  I'd like to study
exactly what effect the options cause to the code with gcc these days.

Approved by:  re (rwatson)

17 years agoFix a second warning, introduced by my last "fix". I committed the wrong
peter [Thu, 5 Jul 2007 06:04:46 +0000 (06:04 +0000)]
Fix a second warning, introduced by my last "fix". I committed the wrong
diff from the wrong machine.

Pointy hat to: peter
Approved by:  re (rwatson - blanket, several days ago)

17 years agoFix cast-qualifiers warning when INET6 is not present
peter [Thu, 5 Jul 2007 05:55:57 +0000 (05:55 +0000)]
Fix cast-qualifiers warning when INET6 is not present

Approved by:  re (rwatson)

17 years agoFix bad function type passed to destroy_dev_sched_cb().
peter [Thu, 5 Jul 2007 05:54:47 +0000 (05:54 +0000)]
Fix bad function type passed to destroy_dev_sched_cb().

Approved by:  re (rwatson)

17 years agoRemove pad argument from ftruncate wrapper. Oops.
peter [Thu, 5 Jul 2007 05:32:44 +0000 (05:32 +0000)]
Remove pad argument from ftruncate wrapper.  Oops.

Approved by: re (kensmith)

17 years agoAdd quirks, derived from the linux quirks table for:
imp [Thu, 5 Jul 2007 05:26:08 +0000 (05:26 +0000)]
Add quirks, derived from the linux quirks table for:

o Adonics Cable 205
o Aiptek PocketCAM 3Mega
o Belkin USB2SCSI
o Casio QV DigiCam
o CCYU EasyDisk ED1064
o Desknote UCR-61S2B
o Epson Stylus Photo 875DC Card Reader
o Epson Stylus Photo 895 Card Reader
o Feiya 5-in-1 Card Reader
o Hitachi Dvd-CAM DZ-MV100A Camcorder
o HP CD-WRiter+ CD-4e
o Insystem Storage Adapter v2
o Kyocera Finecam S3x
o Kyocera Finecam S4
o Kyocera Finecam S5
o Kyocera Finecam L3
o Lexar USB CF Reader
o MindAtWork Digital Wallet
o Minolta Dimage F300
o Minolta Dimage E223
o Minsumi USB Fdd
o Netac USB-CF-Card
o NetChip USB Clik! 40
o Onspec MDCFE-B USB CF Reader
o Onspec SIIG/Datafab Memory Stick + CF Reader/Writer
o Onspec Datafab-based Reader
o Onspec PNY/Datafab CF+SM Reader
o Onspec SimpleTech/Datafab CF+SM Reader
o Onspec MDSM-b Reader
o Onspec USB To CF + SM Combo (LC1)
o Onspec ImageMate SDDR55
o Panasonic LS-120 Camera
o Samsung Techwin Digimax 410
o Shuttle eUSB SmartMedia / CompactFlash Adapter
o Skanhex MD 7425 Camera
o Skanhex SX 520z Camera
o Sony Memorystick NW-MS7
o Sony Portable USB Hardrive V2
o Sony Memorystick PEG N760c
o Sony Memorystick MSC-U03
o TREK/IBM USB memory key
o Trumpion T33520 USB Flash Card Controller
o Trumpion MP3 Player
o Vivtar Vivicam 35Xx
o WinMaxGroup USB Flash Disk 64M-C
o Zoran Digital Camera EX-20 DSC

and maybe a few others...

Submitted by: Vaidas Damosevicius and flz
PR: 79893
Reviewed by: njl, flz
Approved by: re (blanket)

17 years agoAdd support for Western Digital MyBook external enclosures. They need
imp [Thu, 5 Jul 2007 04:05:51 +0000 (04:05 +0000)]
Add support for Western Digital MyBook external enclosures.  They need
this quirk to work.

Submitted by: Dierk Sacher
PR: usb/99419
Approved by: re (blanket)

17 years agoAdd missing \ characters in PSEUDO() macro on arm. Oops.
peter [Wed, 4 Jul 2007 23:35:18 +0000 (23:35 +0000)]
Add missing \ characters in PSEUDO() macro on arm.  Oops.

Submitted by:  cognet
Approved by: re (kensmith)

17 years agokdump has knowledge of lseek() and mmap() arg decoding. Teach it about
peter [Wed, 4 Jul 2007 23:32:49 +0000 (23:32 +0000)]
kdump has knowledge of lseek() and mmap() arg decoding.  Teach it about
the new mmap and lseek syscalls.

Approved by:  re (kensmith)

17 years agoChange the C wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate to
peter [Wed, 4 Jul 2007 23:27:38 +0000 (23:27 +0000)]
Change the C wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate to
call the pad-less versions of the corresponding syscalls if the running
kernel supports it.  Check kern.osreldate once per program and cache the
result to select the appropriate syscall.  This maintains userland
compatability with kernel.old's from quite a while back.

Approved by:  re (kensmith)

17 years agoClassify mmap, lseek, pread, pwrite, truncate, ftruncate as pseudo
peter [Wed, 4 Jul 2007 23:23:01 +0000 (23:23 +0000)]
Classify mmap, lseek, pread, pwrite, truncate, ftruncate as pseudo
syscalls, unless WITHOUT_SYSCALL_COMPAT is defined.  The default case
will have the .c wrappers still.  If you define WITHOUT_SYSCALL_COMPAT,
the .c wrappers will go away and libc will make direct syscalls.

After 7-stable starts, the direct syscall method will be default.

Approved by:  re (kensmith)

17 years agoAdjust the syscall stub macros to be consistent in their meaning. In
peter [Wed, 4 Jul 2007 23:18:38 +0000 (23:18 +0000)]
Adjust the syscall stub macros to be consistent in their meaning.  In
particular:
SYSCALL() makes a syscall, with errno handling, and continues execution
directly after the macro in the non-error case.
RSYSCALL() is just like SYSCALL(), but returns after success.
Both SYSCALL(name) and RSYSCALL(name) export  "__sys_name" as a strong
symbol, with "_name" and "name" as weak aliases.
PSEUDO() is just like RSYSCALL(), but skipping the "name" weak alias.  It
still does "__sys_name" and "_name".

Change i386 to add errno handling to PSEUDO.  The same for amd64 and
sparc64, with appear to have copied the behavior.
ia64 was correct (as was alpha).  Just remove some apparently unused
variants of the macros. (untested!)
I believe powerpc is correct.
Fix arm to not export "name" from the PSEUDO case.  Remove apparently
extra unused variants.  (untested!)

The errno problem manifested on i386/amd64/sparc64 by having "PSEUDO"
classified syscalls return without setting errno.  eg: "addr = mmap()"
could return with "addr" = 22 instead of setting errno to 22 and
returning -1.

Approved by: re (kensmith)

17 years agoDon't add the 'pad' argument to the mmap/truncate/etc syscalls.
peter [Wed, 4 Jul 2007 23:06:43 +0000 (23:06 +0000)]
Don't add the 'pad' argument to the mmap/truncate/etc syscalls.

Submitted by: kensmith
Approved by: re (kensmith)

17 years agoAdd compat6 wrapper code for mmap/lseek/pread/pwrite/truncate/ftruncate.
peter [Wed, 4 Jul 2007 23:04:41 +0000 (23:04 +0000)]
Add compat6 wrapper code for mmap/lseek/pread/pwrite/truncate/ftruncate.

Approved by:  re (kensmith)

17 years agoRegenerate after mmap/lseek/etc syscall changes
peter [Wed, 4 Jul 2007 23:03:50 +0000 (23:03 +0000)]
Regenerate after mmap/lseek/etc syscall changes

Approved by:  re (kensmith)

17 years agoAdd i386 emulation wrappers for mmap/lseek/etc. These use COMPAT6, so
peter [Wed, 4 Jul 2007 23:02:40 +0000 (23:02 +0000)]
Add i386 emulation wrappers for mmap/lseek/etc.  These use COMPAT6, so
you must use the already existing, already in generic, COMPAT_FREEBSD6
kernel option for running old 32 bit binaries.

Approved by:  re (kensmith)

17 years agoAdd freebsd6_ wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate
peter [Wed, 4 Jul 2007 22:57:21 +0000 (22:57 +0000)]
Add freebsd6_ wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate

Approved by: re (kensmith)

17 years agoBump version for new mmap/lseek/etc syscalls
peter [Wed, 4 Jul 2007 22:53:00 +0000 (22:53 +0000)]
Bump version for new mmap/lseek/etc syscalls

Approved by:  re (kensmith)

17 years agoRegenerate after mmap/lseek/etc syscall changes.
peter [Wed, 4 Jul 2007 22:49:55 +0000 (22:49 +0000)]
Regenerate after mmap/lseek/etc syscall changes.

Approved by:  re (kensmith)

17 years agoCreate new syscalls for mmap(), lseek(), pread(), pwrite(), truncate() and
peter [Wed, 4 Jul 2007 22:47:37 +0000 (22:47 +0000)]
Create new syscalls for mmap(), lseek(), pread(), pwrite(), truncate() and
ftruncate(), but without the pad arg.

There are several reasons for this.  Consider 'mmap()'.  On AMD64, the
function call (and syscall) ABI allow for 6 register arguments.  Additional
arguments go on the stack.  mmap(2) has 6 arguments.  However, the syscall
definition has an extra 'int pad' argument.  This pushes it to 7 arguments,
which means one must spill into the memory stack.  Since the kernel API
doesn't match userland API, we have a hack in libc - libc/sys/mmap.c.
This implements the userland API by calling __syscall() with an extra
argument and the pad argument, for a total of 8 args.  This is all
unnecessary and inconvenient for several things, including the kernel's
syscall handler code which now has to handle merging stack arguments with
register arguments.  It is a big deal for certain 3rd party code.

I'm adding libc glue to make the transition totally painless.  I had
intended to mark the old syscalls as COMPAT6, but the potential to shoot
your feet by building a new kernel without COMPAT_FREEBSD6 but with a
slighly older userland was too great.  For now, they have manual
"freebsd6_" prefixes rather than being COMPAT6.  They will go back to
being marked 'COMPAT6' after 7-stable starts.

Approved by: re (kensmith)

17 years agoAdd support for COMPAT6 syscalls.
peter [Wed, 4 Jul 2007 22:38:28 +0000 (22:38 +0000)]
Add support for COMPAT6 syscalls.

Also, change the visibility of compat syscalls a slightly.  Compat
syscalls were missing from 'syscalls.h' entirely.  This additionally adds
them with their compat prefix.  eg: SYS_freebsd6_mmap.

Also, the syscalls.c names strings have different prefixes to differentiate
syscalls. Instead of several "old.mmap" strings, there will now be a
"compat.mmap" and "compat6.mmap" etc.  Before, both would have had the
same "old.mmap" label.

Approved by:  re

17 years agoDocument the move from FAST_IPSEC to IPSEC. Point out the need for
gnn [Wed, 4 Jul 2007 21:47:23 +0000 (21:47 +0000)]
Document the move from FAST_IPSEC to IPSEC.  Point out the need for
device crypto in the kernel configuration file when using IPSEC.

Approved by: re

17 years agoAdd case-insensitive matching to sed, using the 'I' flag, similarly to GNU sed.
ssouhlal [Wed, 4 Jul 2007 16:42:41 +0000 (16:42 +0000)]
Add case-insensitive matching to sed, using the 'I' flag, similarly to GNU sed.
For example,
sed /foo/Id
sed s/foo/bar/Ig

Reviewed by: dds
Approved by: re (hrs)

17 years agoDo not install man pages for the three I4B 'modules' that were
bz [Wed, 4 Jul 2007 16:21:27 +0000 (16:21 +0000)]
Do not install man pages for the three I4B 'modules' that were
disabled for the FreeBSD 7.0 timeframe.

Approved by: re (rwatson)

17 years agoBe much more forgiving towards applications that requesting ioctls
ariff [Wed, 4 Jul 2007 12:33:11 +0000 (12:33 +0000)]
Be much more forgiving towards applications that requesting ioctls
that should be a no-op (for example, requesting SYNC on record path).
The standards does not indicate that such requests are illegal, so
just return it as success instead of EINVAL.

Approved by: re (mux)

17 years agoSince cdev mutex is after system map mutex in global lock order, free()
kib [Wed, 4 Jul 2007 06:56:58 +0000 (06:56 +0000)]
Since cdev mutex is after system map mutex in global lock order, free()
shall not be called while holding cdev mutex. devfs_inos unrhdr has cdev as
mutex, thus creating this LOR situation.

Postpone calling free() in kern/subr_unit.c:alloc_unr() and nested functions
until the unrhdr mutex is dropped. Save the freed items on the ppfree list
instead, and provide the clean_unrhdrl() and clean_unrhdr() functions to
clean the list.
Call clean_unrhdrl() after devfs_create() calls immediately before
dropping cdev mutex. devfs_create() is the only user of the alloc_unrl()
in the tree.

Reviewed by: phk
Tested by: Peter Holm
LOR: 80
Approved by: re (kensmith)

17 years agoReintroducing !INET6 + IPSEC building fix which was accidentally reverted
avatar [Wed, 4 Jul 2007 03:44:57 +0000 (03:44 +0000)]
Reintroducing !INET6 + IPSEC building fix which was accidentally reverted
in rev. 1.1229.

Approved by: re (kensmith)

17 years agoRemove a last, dangling, file from the Kame IPsec code.
gnn [Wed, 4 Jul 2007 01:03:48 +0000 (01:03 +0000)]
Remove a last, dangling, file from the Kame IPsec code.

Approved by: re
Spotted by: rwatson, bz

17 years agoFix missing prototype warnings. (Compile errors with -Werror on)
peter [Wed, 4 Jul 2007 00:55:50 +0000 (00:55 +0000)]
Fix missing prototype warnings.  (Compile errors with -Werror on)
When using namespace.h/un-namespace.h, you use _ versions of syscalls.
Change getsockopt() to _getsockopt() and same for setsockopt().

Approved by:  re

17 years agoTemporary disconnect i4bing, i4bisppp and i4bipr from the build for
bz [Wed, 4 Jul 2007 00:18:39 +0000 (00:18 +0000)]
Temporary disconnect i4bing, i4bisppp and i4bipr from the build for
the 7.0 timeframe.

This is needed because I4B is not locked and NET_NEEDS_GIANT goes away.

The plan is to lock I4B and bring everything back for 7.1.

Approved by: re (kensmith)

17 years agoSignificantly reduce the memory leak as noted in BUGS section for
scf [Wed, 4 Jul 2007 00:00:41 +0000 (00:00 +0000)]
Significantly reduce the memory leak as noted in BUGS section for
setenv(3) by tracking the size of the memory allocated instead of using
strlen() on the current value.

Convert all calls to POSIX from historic BSD API:
 - unsetenv returns an int.
 - putenv takes a char * instead of const char *.
 - putenv no longer makes a copy of the input string.
 - errno is set appropriately for POSIX.  Exceptions involve bad environ
   variable and internal initialization code.  These both set errno to
   EFAULT.

Several patches to base utilities to handle the POSIX changes from
Andrey Chernov's previous commit.  A few I re-wrote to use setenv()
instead of putenv().

New regression module for tools/regression/environ to test these
functions.  It also can be used to test the performance.

Bump __FreeBSD_version to 700050 due to API change.

PR: kern/99826
Approved by: wes
Approved by: re (kensmith)

17 years ago - Use explicit locking in the various fcntl case statements so that we
jeff [Tue, 3 Jul 2007 21:26:06 +0000 (21:26 +0000)]
 - Use explicit locking in the various fcntl case statements so that we
   can acquire shared filedescriptor locks in the appropriate cases.
 - Remove Giant from calls that issue ioctls.  The ioctl path has been
   mpsafe for some time now.
 - Only acquire giant for VOP_ADVLOCK when the filesystem requires giant.
   advlock is now mpsafe.

Reviewed by: rwatson
Approved by: re

17 years ago - Remove explicit Giant protection from lockf. Use the vnode interlock
jeff [Tue, 3 Jul 2007 21:22:58 +0000 (21:22 +0000)]
 - Remove explicit Giant protection from lockf.  Use the vnode interlock
   to protect this datastructure instead.
 - Preallocate an extra lockf structure in case we want to split a lock
   on insert or delete.
 - msleep() on the vnode interlock when blocking on a lock.

Reviewed by: rwatson
Approved by: re

17 years agoTweak the low-level MI SMP code some:
jhb [Tue, 3 Jul 2007 18:37:06 +0000 (18:37 +0000)]
Tweak the low-level MI SMP code some:
- Use cpu_spinwait() in the spin loops in stop_cpus(), restart_cpus(), and
  smp_rendezvous_action().
- Remove unneeded acq memory barriers in stop_cpus(), restart_cpus(), and
  smp_rendezvous_action().
- Add an additional synch point in smp_rendezvous() to ensure that all the
  CPUs will always see an up-to-date value of smp_rv_setup_func.

Reviewed by: attilio
Approved by: re (kensmith)
Tested on: alpha, amd64, i386, sparc64 SMP (for several years)

17 years agoFix for a race where out of order loading of NFS attrs into the
jhb [Tue, 3 Jul 2007 18:31:47 +0000 (18:31 +0000)]
Fix for a race where out of order loading of NFS attrs into the
nfsnode could lead to attrs being stale. One example (that we
ran into) was a READDIR+, WRITE. The responses came back in
order, but the attrs from the WRITE were loaded before the
attrs from the READDIR+, leading to the wrong size from being
read on the next stat() call.

MFC after: 1 week
Submitted by: mohans
Approved by: re (kensmith)

17 years agoFix up NFS client write error handling. Errors are split into
jhb [Tue, 3 Jul 2007 18:30:55 +0000 (18:30 +0000)]
Fix up NFS client write error handling. Errors are split into
recoverable and unrecoverable. For the former, we redirty the
buffer and hang onto it for future retries. For the latter (eg.
ESTALE), we discard the buffer and return the error back to the
user on the next syscall. This fixes a number of vfs panics and
fixes having a large number of dirty buffers (that cannot be
written out and reclaimed) from hanging around. Thanks to ups@
for discussions on this issue.

Reported by: kris, Kai, others
Approved by: re (kensmith)

17 years agoRev. 1.204 and 1.205 got an erronous version of destroy_dev() that
kib [Tue, 3 Jul 2007 18:18:30 +0000 (18:18 +0000)]
Rev. 1.204 and 1.205 got an erronous version of destroy_dev() that
calls destroy_dev_sched() with cdev mutex locked. Commit the code
that was actually tested.

Pointy hat to: kib
Approved by: re (implicit)

17 years agoUse the -n flag on ifconfig so that dhclient does not cause the kernel module
thompsa [Tue, 3 Jul 2007 17:49:32 +0000 (17:49 +0000)]
Use the -n flag on ifconfig so that dhclient does not cause the kernel module
to be reloaded when the interface is torn down.

Reviewed by: brooks
Approved by: re (kensmith)

17 years agoLock Giant and proctree lock around dereferencing p_session->s_ttyvp->v_rdev.
kib [Tue, 3 Jul 2007 17:46:37 +0000 (17:46 +0000)]
Lock Giant and proctree lock around dereferencing p_session->s_ttyvp->v_rdev.
Lock cdev mutex too to close the race with tty being freed.
Relock clone_drain_lock to prevent the LOR with proctree lock, thus
add #include <fs/devfs/devfs_int.h>.

Suggested by: tegge
Debugging help and testing by: Peter Holm
Approved by: re (kensmith)

17 years agoUse make_dev_credf(MAKEDEV_REF) instead of make_dev() from pty clone handler.
kib [Tue, 3 Jul 2007 17:45:52 +0000 (17:45 +0000)]
Use make_dev_credf(MAKEDEV_REF) instead of make_dev() from pty clone handler.

Debugging help and testing by: Peter Holm
Approved by: re (kensmith)

17 years agoUse make_dev_credf(MAKEDEV_REF) instead of make_dev() from the clone handler.
kib [Tue, 3 Jul 2007 17:44:59 +0000 (17:44 +0000)]
Use make_dev_credf(MAKEDEV_REF) instead of make_dev() from the clone handler.
Lock Giant in the clone handler.
Use destroy_dev_sched() explicitely from pty_maybecleanup() and postpone
pty_release() until both master and slave cdevs are destroyed by setting
it as callback for destroy_dev_sched().

Debugging help and testing by: Peter Holm
Approved by: re (kensmith)

17 years agoUse make_dev_credf(MAKEDEV_REF) instead of make_dev() from snp clone handler.
kib [Tue, 3 Jul 2007 17:43:56 +0000 (17:43 +0000)]
Use make_dev_credf(MAKEDEV_REF) instead of make_dev() from snp clone handler.
Drain clone events and cdev destruction from the module unload handler.

Debugging help and testing by: Peter Holm
Approved by: re (kensmith)

17 years agoAutomatically detect deadlock condition in destroy_dev(), that is, if
kib [Tue, 3 Jul 2007 17:43:20 +0000 (17:43 +0000)]
Automatically detect deadlock condition in destroy_dev(), that is, if
destroy_dev() is called from csw method, and no d_purge driver method is
provided. Transform the direct call to destroy_dev() into destroy_dev_sched().

Reviewed by: njl (programming interface)
Debugging help and testing by: Peter Holm
Approved by: re (kensmith)

17 years agoSince rev. 1.199 of sys/kern/kern_conf.c, the thread that calls
kib [Tue, 3 Jul 2007 17:42:37 +0000 (17:42 +0000)]
Since rev. 1.199 of sys/kern/kern_conf.c, the thread that calls
destroy_dev() from d_close() cdev method would self-deadlock.
devfs_close() bump device thread reference counter, and destroy_dev()
sleeps, waiting for si_threadcount to reach zero for cdev without
d_purge method.

destroy_dev_sched() could be used instead from d_close(), to
schedule execution of destroy_dev() in another context. The
destroy_dev_sched_drain() function can be used to drain the scheduled
calls to destroy_dev_sched(). Similarly, drain_dev_clone_events() drains
the events clone to make sure no lingering devices are left after
dev_clone event handler deregistered.

make_dev_credf(MAKEDEV_REF) function should be used from dev_clone
event handlers instead of make_dev()/make_dev_cred() to ensure that created
device has reference counter bumped before cdev mutex is dropped inside
make_dev().

Reviewed by: tegge (early versions), njl (programming interface)
Debugging help and testing by: Peter Holm
Approved by: re (kensmith)

17 years agoRelock the sema_mtxp unconditionally after copyin() for SETALL case in
kib [Tue, 3 Jul 2007 15:58:47 +0000 (15:58 +0000)]
Relock the sema_mtxp unconditionally after copyin() for SETALL case in
kern_semctl. Otherwise, later mtx_unlock() can operate on unlocked mutex.

Submitted by: rdivacky
MFC after: 3 days
Approved by: re (kensmith)

17 years agoNew release notes: uark(4), nxge(4), KAME IPsec removal and
bmah [Tue, 3 Jul 2007 15:34:00 +0000 (15:34 +0000)]
New release notes:  uark(4), nxge(4), KAME IPsec removal and
FAST_IPSEC promotion, wicontrol(8) gone, PF 4.1.

Modified release notes:  netstat(1) IPsec stats (modified for KAME
IPsec removal).

MFC noted:  less v406.

Approved by: re (implicitly)

17 years agoNew release note: gjournal(8).
bmah [Tue, 3 Jul 2007 14:17:11 +0000 (14:17 +0000)]
New release note:  gjournal(8).

PR: docs/114070
Reminded by: Adam McDougall
Approved by: re (implicitly)

17 years agoLost these during the import. Hand me the pointy hat.
mlaier [Tue, 3 Jul 2007 14:08:49 +0000 (14:08 +0000)]
Lost these during the import.  Hand me the pointy hat.

Approved by: re (implicit)

17 years agoAdd a note about the pf update, mark libexec/ftp-proxy as obsolete and bump
mlaier [Tue, 3 Jul 2007 13:06:45 +0000 (13:06 +0000)]
Add a note about the pf update, mark libexec/ftp-proxy as obsolete and bump
__FreeBSD_version for ports.

Approved by: re (implicit)

17 years agoAdd two place holders in struct pf_rule for future netgraph integration.
mlaier [Tue, 3 Jul 2007 12:58:33 +0000 (12:58 +0000)]
Add two place holders in struct pf_rule for future netgraph integration.

Submitted by: Ermal Luçi
Approved by: re (kensmith)

17 years agoLink pf 4.1 to the build:
mlaier [Tue, 3 Jul 2007 12:46:08 +0000 (12:46 +0000)]
Link pf 4.1 to the build:
 - move ftp-proxy from libexec to usr.sbin
 - add tftp-proxy
 - new altq mtag link

Approved by: re (kensmith)

17 years agoCommit resolved import of OpenBSD 4.1 pf userland from perforce.
mlaier [Tue, 3 Jul 2007 12:30:03 +0000 (12:30 +0000)]
Commit resolved import of OpenBSD 4.1 pf userland from perforce.

Approved by: re (kensmith)

17 years agoThis commit was generated by cvs2svn to compensate for changes in r171169,
mlaier [Tue, 3 Jul 2007 12:22:02 +0000 (12:22 +0000)]
This commit was generated by cvs2svn to compensate for changes in r171169,
which included commits to RCS files with non-trunk default branches.

17 years agoImport pf userland from OpenBSD 4.1 and (for ftp-proxy) libevent 1.3b as
mlaier [Tue, 3 Jul 2007 12:22:02 +0000 (12:22 +0000)]
Import pf userland from OpenBSD 4.1 and (for ftp-proxy) libevent 1.3b as
a local lib.

17 years agoCommit resolved import of OpenBSD 4.1 pf from perforce.
mlaier [Tue, 3 Jul 2007 12:16:07 +0000 (12:16 +0000)]
Commit resolved import of OpenBSD 4.1 pf from perforce.

Approved by: re (kensmith)

17 years agoCommit the change from FAST_IPSEC to IPSEC. The FAST_IPSEC
gnn [Tue, 3 Jul 2007 12:13:45 +0000 (12:13 +0000)]
Commit the change from FAST_IPSEC to IPSEC.  The FAST_IPSEC
option is now deprecated, as well as the KAME IPsec code.
What was FAST_IPSEC is now IPSEC.

Approved by: re
Sponsored by: Secure Computing

17 years agoThis commit was generated by cvs2svn to compensate for changes in r171164,
mlaier [Tue, 3 Jul 2007 12:06:01 +0000 (12:06 +0000)]
This commit was generated by cvs2svn to compensate for changes in r171164,
which included commits to RCS files with non-trunk default branches.

17 years agoImport pf from OpenBSD 4.1
mlaier [Tue, 3 Jul 2007 12:06:01 +0000 (12:06 +0000)]
Import pf from OpenBSD 4.1

17 years agoFix hardware checksum verification on fragments.
mlaier [Tue, 3 Jul 2007 11:50:02 +0000 (11:50 +0000)]
Fix hardware checksum verification on fragments.

MFC after: 7 days
Reported/tested by:  Hugo Koji Kobayashi, Vadym Chepkov
Reviewed/help by: yongari
Approved by: re (kensmith)

17 years agoFixing !INET6 + FAST_IPSEC builds.
avatar [Tue, 3 Jul 2007 07:20:20 +0000 (07:20 +0000)]
Fixing !INET6 + FAST_IPSEC builds.

Reviewed by: gnn
Approved by: re (kensmith)

17 years agoRecover from some major omissions/problems with the 24XX port.
mjacob [Mon, 2 Jul 2007 20:08:20 +0000 (20:08 +0000)]
Recover from some major omissions/problems with the 24XX port.
First, we were never correctly checking for a 24XX Status Type 0
response- that cased us to fall through to evaluate status for
commands as if this were a 2100/2200/2300 Status Type 0 response.
This is *close*, but not quite the same. This has been reported
to be apparent with some wierd lun configuration problems with
some arrays. It became glaringly apparent on sparc64 where none
of the correct byte swap things were done.

Fixing this omission then caused a whole universe shifting debug
cycle of endian issues for the 2400. The manual for 24XX f/w turns
out to be wrong about the endianness of a couple of entities. The
lun and cdb fields for the type 7 request are *not* unconditionally
big endian- they happen to be opposite of whatever the endian of
the current machine type is. Same with the sense data for the
24XX type 0 response.

While we're at it investigate and resolve some NVRAM endian
issues.

Approved by: re (ken)
MFC after: 3 days

17 years ago- Consolidate the code that free's chunks to actually also
rrs [Mon, 2 Jul 2007 19:22:22 +0000 (19:22 +0000)]
- Consolidate the code that free's chunks to actually also
  call the sctp_free_remote_address() function.
- Assure that when we allocate a chunk the whoTo is NULL,
  also when we free it and place it into the cache we NULL
  it (that way the consolidation code will always work).
- Fix a small race, when a empty data holder is left on the stream
  out queue, and both sides do a shutdown, the empty data holder
  would prevent us from sending a SHUTDOWN-ACK and at the same time we
  never  would cleanup the empty holder (since nothing was ever in queue).
  We now add a utility function that a) cleans up empty holders and
  b) properly determines if there are still pending data chunks on
  the stream out wheel.
Approved by: re@freebsd.org (Ken Smith)

17 years agoContinue pre-7.0 privilege cleanup: update suser(9) comments to be priv(9)
rwatson [Mon, 2 Jul 2007 15:44:30 +0000 (15:44 +0000)]
Continue pre-7.0 privilege cleanup: update suser(9) comments to be priv(9)
comments.

Approved by: re (bmah)

17 years agoContinue kernel privilege cleanup for 7.0: unstaticize suser_enabled and
rwatson [Mon, 2 Jul 2007 14:03:29 +0000 (14:03 +0000)]
Continue kernel privilege cleanup for 7.0: unstaticize suser_enabled and
stop declaring it in systm.h -- it's used only in kern_priv.c and is not
required elsewhere.

Approved by: re (kensmith)

17 years agoed(1) no longer relies on crypto library when built for the fixit media.
kensmith [Mon, 2 Jul 2007 14:01:43 +0000 (14:01 +0000)]
ed(1) no longer relies on crypto library when built for the fixit media.

Approved by: re (hrs)

17 years agoDon't include encryption features of ed(1) when building for the
kensmith [Mon, 2 Jul 2007 14:00:25 +0000 (14:00 +0000)]
Don't include encryption features of ed(1) when building for the
"rescue media" bundled with releases.

Suggested by: ru
Approved by: re (hrs)

17 years ago- Add some needed error checking on bad fd passing in the sctp
rrs [Mon, 2 Jul 2007 12:50:53 +0000 (12:50 +0000)]
- Add some needed error checking on bad fd passing in the sctp
  syscalls.
Approved by: re@freebsd.org (Ken Smith)
Obtained from: Weongyo Jeong (weongyo.jeong@gmail.com)

17 years ago- Removes some incorrect error returns (errno was being overriden in
rrs [Mon, 2 Jul 2007 10:52:34 +0000 (10:52 +0000)]
- Removes some incorrect error returns (errno was being overriden in
 one of the functions)
- Fixes the error return of sctp_get_opt, it was returning the errno not
 -1.
Approved by: re@freebsd.org (Robert Watson)
Obtained from: Weongyo Jeong (weongyo.jeong@gmail.com)

17 years agoIn the previous revision, when I replaced the unconditional acquisition
alc [Mon, 2 Jul 2007 06:56:37 +0000 (06:56 +0000)]
In the previous revision, when I replaced the unconditional acquisition
of Giant in vm_pageout_scan() with VFS_LOCK_GIANT(), I had to eliminate
the acquisition of the vnode interlock before releasing the vm object's
lock because the vnode interlock cannot be held when VFS_LOCK_GIANT() is
performed.  Unfortunately, this allows the vnode to be recycled between
the release of the vm object's lock and the vget() on the vnode.

In this revision, I prevent the vnode from being recycled by acquiring
another reference to the vm object and underlying vnode before releasing
the vm object's lock.

This change also addresses another preexisting but trivial problem.  By
acquiring another reference to the vm object, I also prevent the vm
object from being recycled.  Previously, the "vnodes skipped" counter
could be wrong because if it examined a recycled vm object.

Reported by: kib
Reviewed by: kib
Approved by: re (kensmith)
MFC after: 3 weeks

17 years agoWD Firewire/USB Combo hangs under load on USB interface. Fix with
imp [Mon, 2 Jul 2007 04:55:56 +0000 (04:55 +0000)]
WD Firewire/USB Combo hangs under load on USB interface.  Fix with
these quirks.

Submitted by: John Pettitt
PR: 79140
Approved by: re@ (blanket)

17 years agoRemoving old, dead, KAME IPsec files as part of the move to the
gnn [Mon, 2 Jul 2007 04:02:21 +0000 (04:02 +0000)]
Removing old, dead, KAME IPsec files as part of the move to the
new FAST_IPSEC based IPsec stack.

Approved by: re
Reviewed by: bz

17 years agoFix an annoying pointer/int cast warning that shows up on 64 bit systems.
peter [Mon, 2 Jul 2007 01:31:43 +0000 (01:31 +0000)]
Fix an annoying pointer/int cast warning that shows up on 64 bit systems.

Approved by:  re

17 years agoRevert previous commit, retaining cpufreq.
njl [Sun, 1 Jul 2007 22:19:20 +0000 (22:19 +0000)]
Revert previous commit, retaining cpufreq.

Approved by: re (implicitly)

17 years agoAdd cpufreq(4) to GENERIC. It does not change the frequency by default,
njl [Sun, 1 Jul 2007 21:47:45 +0000 (21:47 +0000)]
Add cpufreq(4) to GENERIC.  It does not change the frequency by default,
so systems should be relatively unaffected.  Users can then simply enable
powerd(8) in rc.conf to take advantage of it.

Approved by: re

17 years agoRemove two boot printfs generated by Audit to announce it's presence,
rwatson [Sun, 1 Jul 2007 20:51:30 +0000 (20:51 +0000)]
Remove two boot printfs generated by Audit to announce it's presence,
and replace with software-testable sysctl node (security.audit) that
can be used to detect kernel audit support.

Obtained from: TrustedBSD Project
Approved by: re (kensmith)

17 years agoThe wicontrol(8) manpage is obsolete too.
thompsa [Sun, 1 Jul 2007 20:05:19 +0000 (20:05 +0000)]
The wicontrol(8) manpage is obsolete too.

Pointed out by: Pawel Worach
Approved by: re (rwatson)

17 years agoAfter talking with njl@, change this wildcard entry to be a bit less wild.
imp [Sun, 1 Jul 2007 17:42:07 +0000 (17:42 +0000)]
After talking with njl@, change this wildcard entry to be a bit less wild.

Approved by: re (blanket)