]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoThe flow-table function flowtable_route_flush() may be called
Qing Li [Tue, 20 Oct 2009 21:27:03 +0000 (21:27 +0000)]
The flow-table function flowtable_route_flush() may be called
during system initialization time. Since the flow-table is
designed to maintain per CPU flow cache, the existing code
did not check whether "smp_started" is true before calling
sched_bind() and sched_unbind(), which triggers a page fault.

Reviewed by: jeff
MFC after: immediately

14 years agoFix a case where rename actually succeeds, which is also expected behaviour
Pawel Jakub Dawidek [Tue, 20 Oct 2009 21:08:32 +0000 (21:08 +0000)]
Fix a case where rename actually succeeds, which is also expected behaviour
according to POSIX. This fixes ZFS on Solaris testing.

Submitted by: Milan Cermak <Milan.Cermak@Sun.COM>

14 years agoMake mxge do a better job recovering from NIC h/w faults
Andrew Gallatin [Tue, 20 Oct 2009 18:58:28 +0000 (18:58 +0000)]
Make mxge do a better job recovering from NIC h/w faults
by checking PCI config space when the NIC is not
transmitting.  Previously, a h/w fault would not have been
detected if the NIC was down, or handling an RX only
workload.

14 years agoIn the ARP callout timer expiration function, the current time_second
Qing Li [Tue, 20 Oct 2009 17:55:42 +0000 (17:55 +0000)]
In the ARP callout timer expiration function, the current time_second
is compared against the entry expiration time value (that was set based
on time_second) to check if the current time is larger than the set
expiration time. Due to the +/- timer granularity value, the comparison
returns false, causing the alternative code to be executed. The
alternative code path freed the memory without removing that entry
from the table list, causing a use-after-free bug.

Reviewed by: discussed with kmacy
MFC after: immediately
Verified by: rnoland, yongari

14 years agoRandom number generator initialization cleanup:
Ruslan Ermilov [Tue, 20 Oct 2009 16:36:51 +0000 (16:36 +0000)]
Random number generator initialization cleanup:

- Introduce new SI_SUB_RANDOM point in boot sequence to make it
clear from where one may start using random(9).  It should be as
early as possible, so place it just after SI_SUB_CPU where we
have some randomness on most platforms via get_cyclecount().

- Move stack protector initialization to be after SI_SUB_RANDOM
as before this point we have no randomness at all.  This fixes
stack protector to actually protect stack with some random guard
value instead of a well-known one.

Note that this patch doesn't try to address arc4random(9) issues.
With current code, it will be implicitly seeded by stack protector
and hence will get the same entropy as random(9).  It will be
securely reseeded once /dev/random is feeded by some entropy from
userland.

Submitted by: Maxim Dounin <mdounin@mdounin.ru>
MFC after: 3 days

14 years agoUnloading of the nfscl module is unsupported because newnfslock doesn't
Jaakko Heinonen [Tue, 20 Oct 2009 15:06:18 +0000 (15:06 +0000)]
Unloading of the nfscl module is unsupported because newnfslock doesn't
support unloading. It's not trivial to implement newnfslock unloading so
for now just admit that unloading is unsupported and refuse to attempt
unload in all nfscl module event handlers.

Reviewed by: rmacklem
Approved by: trasz (mentor)

14 years agoFix ordering of nfscl_modevent() and ncl_uninit(). nfscl_modevent() must
Jaakko Heinonen [Tue, 20 Oct 2009 15:01:46 +0000 (15:01 +0000)]
Fix ordering of nfscl_modevent() and ncl_uninit(). nfscl_modevent() must
be called after ncl_uninit() when unloading the nfscl module because
ncl_uninit() uses ncl_iod_mutex which is destroyed in nfscl_modevent().

Reviewed by: rmacklem
Approved by: trasz (mentor)

14 years agoFix comment typos.
Jaakko Heinonen [Tue, 20 Oct 2009 14:57:26 +0000 (14:57 +0000)]
Fix comment typos.

Reviewed by: rmacklem
Approved by: trasz (mentor)

14 years agoichwd.4: fix r198272, restore watchdogd(8) reference
Andriy Gapon [Tue, 20 Oct 2009 14:06:07 +0000 (14:06 +0000)]
ichwd.4: fix r198272, restore watchdogd(8) reference

In r198272 I didn't notice that watchdog(8) and watchdogd(8)
are different things and instead of fixing watchdogd markup
I simply nuked the line.

Noticed by: emaste
Pointy hat to: avg

14 years agoUpdate package list for 8.0-REL.
Ken Smith [Tue, 20 Oct 2009 13:58:30 +0000 (13:58 +0000)]
Update package list for 8.0-REL.

Reviewed by: re@, portmgr@
MFC after: 1 day

14 years agominor: fix sorting of some amd* entries in some makefiles
Andriy Gapon [Tue, 20 Oct 2009 13:22:54 +0000 (13:22 +0000)]
minor: fix sorting of some amd* entries in some makefiles

MFC after: 1 week

14 years agoAllow KMOD with hypens and dots.
Max Khon [Tue, 20 Oct 2009 11:54:06 +0000 (11:54 +0000)]
Allow KMOD with hypens and dots.

MFC after: 1 week

