]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 years agoTurn on -Werror for sparc64 and sun4v.
Peter Wemm [Fri, 6 Jul 2007 00:52:29 +0000 (00:52 +0000)]
Turn on -Werror for sparc64 and sun4v.

Approved by: re (rwatson)

17 years agoFix warnings.
Peter Wemm [Fri, 6 Jul 2007 00:47:44 +0000 (00:47 +0000)]
Fix warnings.
nxge: cast page size fragments down to (int). If the vm's demand paging
PAGE_SIZE is ever too big for that, we've got far bigger problems.
ofw: move va_start() a little earlier. gcc-4.2 doesn't like us modifying
the last arg before the va_start().

Approved by: re (rwatson)

17 years agoFix warning - add missing #include
Peter Wemm [Fri, 6 Jul 2007 00:41:53 +0000 (00:41 +0000)]
Fix warning - add missing #include

Submitted by: mjacob
Approved by: re (rwatson)

17 years agore(4) devices requires an external EEPROM. Depending on models it
Pyun YongHyeon [Fri, 6 Jul 2007 00:05:12 +0000 (00:05 +0000)]
re(4) devices requires an external EEPROM. Depending on models it
would be 93C46(1Kbit) or 93C56(2Kbit). One of differences between them
is number of address lines required to access the EEPROM. For example,
93C56 EEPROM needs 8 address lines to read/write data. If 93C56
recevied premature end of required number of serial clock(CLK) to set
OP code/address of EEPROM, the result would be unexpected behavior.
Previously it tried to detect 93C46, which requires 6 address lines,
and then assumed it would be 93C56 if read data was not expected
value. However, this approach didn't work in some models/situations
as 93C56 requries 8 address lines to access its data. In order to fix
it, change EEPROM probing order such that 93C56 is detected reliably.

While I'm here change hard-coded address line numbers with defined
constant to enhance readability.

PR: 112710
Approved by: re (mux)

17 years agoForced commit to note a repo-copy of this file from
Bjoern A. Zeeb [Thu, 5 Jul 2007 21:52:43 +0000 (21:52 +0000)]
Forced commit to note a repo-copy of this file from
  src/sys/i386/include/
so it will be available to all architectures once I4B compiles on those.

Approved by: re (kensmith)

17 years agoFix remaining syntax errors (missing semicolons)
Peter Wemm [Thu, 5 Jul 2007 17:42:00 +0000 (17:42 +0000)]
Fix remaining syntax errors (missing semicolons)

Submitted by: Björn König <bkoenig@cs.tu-berlin.de>
Approved by: re (kensmith, followup commits)

17 years agoSpace cleanup
Xin LI [Thu, 5 Jul 2007 16:29:40 +0000 (16:29 +0000)]
Space cleanup

Approved by: re (rwatson)

17 years agoANSIfy[1] plus some style cleanup nearby.
Xin LI [Thu, 5 Jul 2007 16:23:49 +0000 (16:23 +0000)]
ANSIfy[1] plus some style cleanup nearby.

Discussed with: gnn, rwatson
Submitted by: Karl Sj?dahl - dunceor <dunceor gmail com> [1]
Approved by: re (rwatson)

17 years agoAdded comments eplaining the requirement for device crypto with IPSEC
George V. Neville-Neil [Thu, 5 Jul 2007 15:33:13 +0000 (15:33 +0000)]
Added comments eplaining the requirement for device crypto with IPSEC

Approved by: re

17 years agoRemove unused variable from pf_subr.c to make it -Werror buildable.
Max Laier [Thu, 5 Jul 2007 15:28:59 +0000 (15:28 +0000)]
Remove unused variable from pf_subr.c to make it -Werror buildable.

Approved by: re (kensmith)

17 years agoPrefer device_printf to printf + device_get_nameunit. This saves
Warner Losh [Thu, 5 Jul 2007 15:25:32 +0000 (15:25 +0000)]
Prefer device_printf to printf + device_get_nameunit.  This saves
about 100 bytes.

Approved by: re (blanket)

17 years agoMFp4: Fixing IPW_DEBUG enabled builds by converting the last piece of
Tai-hwa Liang [Thu, 5 Jul 2007 15:06:49 +0000 (15:06 +0000)]
MFp4: Fixing IPW_DEBUG enabled builds by converting the last piece of
ic->ic_des_essid to ic->ic_des_ssid[0].

Reviewed by: sam
Approved by: re (kensmith)

17 years agoIf the mech_type argument to gss_display_status is null, use a default
Doug Rabson [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:
Robert Watson [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()
Konstantin Belousov [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.
Konstantin Belousov [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 Abdullah [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,
Xin LI [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 Wemm [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
Andrew Thompson [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.
Bjoern A. Zeeb [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
Bjoern A. Zeeb [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.
Bjoern A. Zeeb [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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
Warner Losh [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(),...);
Warner Losh [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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:
Warner Losh [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
Warner Losh [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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 Wemm [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
George V. Neville-Neil [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.
Suleiman Souhlal [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
Bjoern A. Zeeb [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 Abdullah [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()
Konstantin Belousov [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
Tai-hwa Liang [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.
George V. Neville-Neil [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 Wemm [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
Bjoern A. Zeeb [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
Sean Farley [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 Roberson [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 Roberson [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:
John Baldwin [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
John Baldwin [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
John Baldwin [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
Konstantin Belousov [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
Andrew Thompson [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.
Konstantin Belousov [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.
Konstantin Belousov [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.
Konstantin Belousov [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.
Konstantin Belousov [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
Konstantin Belousov [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
Konstantin Belousov [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
Konstantin Belousov [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
Bruce A. Mah [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).
Bruce A. Mah [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.
Max Laier [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
Max Laier [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.
Max Laier [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:
Max Laier [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.
Max Laier [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,
Max Laier [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
Max Laier [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.
Max Laier [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
George V. Neville-Neil [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,
Max Laier [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
Max Laier [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.
Max Laier [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.
Tai-hwa Liang [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.
Matt Jacob [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
Randall Stewart [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)
Robert Watson [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
Robert Watson [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.
Ken Smith [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)