14 years agoichwd.4: remove a stray line
Andriy Gapon [Tue, 20 Oct 2009 09:32:22 +0000 (09:32 +0000)]
ichwd.4: remove a stray line

Nod from: des
MFC after: 3 days

14 years agoadd amdtemp to i386 NOTES
Andriy Gapon [Tue, 20 Oct 2009 09:31:57 +0000 (09:31 +0000)]
add amdtemp to i386 NOTES

essentially this is a MFamd64

Nod from: rpaulo

14 years agoMFV of tzdata2009o:
Edwin Groothuis [Tue, 20 Oct 2009 07:03:06 +0000 (07:03 +0000)]
MFV of tzdata2009o:

- Somoa has not moved to DST this year (comment only)
- Bangladesh stays on DST for now.
- Pakistan went back to standard time in 1 October 2009

MFC after: 1 week

14 years agoVendor import of tzdata2009o:
Edwin Groothuis [Tue, 20 Oct 2009 07:00:00 +0000 (07:00 +0000)]
Vendor import of tzdata2009o:

- Somoa has not moved to DST this year (comment only)
- Bangladesh stays on DST for now.
- Pakistan went back to standard time in 1 October 2009

Obtained from: ftp://elsie.nci.nih.gov/pub/

14 years agoInstead of having to know which timezone was picked last time, you
Edwin Groothuis [Tue, 20 Oct 2009 06:54:31 +0000 (06:54 +0000)]
Instead of having to know which timezone was picked last time, you
now can run "tzsetup -r" which will reinstall the last choice. This
data is recorded in /var/db/zoneinfo.

MFC after:  1 week

14 years agoUse callout_init_mtx on FreeBSD versions recent enough. This closes
Alexander Kabaev [Tue, 20 Oct 2009 02:35:12 +0000 (02:35 +0000)]
Use callout_init_mtx on FreeBSD versions recent enough. This closes
the race where interrupt thread can complete the request for which
timeout has fired and while mpt_timeout has blocked on mpt_lock.

Do a best effort to keep 4.x ang Giant-locked configurartions
compiling still.

Reported by: ups
Reviewed by: scottl

14 years agoFix a bug in composing PERR frames introduced by latest draft update.
Rui Paulo [Mon, 19 Oct 2009 23:11:43 +0000 (23:11 +0000)]
Fix a bug in composing PERR frames introduced by latest draft update.

MFC after: 3 days

14 years agoRemove a redundant option ROM check, which was never meant to be committed.
Jung-uk Kim [Mon, 19 Oct 2009 23:09:39 +0000 (23:09 +0000)]
Remove a redundant option ROM check, which was never meant to be committed.

14 years agoAdd opt_gdb.h which is now needed by ucom.
Andrew Thompson [Mon, 19 Oct 2009 21:54:41 +0000 (21:54 +0000)]
Add opt_gdb.h which is now needed by ucom.

14 years agoAdd support for newer WinChipHead CH341 chips, previously in the uch341 driver.
Andrew Thompson [Mon, 19 Oct 2009 21:52:02 +0000 (21:52 +0000)]
Add support for newer WinChipHead CH341 chips, previously in the uch341 driver.

Submitted by: HPS

14 years agoRemove the newly added uch341 driver, it will be merged into uchcom instead.
Andrew Thompson [Mon, 19 Oct 2009 21:43:59 +0000 (21:43 +0000)]
Remove the newly added uch341 driver, it will be merged into uchcom instead.

Suggested by: takawata
Submitted by: HPS

14 years agoMake the usage of the default zoneinfo file to install clearer.
Edwin Groothuis [Mon, 19 Oct 2009 21:37:31 +0000 (21:37 +0000)]
Make the usage of the default zoneinfo file to install clearer.

MFC after:  1 week

14 years agoWhen tzsetup is run as non-root and the "CMOS clock question on
Edwin Groothuis [Mon, 19 Oct 2009 21:24:19 +0000 (21:24 +0000)]
When tzsetup is run as non-root and the "CMOS clock question on
UTC" is answered as No, it would abort without properly ending the
dialog session.

MFC after:  1 week

14 years agoFix a copy-and-pasto in the previous commit.
Jung-uk Kim [Mon, 19 Oct 2009 21:01:42 +0000 (21:01 +0000)]
Fix a copy-and-pasto in the previous commit.

14 years agoRewrite x86bios and update its dependent drivers.
Jung-uk Kim [Mon, 19 Oct 2009 20:58:10 +0000 (20:58 +0000)]
Rewrite x86bios and update its dependent drivers.

- Do not map entire real mode memory (1MB).  Instead, we map IVT/BDA and
ROM area separately.  Most notably, ROM area is mapped as device memory
(uncacheable) as it should be.  User memory is dynamically allocated and
free'ed with contigmalloc(9) and contigfree(9).  Remove now redundant and
potentially dangerous x86bios_alloc.c.  If this emulator ever grows to
support non-PC hardware, we may implement it with rman(9) later.
- Move all host-specific initializations from x86emu_util.c to x86bios.c and
remove now unnecessary x86emu_util.c.  Currently, non-PC hardware is not
supported.  We may use bus_space(9) later when the KPI is fixed.
- Replace all bzero() calls for emulated registers with more obviously named
x86bios_init_regs().  This function also initializes DS and SS properly.
- Add x86bios_get_intr().  This function checks if the interrupt vector is
available for the platform.  It is not necessary for PC-compatible hardware
but it may be needed later. ;-)
- Do not try turning off monitor if DPMS does not support the state.
- Allocate stable memory for VESA OEM strings instead of just holding
pointers to them.  They may or may not be accessible always.  Fix a memory
leak of video mode table while I am here.
- Add (experimental) BIOS POST call for vesa(4).  This function calls VGA
BIOS POST code from the current VGA option ROM.  Some video controllers
cannot save and restore the state properly even if it is claimed to be
supported.  Usually the symptom is blank display after resuming from suspend
state.  If the video mode does not match the previous mode after restoring,
we try BIOS POST and force the known good initial state.  Some magic was
taken from NetBSD (and it was taken from vbetool, I believe.)
- Add a loader tunable for vgapci(4) to give a hint to dpms(4) and vesa(4)
to identify who owns the VESA BIOS.  This is very useful for multi-display
adapter setup.  By default, the POST video controller is automatically
probed and the tunable "hw.pci.default_vgapci_unit" is set to corresponding
vgapci unit number.  You may override it from loader but it is very unlikely
to be necessary.  Unfortunately only AGP/PCI/PCI-E controllers can be
matched because ISA controller does not have necessary device IDs.
- Fix a long standing bug in state save/restore function.  The state buffer
pointer should be ES:BX, not ES:DI according to VBE 3.0.  If it ever worked,
that's because BX was always zero. :-)
- Clean up register initializations more clearer per VBE 3.0.
- Fix a lot of style issues with vesa(4).

14 years agoMove mxge(4)'s NIC watchdog reset handler from
Andrew Gallatin [Mon, 19 Oct 2009 20:51:27 +0000 (20:51 +0000)]
Move mxge(4)'s NIC watchdog reset handler from
a callout to a taskqueue

14 years agoImplement the missing support for updating the mesh conf number of
Rui Paulo [Mon, 19 Oct 2009 18:46:22 +0000 (18:46 +0000)]
Implement the missing support for updating the mesh conf number of
neighbors via ieee80211_beacon_notify().

MFC after: 3 days

14 years agoMerge ACPICA 20091013.
Jung-uk Kim [Mon, 19 Oct 2009 16:12:58 +0000 (16:12 +0000)]
Merge ACPICA 20091013.

14 years agoSwitch the default WARNS level for sbin/ to 6.
Ruslan Ermilov [Mon, 19 Oct 2009 16:00:24 +0000 (16:00 +0000)]
Switch the default WARNS level for sbin/ to 6.

Submitted by: Ulrich Spörlein

14 years agoClean up markup (mainly).
Ruslan Ermilov [Mon, 19 Oct 2009 15:50:59 +0000 (15:50 +0000)]
Clean up markup (mainly).

14 years agoClean up comments, white space, and style in pfil.c (especially new VNET
Robert Watson [Mon, 19 Oct 2009 15:19:14 +0000 (15:19 +0000)]
Clean up comments, white space, and style in pfil.c (especially new VNET
bits).

MFC after: 3 days (not VNET bits)

14 years agoPowercrypt and NetSec seem to be defunct (webpages point to link farms
Christian Brueffer [Mon, 19 Oct 2009 14:36:12 +0000 (14:36 +0000)]
Powercrypt and NetSec seem to be defunct (webpages point to link farms
and a google search yields no alternative).  Remove the links but
keep the entries around for reference.

PR: 139756
Submitted by: Patrick Oonk <patrick@pine.nl>
MFC after: 3 days

14 years agoProperly re-create "-s size" argument to newfs(8).
Ruslan Ermilov [Mon, 19 Oct 2009 14:04:19 +0000 (14:04 +0000)]
Properly re-create "-s size" argument to newfs(8).

14 years agoHWMP fixes, namely:
Rui Paulo [Mon, 19 Oct 2009 11:17:46 +0000 (11:17 +0000)]
HWMP fixes, namely:
* fix the processing of RANN frames
* the originator and target addresses were swapped and while it worked
fine, it was not spec compliant.

MFC after: 3 days

14 years agoPartially revert the change to the gettytab made in r198214.
Ed Schouten [Mon, 19 Oct 2009 11:10:44 +0000 (11:10 +0000)]
Partially revert the change to the gettytab made in r198214.

By misinterpreting some data, I thought that getty wouldn't apply any
baud rate to the syscons devices, but it uses the default entry instead.
This means that the baud rate is set to 1200. This isn't too bad, except
when using canonical mode. Make it use 9600 baud by default.

MFC after: 1 week

14 years agoUpdate copyright.
Dag-Erling Smørgrav [Mon, 19 Oct 2009 07:56:03 +0000 (07:56 +0000)]
Update copyright.

14 years agoRemove redundant $FreeBSD$.
Dag-Erling Smørgrav [Mon, 19 Oct 2009 07:55:13 +0000 (07:55 +0000)]
Remove redundant $FreeBSD$.

14 years agoProperly set the low watermarks when reducing the baud rate.
Ed Schouten [Mon, 19 Oct 2009 07:17:37 +0000 (07:17 +0000)]
Properly set the low watermarks when reducing the baud rate.

Now that buffers are deallocated lazily, we should not use
tty*q_getsize() to obtain the buffer size to calculate the low
watermarks. Doing this may cause the watermark to be placed outside the
typical buffer size.

This caused some regressions after my previous commit to the TTY code,
which allows pseudo-devices to resize the buffers as well.

Reported by: yongari, dougb
MFC after: 1 week

14 years agoRemove unused pfil_flags field in packet_filter_hook.
Robert Watson [Sun, 18 Oct 2009 22:54:09 +0000 (22:54 +0000)]
Remove unused pfil_flags field in packet_filter_hook.

MFC after: 3 days

14 years agoSort function prototypes in pfil.h, clean up white space, and better
Robert Watson [Sun, 18 Oct 2009 22:43:28 +0000 (22:43 +0000)]
Sort function prototypes in pfil.h, clean up white space, and better
align fields for printing.

MFC after: 3 days

14 years agoDon't forget to increment the man page date.
Ed Schouten [Sun, 18 Oct 2009 20:33:24 +0000 (20:33 +0000)]
Don't forget to increment the man page date.

Reported by: bz

14 years agoFix qouting in a comment, to make it look more consistent
Ed Schouten [Sun, 18 Oct 2009 19:51:06 +0000 (19:51 +0000)]
Fix qouting in a comment, to make it look more consistent

Submitted by: Jille Timmermans <jille quis cx>
MFC after: 1 week

14 years agoFix a typo in the jail(8) manpage.
Ed Schouten [Sun, 18 Oct 2009 19:50:15 +0000 (19:50 +0000)]
Fix a typo in the jail(8) manpage.

Submitted by: Jille Timmermans <jille quis cx>
MFC after: 1 week

14 years agoAllow the buffer size to be configured for pseudo-like TTY devices.
Ed Schouten [Sun, 18 Oct 2009 19:48:53 +0000 (19:48 +0000)]
Allow the buffer size to be configured for pseudo-like TTY devices.

Devices that don't implement param() (which means they don't support
hardware parameters such as flow control, baud rate) hardcode the baud
rate to TTYDEF_SPEED. This means the buffer size cannot be configured,
which is a little inconvenient when using canonical mode with big lines
of input, etc.

Make it adjustable, but do clamp it between B50 and B115200 to prevent
awkward buffer sizes. Remove the baud rate assignment from
/etc/gettytab. Trust the kernel to fill in a proper value.

Reported by: Mikolaj Golub <to my trociny gmail com>
MFC after: 1 month

14 years agoMake lock devices work properly.
Ed Schouten [Sun, 18 Oct 2009 19:45:44 +0000 (19:45 +0000)]
Make lock devices work properly.

It turned out I did add the code to use the init state devices to set
the termios structure when opening the device, but it seems I totally
forgot to add the bits required to force the actual locking of flags
through the lock state devices.

Reported by: ru
MFC after: 1 week (to be discussed)

14 years agoDon't assume that physical addresses are identity mapped. This allows
Nathan Whitehorn [Sun, 18 Oct 2009 17:22:08 +0000 (17:22 +0000)]
Don't assume that physical addresses are identity mapped. This allows
the second processor on G5 systems to start. Note that SMP is still
non-functional on these systems because of IPI delivery problems.

14 years agoWork around a quirk with the G5 Xserve, which has a fake GMAC controller
Nathan Whitehorn [Sun, 18 Oct 2009 17:11:16 +0000 (17:11 +0000)]
Work around a quirk with the G5 Xserve, which has a fake GMAC controller
with an all-zero MAC address. In this case, don't attach.

Discussed with: marius

14 years agoo OpenBSD 4.6 added.
Maxim Konovalov [Sun, 18 Oct 2009 17:10:39 +0000 (17:10 +0000)]
o OpenBSD 4.6 added.

14 years agoFix KASSERT string to include the real module name.
Rui Paulo [Sun, 18 Oct 2009 13:51:49 +0000 (13:51 +0000)]
Fix KASSERT string to include the real module name.

14 years agoChange the load base to below 2GB so PIE binaries work including when
Marius Strobl [Sun, 18 Oct 2009 13:08:15 +0000 (13:08 +0000)]
Change the load base to below 2GB so PIE binaries work including when
compiled to use the Medium/Low code model, which we currently default
to for the userland. GNU/Linux has moved their default to Medium/Middle
some time ago, which probably explains why the current GNU ld(1) uses
a base in the range between 32 and 44 bits instead.

Submitted by: kib

14 years agoIf ET_DYN binary has non-zero base address for some reason, honour it
Konstantin Belousov [Sun, 18 Oct 2009 12:57:48 +0000 (12:57 +0000)]
If ET_DYN binary has non-zero base address for some reason, honour it
and do not relocate the binary to ET_DYN_LOAD_ADDR. This allows for the
binary author to influence address map of the process. In particular,
when the binary is actually an interpeter, this allows to have almost
usual process address map.

Communicate the relocation bias of the mapping for interpeter-less
ET_DYN binary, that is interperter itself, in AT_BASE aux entry. This
way, rtld is able to find its dynamic structure and relocate itself.
Note that mapbase in the rtld is still wrong and requires further
fixing.

Reported and tested by: rwatson
Discussed with: kan
MFC after: 3 days

14 years agoRemove spurious call to priv_check(PRIV_VM_SWAP_NOQUOTA).
Konstantin Belousov [Sun, 18 Oct 2009 12:55:39 +0000 (12:55 +0000)]
Remove spurious call to priv_check(PRIV_VM_SWAP_NOQUOTA).
Call priv_check(PRIV_VM_SWAP_NORLIMIT) only when per-uid limit is
actually exceed.

Both changes aim at calling priv_check(9) only for the cases when
privilege is actually exercised by the process.

Reported and tested by: rwatson
Reviewed by: alc
MFC after: 3 days

14 years agoReset UPTODATE gnodes after remaking makefiles when make
Max Khon [Sun, 18 Oct 2009 11:28:31 +0000 (11:28 +0000)]
Reset UPTODATE gnodes after remaking makefiles when make
is not going to be restarted: such nodes could be marked UPTODATE
without doing rebuild due to remakingMakefiles being TRUE.

14 years agoLine-wrap pfil.c so that it prints more nicely.
Robert Watson [Sun, 18 Oct 2009 11:27:34 +0000 (11:27 +0000)]
Line-wrap pfil.c so that it prints more nicely.

MFC after: 3 days

14 years agoExit with non-zero error code in case of errors
Max Khon [Sun, 18 Oct 2009 11:26:09 +0000 (11:26 +0000)]
Exit with non-zero error code in case of errors
when make is run with -k and not parallel (compat) make is run.

14 years agoRewrap ip_input() comment so that it prints more nicely.
Robert Watson [Sun, 18 Oct 2009 11:23:56 +0000 (11:23 +0000)]
Rewrap ip_input() comment so that it prints more nicely.

MFC after: 3 days

14 years agoadds devices supportted by urtw(4) and bumps date.
Weongyo Jeong [Sun, 18 Oct 2009 00:46:59 +0000 (00:46 +0000)]
adds devices supportted by urtw(4) and bumps date.

14 years agooverhauls urtw(4) for supporting RTL8187B devices properly that there
Weongyo Jeong [Sun, 18 Oct 2009 00:11:49 +0000 (00:11 +0000)]
overhauls urtw(4) for supporting RTL8187B devices properly that there
was major changes to initialize RF chipset and set H/W registers and
removed a lot of magic numbers on code.  Details are as follows:

  - uses the endpoint 0x89 to get TX status information which used to
    get TX complete or retry numbers or get a beacon interrupt.  It's
    only valuable for RTL8187B.
  - removes urtw_write[8|16|32]_i functions that it's useless now.
  - uses ic->ic_updateslot to set SLOT, SIFS, DIES, EIFS, CW_VAL
    registers that doesn't set these whenever the channel is changed.
  - code for initializing RF chipset for RTL8187B changed a lot that
    there was many problems on TX transfers so it doesn't work properly
    even if just for a ping/pong.  Now it becomes more stable than
    before that TX throughputs using netperf(1) were about 15 ~ 17Mbps/s
    though sometimes it encounters packet losses.
  - removes a lot of magic numbers that in the previous all of
    representing RX and TX descriptors were consisted of magic numbers
    and structures.  It'd be more readable rather than before.
  - calculates TX duration more accurately for urtw(4) devices.
  - style(9)

14 years agoRemove a circular dependency on routing
Doug Barton [Sat, 17 Oct 2009 21:09:15 +0000 (21:09 +0000)]
Remove a circular dependency on routing

Submitted by: Mykola Dzham <freebsd@levsha.org.ua>
Approved by: hrs

14 years agoCheck error of dlfunc(3).
Hajimu UMEMOTO [Sat, 17 Oct 2009 15:53:15 +0000 (15:53 +0000)]
Check error of dlfunc(3).

MFC after: 3 days

14 years agoPrint backspaces after echoing an EOF.
Ed Schouten [Sat, 17 Oct 2009 08:59:41 +0000 (08:59 +0000)]
Print backspaces after echoing an EOF.

Applications like shells expect EOF to give no graphical output, while
our implementation prints ^D by default (tunable with stty echoctl).
Make the new implementation behave like the old TTY code. Print two
backspaces afterwards.

Reported by: koitsu
MFC after: 1 month

14 years agoAdd myself.
Neel Natu [Sat, 17 Oct 2009 00:33:55 +0000 (00:33 +0000)]
Add myself.

Approved by: imp (mentor)

14 years ago- If lstat()/stat() fails with an error other than ENOENT, don't ignore
Jaakko Heinonen [Fri, 16 Oct 2009 20:52:45 +0000 (20:52 +0000)]
- If lstat()/stat() fails with an error other than ENOENT, don't ignore
  the error and assume that the file doesn't exist. Touch could return
  success with -c option even if the file existed and time was not set.
- If the first utimes_f() call fails with -A option, give up and don't
  continue trying to set times to current time. [1]
- Set exit status to 1 when setting of timestamps fails for a directory
  or symbolic link even though lstat()/stat() would succeed.
- Don't print bogus error message when rw() succeeds.

PR: bin/112213
Submitted by: jilles [1]
Reviewed by: jilles
Approved by: trasz (mentor)

14 years agoClose a race with caching of -ve name lookups in the NFS client.
John Baldwin [Fri, 16 Oct 2009 19:30:48 +0000 (19:30 +0000)]
Close a race with caching of -ve name lookups in the NFS client.
Specifically, clients only trust -ve cache entries while the directory
remains unchanged and discard any -ve cache entries for a directory when
they notice that the modification time of a directory entry changes.  The
race involves two concurrent lookups as follows:
- Thread A does a lookup for file 'foo' which sends a lookup RPC to the
  server.  The lookup fails and the server replies.
- The 'foo' file is created (either by the same client or a different
  client) updating the modification time on the parent directory of 'foo'.
- Thread B does a lookup for a different file 'bar' which updates the
  cached attributes of the parent directory of 'foo' to reflect the new
  modification time after 'foo' was created.
- Thread A finally resumes execution to parse the reply from the NFS
  server.  It adds a -ve cache entry and sets the cached value of the
  directory's modification time that is used for invalidating -ve cached
  lookups to the new modification time set by thread B.

At this point, future lookups of 'foo' will honor the -ve cached entry
until the cached entry is pushed out of the name cache's LRU or the
modification time of the parent directory is changed again by some other
change.  The fix is to read the directory's modification time before
sending the lookup RPC and use that cached modification time when setting
the directory's cached modification time.  Also, we do not add a -ve cache
entry if another thread has added -ve cache entry that set the directory's
cached modification time to a newer value than the value we read before
sending the lookup RPC.

Reviewed by: rmacklem
MFC after: 1 week

14 years agosh: Show more information about syntax errors in command substitution:
Jilles Tjoelker [Fri, 16 Oct 2009 16:17:57 +0000 (16:17 +0000)]
sh: Show more information about syntax errors in command substitution:
the line number where the command substitution started.
This applies to both the $() and `` forms but is most useful for ``
because the other line number is relative to the enclosed text there.
(For older versions, -v can be used as a workaround.)

14 years agoSort SEE ALSO.
Christian Brueffer [Fri, 16 Oct 2009 12:32:07 +0000 (12:32 +0000)]
Sort SEE ALSO.

14 years agoMove intr_describe() out of #ifdef SMP; the function is always required.
Konstantin Belousov [Fri, 16 Oct 2009 12:00:59 +0000 (12:00 +0000)]
Move intr_describe() out of #ifdef SMP; the function is always required.

Reviewed by: jhb

14 years agoAllow $name_program to override $command in a more robust way that
Doug Barton [Thu, 15 Oct 2009 23:20:23 +0000 (23:20 +0000)]
Allow $name_program to override $command in a more robust way that
will not cause the value to be null if $command is not set.

14 years agoCorrect offset calcluation for the NCM implementation.
Andrew Thompson [Thu, 15 Oct 2009 20:15:29 +0000 (20:15 +0000)]
Correct offset calcluation for the NCM implementation.

Submitted by: HPS

14 years agoOnly poll ukbd if KDB is active.
Andrew Thompson [Thu, 15 Oct 2009 20:09:27 +0000 (20:09 +0000)]
Only poll ukbd if KDB is active.

Submitted by: HPS

14 years agoWorkaround buggy BIOS code in USB regard. By doing the BIOS to OS handover for
Andrew Thompson [Thu, 15 Oct 2009 20:07:08 +0000 (20:07 +0000)]
Workaround buggy BIOS code in USB regard. By doing the BIOS to OS handover for
all host controllers at the same time, we avoid problems where the BIOS will
actually write to the USB registers of all the USB host controllers every time
we handover one of them, and consequently reset the OS programmed values.

Submitted by: avg
Reviewed by: jhb

14 years agoUse language more closely resembling English in a panic message.
John Baldwin [Thu, 15 Oct 2009 18:51:19 +0000 (18:51 +0000)]
Use language more closely resembling English in a panic message.

Pointy hat to: jhb
Submitted by: pluknet

14 years agoRemoved redundant WARNS setting.
Ruslan Ermilov [Thu, 15 Oct 2009 18:17:29 +0000 (18:17 +0000)]
Removed redundant WARNS setting.

Submitted by: Ulrich Spörlein

14 years agoSupport the specification of a range of destination ports e.g.
Luigi Rizzo [Thu, 15 Oct 2009 15:30:41 +0000 (15:30 +0000)]
Support the specification of a range of destination ports e.g.

netsend 127.0.0.1 6666-7777 [payloadsize] [packet_rate] [duration]

This is useful to test the behaviour of systems that do some kind
of flow classifications and so exhibit different behaviour depending
on the number of flows that hit them.
I plan to add a similar extension to sweep on a range of IP addresses,
so we can issue a single command to flood (obviously, for testing
purposes!) a number of different destinations.

When there is only one destination, we do a preliminary connect()
of the socket so we can use send() instead of sendto().
When we have multiple ports, the socket is not connect()'ed and we
do a sendto() instead. There is a performance hit in this case,
as the throughput on the loopback interface (with a firewall rule
that blocks the transmission) goes down from 900kpps to 490kpps on
my test machine.

If the number of different destinations is limited, one option to
explore is to have multiple connect()ed sockets.

MFC after: 1 month

14 years agoStyle fixes to the function prototypes for bus_alloc_resources() and
John Baldwin [Thu, 15 Oct 2009 14:55:11 +0000 (14:55 +0000)]
Style fixes to the function prototypes for bus_alloc_resources() and
bus_release_resources().

14 years agoAdd a facility for associating optional descriptions with active interrupt
John Baldwin [Thu, 15 Oct 2009 14:54:35 +0000 (14:54 +0000)]
Add a facility for associating optional descriptions with active interrupt
handlers.  This is primarily intended as a way to allow devices that use
multiple interrupts (e.g. MSI) to meaningfully distinguish the various
interrupt handlers.
- Add a new BUS_DESCRIBE_INTR() method to the bus interface to associate
  a description with an active interrupt handler setup by BUS_SETUP_INTR.
  It has a default method (bus_generic_describe_intr()) which simply passes
  the request up to the parent device.
- Add a bus_describe_intr() wrapper around BUS_DESCRIBE_INTR() that supports
  printf(9) style formatting using var args.
- Reserve MAXCOMLEN bytes in the intr_handler structure to hold the name of
  an interrupt handler and copy the name passed to intr_event_add_handler()
  into that buffer instead of just saving the pointer to the name.
- Add a new intr_event_describe_handler() which appends a description string
  to an interrupt handler's name.
- Implement support for interrupt descriptions on amd64 and i386 by having
  the nexus(4) driver supply a custom bus_describe_intr method that invokes
  a new intr_describe() MD routine which in turn looks up the associated
  interrupt event and invokes intr_event_describe_handler().

Requested by: many
Reviewed by: scottl
MFC after: 2 weeks

14 years agoA small change to avoid calling gettimeofday() too often
Luigi Rizzo [Thu, 15 Oct 2009 14:18:35 +0000 (14:18 +0000)]
A small change to avoid calling gettimeofday() too often
(hardwired to once every 20us at most).

I found out that on many machines round here, i could only get
300-400kpps with netsend even on loopback and a 'deny' rule in
the firewall, while reducing the number of calls to gettimeofday()
brings the value to 900kpps and more.

This code is just a quick fix for the problem. Of course it could be
done better, with proper getopt() parsing and the like, but since
this applies to the entire program i'll postpone that to when i have
more time.

Reviewed by: rwatson
MFC after: 1 month

14 years agoFix a sign bug in the handling of nice priorities when computing the
John Baldwin [Thu, 15 Oct 2009 11:41:12 +0000 (11:41 +0000)]
Fix a sign bug in the handling of nice priorities when computing the
interactive score for a thread.

Submitted by: Taku YAMAMOTO  taku of tackymt.homeip.net
Reviewed by: jeff
MFC after: 3 days

14 years agoUse our standard section 4 SYNOPSIS.
Christian Brueffer [Thu, 15 Oct 2009 11:32:05 +0000 (11:32 +0000)]
Use our standard section 4 SYNOPSIS.

MFC after: 3 days

14 years agoPrint routing statistics as unsigned short rather than unsigned int,
Robert Watson [Thu, 15 Oct 2009 10:31:24 +0000 (10:31 +0000)]
Print routing statistics as unsigned short rather than unsigned int,
otherwise sign extension leads to unlikely values when in the negative
range of the signed short structure fields that hold the statistics.
The type used to hold routing statistics is arguably also incorrect.

MFC after: 3 days

14 years agoBump version numbers and update descriptions for the 9-CURRENT
Hiroki Sato [Thu, 15 Oct 2009 07:58:01 +0000 (07:58 +0000)]
Bump version numbers and update descriptions for the 9-CURRENT
world. The %[no]include.historic knobs are removed because they
are not used for a long time.

14 years agoThis patch fixes the following issues in the ARP operation:
Qing Li [Thu, 15 Oct 2009 06:12:04 +0000 (06:12 +0000)]
This patch fixes the following issues in the ARP operation:

1. There is a regression issue in the ARP code. The incomplete
   ARP entry was timing out too quickly (1 second timeout), as
   such, a new entry is created each time arpresolve() is called.
   Therefore the maximum attempts made is always 1. Consequently
   the error code returned to the application is always 0.
2. Set the expiration of each incomplete entry to a 20-second
   lifetime.
3. Return "incomplete" entries to the application.

Reviewed by: kmacy
MFC after: 3 days

14 years agofixes a TX hang that could be possible to happen when the trasfers are
Weongyo Jeong [Wed, 14 Oct 2009 20:30:27 +0000 (20:30 +0000)]
fixes a TX hang that could be possible to happen when the trasfers are
in the high speed that some drivers don't call if_start callback after
marking ~IFF_DRV_OACTIVE.

MFC after: 3 days

14 years agofixes a TX hang bug that it could happen when if_start callback didn't
Weongyo Jeong [Wed, 14 Oct 2009 20:09:09 +0000 (20:09 +0000)]
fixes a TX hang bug that it could happen when if_start callback didn't
be restarted by full of the output queue.

MFC after: 3 days
Tested by: bsduser <bsd at acd.homelinux.org>

14 years agoSet the active flag in the PMBR when we install bootcode on a GPT
Robert Noland [Wed, 14 Oct 2009 19:24:01 +0000 (19:24 +0000)]
Set the active flag in the PMBR when we install bootcode on a GPT
partitioned disk.  Some BIOS require this to be set before they will
boot the device.

Approved by: marcel
MFC after: 2 weeks

14 years agoOops, add a return values section to note that these routines return an error
John Baldwin [Wed, 14 Oct 2009 16:00:20 +0000 (16:00 +0000)]
Oops, add a return values section to note that these routines return an error
on failure or zero on success.

14 years agoAdd a manual page for BUS_BIND_INTR() and bus_bind_intr().
John Baldwin [Wed, 14 Oct 2009 15:58:59 +0000 (15:58 +0000)]
Add a manual page for BUS_BIND_INTR() and bus_bind_intr().

MFC after: 1 week

14 years agoUse zfs_read() instead of xfsread() to read /boot.config. xfsread() fails
John Baldwin [Wed, 14 Oct 2009 14:13:42 +0000 (14:13 +0000)]
Use zfs_read() instead of xfsread() to read /boot.config.  xfsread() fails
short read requests, so the result was that a /boot.config smaller than 512
bytes was ignored.  boot2 uses fsread() instead of xfsread() to read
/boot.config already, so this makes zfsboot more like boot2.

Submitted by: Johny Mattsson  johny-freebsd of earthmagic org
Reviewed by: dfr
MFC after: 3 days

14 years agoExplicitly compare to a return code.
Bjoern A. Zeeb [Wed, 14 Oct 2009 12:01:11 +0000 (12:01 +0000)]
Explicitly compare to a return code.

Discussed with: philip (after we both misread the logic there the 1st time)
MFC after: 6 weeks

14 years agoUnbreak the VIMAGE build with IPSEC, broken with r197952 by
Bjoern A. Zeeb [Wed, 14 Oct 2009 11:55:55 +0000 (11:55 +0000)]
Unbreak the VIMAGE build with IPSEC, broken with r197952 by
virtualizing the pfil hooks.
For consistency add the V_ to virtualize the pfil hooks in here as well.

MFC after: 55 days
X-MFC after: julian MFCed r197952.

14 years agols: Make -p not inhibit following symlinks.
Jilles Tjoelker [Tue, 13 Oct 2009 21:51:50 +0000 (21:51 +0000)]
ls: Make -p not inhibit following symlinks.

According to the man page, when neither -H/-L nor -F/-d/-l are given, -H is
implied. This agrees with POSIX, GNU ls and Solaris ls. This means that -p,
although it is very similar to -F, does not prevent the implicit following
of symlinks.

PR: standards/128546

14 years agoImport ACPICA 20091013.
Jung-uk Kim [Tue, 13 Oct 2009 21:27:35 +0000 (21:27 +0000)]
Import ACPICA 20091013.

14 years agoMake getcwd(3) faster, simpler and more compliant using *at syscalls.
Jilles Tjoelker [Tue, 13 Oct 2009 20:58:22 +0000 (20:58 +0000)]
Make getcwd(3) faster, simpler and more compliant using *at syscalls.

It is no longer necessary to construct long paths consisting of repeated
"../" which may be slow to process and may exceed PATH_MAX.

14 years agoCompare pointer to NULL rather than 0.
Bjoern A. Zeeb [Tue, 13 Oct 2009 20:29:14 +0000 (20:29 +0000)]
Compare pointer to NULL rather than 0.

MFC after: 1 month

14 years agoImmediately after clearing a pending callout that didn't make it due
Bjoern A. Zeeb [Tue, 13 Oct 2009 20:22:12 +0000 (20:22 +0000)]
Immediately after clearing a pending callout that didn't make it due
to the lock we hold, disable interrupts, and announce to the firmware
that we are shutting down. Especially do this before disabling blocks.

This makes some types of machines with asf enabled no longer hang upon
boot, when we start configuring the interface.

PR: i386/96382, kern/100410, kern/122252, kern/116328
Reported by: erwin
Hardware provided by: TDC A/S
Reviewed by: stas
Tested by: stas

14 years agoSync with other GENERIC kernel configs:
John Baldwin [Tue, 13 Oct 2009 19:04:01 +0000 (19:04 +0000)]
Sync with other GENERIC kernel configs:
- Move USB serial drivers earlier to match their placement in other kernel
  configs.
- Add descriptions to various USB drivers.
- Move the USB wireless drivers into a new section.
- Add ulscom to the list of USB serial drivers.

14 years agoMove the USB wireless drivers down into their own section next to the USB
John Baldwin [Tue, 13 Oct 2009 19:02:03 +0000 (19:02 +0000)]
Move the USB wireless drivers down into their own section next to the USB
ethernet drivers.

Submitted by: Glen Barber  glen.j.barber @ gmail
MFC after: 1 month

14 years agoFix this module so it at least builds. Note that it isn't hooked up to
John Baldwin [Tue, 13 Oct 2009 18:07:56 +0000 (18:07 +0000)]
Fix this module so it at least builds.  Note that it isn't hooked up to
the build however, and ubser(4) is also not present in any kernel configs
(including NOTES).