Commit Graph

149365 Commits

Author SHA1 Message Date
Konstantin Belousov
93566d2a83 MFC r196887:
In fhopen, vfs_ref() the mount point while vnode is unlocked, to prevent
vn_start_write(NULL, &mp) from operating on potentially freed or reused
struct mount *.

Remove unmatched vfs_rel() in cleanup.

Approved by:	re (kensmith)
2009-09-09 13:28:18 +00:00
Edwin Groothuis
3470119d8c MFC of r196581 r196582 r197000
Import of tzdata 2009k, 2009l and 2009m

- Changes in Mauritius and Bangladesh
- No leapsecond at the end of December 2009

- Egypt will go to Wintertime on 21 August 2009

- Samoa will go in DST on 4 October 2009 till 28 March 2010
- Palestine will go back from DST on 4 September 2009

Approved by:	re (kostik)
2009-09-09 12:19:43 +00:00
Konstantin Belousov
f68591e407 Use traditional td_unusedX names for the padding members.
Suggested by:	julian
Approved by:	re (kensmith)
2009-09-09 10:31:09 +00:00
Attilio Rao
c90c9ddddb Adaptive spinning for locking primitives, in read-mode, have some tuning
SYSCTLs which are inappropriate for a daily use of the machine (mostly
useful only by a developer which wants to run benchmarks on it).
Remove them before the release as long as we do not want to ship with
them in.

Now that the SYSCTLs are gone, instead than use static storage for some
constants, use real numeric constants in order to avoid eventual compiler
dumbiness and the risk to share a storage (and then a cache-line) among
CPUs when doing adaptive spinning together.

Pleasse note that the sys/linker_set.h inclusion in lockmgr and sx lock
support could have been gone, but re@ preferred them to be in order to
minimize the risk of problems on future merging.

Please note that this patch is not a MFC, but an 'edge case' as commit
directly to stable/8, which creates a diverging from HEAD.

Tested by:      Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
Approved by:	re (kib)
2009-09-09 09:34:13 +00:00
Attilio Rao
db0c92ce82 MFC r196772:
fix adaptive spinning in lockmgr by using correctly GIANT_RESTORE and
continue statement and improve adaptive spinning for sx lock by just
doing once GIANT_SAVE.

Approved by:	re (kib)
2009-09-09 09:17:31 +00:00
Jack F Vogel
6a89c3ede1 Make LRO turned off uncategorically for devices
attached to the bridge, rather than just in the case
when some device cannot do TSO. Customer tests have
shown that even when all devices can do TSO that LRO
will cause problems when bridging.

Approved by:  re
2009-09-08 23:25:39 +00:00
John Baldwin
bae950f3b3 MFC 196745:
Don't attempt to bind the current thread to the CPU an IRQ is bound to
when removing an interrupt handler from an IRQ during shutdown.  During
shutdown we are already bound to CPU 0 and this was triggering a panic.

Approved by:	re (kib)
2009-09-08 21:50:34 +00:00
Jamie Gritton
3c7562c77e MFC r196835:
Allow a jail's name to be the same as its jid (which is the default if
  no name is specified), and let a numeric name specify the jid for a new
  jail when the jid isn't otherwise set.  Still disallow other numeric
  names.

Reviewed by:	zec
Approved by:	re (kib), bz (mentor)
2009-09-08 19:18:02 +00:00
Konstantin Belousov
2af00decb8 MFC r196730:
Remove the altkstacks, instead instantiate threads with kernel stack
allocated with the right size from the start. For the thread that has
kernel stack cached, verify that requested stack size is equial to the
actual, and reallocate the stack if sizes differ.

Introduce separate kernel stack cache that keeps some limited amount of
preallocated kernel stacks to lower the latency of thread allocation.

Not a merge: instead of removing td_altkstack* members of struct thread,
replace them with placeholders to keep struct thread layout on the
stable branch.

Also, record r196640, r196644 and r196648 as merged.

Approved by:	re (kensmith)
2009-09-08 15:31:23 +00:00
Konstantin Belousov
c02280f542 MFC r196692:
Make the mnt_writeopcount and mnt_secondary_writes counters,
used by the suspension code, not greater then mnt_ref reference
counter value.

MFC r196733:
Fix mount reference leak when V_XSLEEP is specified to vn_start_write().

Approved by:	re (kensmith)
2009-09-08 14:43:42 +00:00
Sam Leffler
d53c6c91b1 MFC r196717:
fix beacon timers on resume in sta mode so raoming works

Approved by:	re (kensmith)
2009-09-07 16:41:18 +00:00
Sam Leffler
f8083274f0 MFC r196785:
correct timeout for doing NOL processing; need a ticks-relative value

Approved by:	re (kensmith)
2009-09-07 16:33:27 +00:00
Pawel Jakub Dawidek
264a8db4b0 MFC r196579:
Fix an obvious topology lock leak.

Approved by:	re (kib)
2009-09-07 16:25:09 +00:00
Remko Lodder
07c141a646 MFC r196787
Do the first step in removing lukemftpd from the base system. Disconnect
  it from the build.

  If you are using the FTP daemon, please consider using the port ftp/tnftpd
  which is the same FTP server, but newer and might have more/better
  functionality.

  This results in us providing only one ftp daemon by default.

  Reviewed by:        bz
  Approved by:        imp (mentor, implicit)
  MFC after:        3 days
  Silence from:        obrien

Approved by:	re (kib), imp (mentor, implicit)
2009-09-07 14:10:55 +00:00
Alexander Motin
529d728924 MFC r196831:
Add to `camcontrol cmd` support for sending arbitrary ATA commands.

It could be used for broad range of tasks, such as configuring drive
power management, caching, security and any other features and tasks,
not supported by existing drivers.

Approved by:	re (ATA-CAM blanket)
2009-09-06 14:05:01 +00:00
Julian Elischer
9e432c37e0 MFC of r196477
Don't delete copies of nthread_create(9) we find inthe filesystem.
 we now link it to kproc_create(9), it's new name.

Approved by:	re (kib)
2009-09-06 06:05:23 +00:00
Qing Li
69406c1632 MFC r196871
The addresses that are assigned to the loopback interface
should be part of the kernel routing table.

Reviewed by:	bz
Approved by:	re
2009-09-05 20:35:18 +00:00
Qing Li
3d2a8d364d MFC r196864
This patch fixes the following issues:
- Interface link-local address is not reachable within the
  node that owns the interface, this is due to the mismatch
  in address scope as the result of the installed interface
  address loopback route. Therefore for each interface
  address loopback route, the rt_gateway field (of AF_LINK
  type) will be used to track which interface a given
  address belongs to. This will aid the address source to
  use the proper interface for address scope/zone validation.
- The loopback address is not reachable. The root cause is
  the same as the above.
- Empty nd6 entries are created for the IPv6 loopback addresses
  only for validation reason. Doing so will eliminate as much
  of the special case (loopback addresses) handling code
  as possible, however, these empty nd6 entries should not
  be returned to the userland applications such as the
  "ndp" command.
Since both of the above issues contain common files, these
files are committed together.

Reviewed by:	bz
Approved by:	re
2009-09-05 17:40:27 +00:00
Qing Li
02642a5729 MFC r196865
This patch fixes an address scope violation. Considering the
scenario where an anycast address is assigned on one interface,
and a global address with the same scope is assigned on another
interface. In other words, the interface owns the anycast
address has only the link-local address as one other address.
Without this patch, "ping6" the anycast address from another
station will observe the source address of the returned ICMP6
echo reply has the link-local address, not the global address
that exists on the other interface in the same node.

Reviewed by:    bz
Approved by:	re
2009-09-05 17:35:31 +00:00
Bjoern A. Zeeb
e0adffb3d5 MFC r196866:
In the NEXTADDR macro use SA_SIZE() rather than directly using
  sizeof(), as introduced in r186119, for advancing the current
  position into the buffer.
  See comment in net/route.h for a description of the difference.
  This makes ndp -s work again.

   Reviewed by:	qingli

Approved by:	re (kib)
2009-09-05 17:29:08 +00:00
Edward Tomasz Napierala
b9d99ec84d MFC r196740:
Fix regression introduced with NFSv4 ACL support - make acl_to_text(3)
and acl_calc_mask(3) return error instead of crashing when acl passed
to them is NULL.

Submitted by:	markus
Reviewed by:	rwatson
Approved by:	re (kib)
2009-09-05 15:01:56 +00:00
Konstantin Belousov
a0ed3d8546 MFC r196689:
Remove spurious pfs_unlock().

Approved by:	re (rwatson)
2009-09-05 13:10:54 +00:00
Warner Losh
45f395006c MFC r196529:
Rather than having enabled/disabled, implement a max queue depth.
  While usually not an issue, this firewalls bugs in the code that may
  run us out of memory.

  Fix a memory exhaustion in the case where devctl was disabled, but the
  link was bouncing.  The check to queue was in the wrong place.

  Implement a new sysctl hw.bus.devctl_queue to control the depth.  Make
  compatibility hacks for hw.bus.devctl_disable to ease transition.

  Reviewed by:	emaste@
  Approved by:	re@ (kib)
  MFC after:	asap
2009-09-05 08:03:29 +00:00
Alexander Motin
b89c161793 MFC r196777, r196796:
ATI SB600 can't handle 256 sectors transfers with FPDMA (NCQ).

Approved by:	re (ATA-CAM blanket)
2009-09-05 06:24:28 +00:00
Ken Smith
9d4abd5433 Ready for BETA4.
Approved by:	re (implicit)
2009-09-05 00:50:08 +00:00
Jack F Vogel
0bb40ca3e0 This patch seperates the control of header split from LRO (which it
was previously dependent on), LRO gets turned off when bridging but
its been found that header split is still a performance win in that case.

Secondly, there was some interface specific control in stats code that
has been missing, and a logic error that resulted in bogus reporting.
Thanks to Manish and John of LineRateSystems for the report and help in
this code.

Approved by: re
2009-09-04 22:37:03 +00:00
Pyun YongHyeon
b3d8f9c3fc MFC r196721:
Make sure rx descriptor ring align on 16 bytes. I guess the
  alignment requirement could be multiple of 4 bytes but I think
  using descriptor size would make intention clearer.
  Previously the size of rx descriptor was not power of 2 so it
  caused panic in bus_dmamem_alloc(9).

  Reported by:	Jeff Blank (jb000003 <> mr-happy dot com)
Approved by:	re (kib)
2009-09-04 16:41:17 +00:00
Stanislav Sedov
8b3a7204a7 - MFC r196568:
- Add quirk for Sony DSC digital cameras.  This umass devices fail
    to attach without these quirks applied.

Approved by:	re (kib)
2009-09-04 11:32:05 +00:00
Julian Elischer
e181d489f6 MFC r196450
Add clarifications to the kproc and kthread manpages and link
   the kthread_create(9) man page to the kproc(9) page as it has migrated and
   people looking for it may need a hand to find its new name.

Approved by:	re (kib)
2009-09-04 07:13:07 +00:00
Weongyo Jeong
fa0dc8bb62 MFC r196809:
fix a TX issue on big endian machines like powerpc or sparc64.  Now
  zyd(4) should work on all architectures.

  Obtained from:	OpenBSD

Approved by:	re (kib)
2009-09-04 05:37:49 +00:00
John Baldwin
bf202eb1c6 MFC 196705 and 196707:
- Improve pmap_change_attr() on i386 so that it is able to demote a large
  (2/4MB) page into 4KB pages as needed.  This should be fairly rare in
  practice.
- Simplify pmap_change_attr() a bit:
  - Always calculate the cache bits instead of doing it on-demand.
  - Always set changed to TRUE rather than only doing it if it is false.

Approved by:	re (kib)
2009-09-03 13:54:58 +00:00
Bjoern A. Zeeb
5b628e0c26 MFC r196738:
In case an upper layer protocol tries to send a packet but the
  L2 code does not have the ethernet address for the destination
  within the broadcast domain in the table, we remember the
  original mbuf in `la_hold' in arpresolve() and send out a
  different packet with an arp request.
  In case there will be more upper layer packets to send we will
  free an earlier one held in `la_hold' and queue the new one.

  Once we get a packet in, with which we can perfect our arp table
  entry we send out the original 'on hold' packet, should there
  be any.
  Rather than continuing to process the packet that we received,
  we returned without freeing the packet that came in, which
  basically means that we leaked an mbuf for every arp request
  we sent.

  Rather than freeing the received packet and returning, continue
  to process the incoming arp packet as well.
  This should (a) improve some setups, also proxy-arp, in case it was an
  incoming arp request and (b) resembles the behaviour FreeBSD had
  from day 1, which alignes with RFC826 "Packet reception" (merge case).

  Rename 'm0' to 'hold' to make the code more understandable as
  well as diffable to earlier versions more easily.

  Handle the link-layer entry 'la' lock comepletely in the block
  where needed and release it as early as possible, rather than
  holding it longer, down to the end of the function.

  Found by:			pointyhat, ns1
  Bug hunting session with:	erwin, simon, rwatson
  Tested by:			simon on cluster machines
  Reviewed by:			ratson, kmacy, julian

Approved by:	re (kib)
2009-09-02 16:35:57 +00:00
Bjoern A. Zeeb
914e5afefd MFC r196653:
Make sure FreeBSD binaries without .note.ABI-tag section work
  correctly and do not match a colliding Debian GNU/kFreeBSD
  brandinfo statements.
  For this mark the Debian GNU/kFreeBSD brandinfo that it must have
  an .note.ABI-tag section and ignore the old EI_OSABI brandinfo
  when comparing a possibly colliding set of options.

  Due to SYSINIT we add the brandinfo in a non-deterministic order,
  so native FreeBSD is not always first. We may want to consider
  to force native FreeBSD to come first as well.

  The only way a problem could currently be noticed is when running an
  i386 binary without the .note.ABI-tag on amd64 and the Debian GNU/kFreeBSD
  brandinfo  was matched first,  as the fallback to ld-elf32.so.1 does
  not exist in that case.

Reported and tested by:	ticso
In collaboration with:	kib
MFC after:		3 days
Approved by:		re (rwatson)
2009-09-02 10:39:46 +00:00
Alfred Perlstein
42a66b539d MFC: r196489,196498
Critical USB bugfixes for 8.0

Approved by:    re
2009-09-02 02:12:07 +00:00
Jilles Tjoelker
33656b91cd MFC r196460
Fix the conformance of poll(2) for sockets after r195423 by
  returning POLLHUP instead of POLLIN for several cases. Now, the
  tools/regression/poll results for FreeBSD are closer to that of the
  Solaris and Linux.

  Also, improve the POSIX conformance by explicitely clearing POLLOUT
  when POLLHUP is reported in pollscan(), making the fix global.

  Submitted by:	bde
  Reviewed by:	rwatson

MFC r196556

  Fix poll() on half-closed sockets, while retaining POLLHUP for fifos.

  This reverts part of r196460, so that sockets only return POLLHUP if both
  directions are closed/error. Fifos get POLLHUP by closing the unused
  direction immediately after creating the sockets.

  The tools/regression/poll/*poll.c tests now pass except for two other
  things:
  - if POLLHUP is returned, POLLIN is always returned as well instead of
    only when there is data left in the buffer to be read
  - fifo old/new reader distinction does not work the way POSIX specs it

  Reviewed by:	kib, bde

MFC r196554

  Add some tests for poll(2)/shutdown(2) interaction.

Approved by:	re (kensmith)
2009-09-01 20:58:41 +00:00
Robert Noland
e2ba743711 MFC 196643
Swap the start/end virtual addresses in pmap_invalidate_cache_range().

This fixes the functionality on non SelfSnoop hardware.

Found by:	rnoland
Submitted by:	alc
Reviewed by:	kib
Approved by:	re (rwatson)
2009-09-01 16:41:28 +00:00
John Baldwin
8a503ad2c9 MFC 196637:
Mark the fake pages constructed by the OBJT_SG pager valid.  This was
accidentally lost at one point during the PAT development.  Without this
fix vm_pager_get_pages() was zeroing each of the pages.

Approved by:	re (kib)
2009-09-01 15:50:07 +00:00
Alexander Motin
be5b3af890 MFC r196657:
ATA_FLUSHCACHE is a 28bit format command, not 48.

MFC r196658:
Improve camcontrol ATA support:
 - Tune protocol version reporting,
 - Add supported DMA/PIO modes reporting.
 - Fix IDENTIFY request for ATAPI devices.
 - Remove confusing "-" for NCQ status.

MFC r196659:
Short ATA command format has 28bit address, not 36bit.
Rename ata_36bit_cmd() into ata_28bit_cmd(), while it didn't become legacy.

Approved by:	re (ATA-CAM blanket)
2009-09-01 12:04:43 +00:00
Alexander Motin
84a08f606f MFC r196656, r196660:
Update ahci driver:
 - Add Command Completion Coalescing support.
 - Add SNTF support.
 - Add two more power management modes (4, 5), implemented on driver level.
 - Fix interface mode setting.
 - Reduce interface reset time.
 - Do not report meaningless protocol/transport versions.
 - Report CAP2 register content.
 - Some performance optimizations.

Approved by:	re (ATA-CAM blanket)
2009-09-01 11:44:30 +00:00
Alexander Motin
088705a89e MFC r196655:
Update siis driver:
 - Add SNTF support.
 - Do not report meaningless transport/protocol versions.

Approved by:	re (ATA-CAM blanket)
2009-09-01 11:13:31 +00:00
Marius Strobl
e4e5ed252d Add a temporary workaround which just lets init die instead of
causing a panic if it is killed due to a unsolved stack overflow
seen very late during shutdown on sparc64 when the gmirror worker
process exists, which is a regression introduced in 8.0.

Reviewed by:	kib
Approved by:	re (rwatson)
2009-08-31 19:16:58 +00:00
Jamie Gritton
f37b0a3db5 MFC r196592:
Fix a LOR between allprison_lock and vnode locks by releasing
  allprison_lock before releasing a prison's root vnode.

PR:		kern/138004
Reviewed by:	kib
Approved by:	re (rwatson), bz (mentor)
2009-08-31 14:13:45 +00:00
Colin Percival
ee1db5ae45 MFC r196558: Don't try to mmap the contents of empty files. This behaviour
was harmless prior to r195693, when mmap(2) changed from silently ignoring
requests for mapping zero bytes to returning EINVAL; this commit can be seen
as adjusting for the change in mmap(2) in order to make look(1) act like it
did previously.

Reviewed by:	jhb
Approved by:	re (kib)
2009-08-31 13:02:21 +00:00
Rui Paulo
de3a9cf126 MFC r196455:
Make dev.asmc.N.light.control writable by everyone.

Submitted by:	Patrick Lamaiziere <patfbsd at davenulle.org>
Approved by:	re (rwatson)
2009-08-31 12:25:04 +00:00
Marko Zec
962e75a763 MFC r196635:
Fix a few panics in linuxulator + VIMAGE due to curvnet not being set.

  This change affects only options VIMAGE builds.

  Reviewed by:  julian

Approved by:	re (rwatson)
2009-08-31 09:46:09 +00:00
Marko Zec
e9cedda843 MFC r196633:
Introduce a separate sx lock for protecting lists of vnet sysinit
  and sysuninit handlers.

  Previously, sx_vnet, which is a lock designated for protecting
  the vnet list, was (ab)used for protecting vnet sysinit / sysuninit
  handler lists as well.  Holding exclusively the sx_vnet lock while
  invoking sysinit and / or sysuninit handlers turned out to be
  problematic, since some of the handlers may attempt to wake up
  another thread and wait for it to walk over the vnet list, hence
  acquire a shared lock on sx_vnet, which in turn leads to a deadlock.
  Protecting vnet sysinit / sysuninit lists with a separate lock
  mitigates this issue, which was first observed with
  flowtable_flush() / flowtable_cleaner() in sys/net/flowtable.c.

  Reviewed by:  rwatson, jhb
  MFC after:    3 days

Approved by:	re (rwatson)
2009-08-31 09:44:07 +00:00
Konstantin Belousov
e179d138ba MFC r196560:
Honor the vfs.timestamp_precision sysctl settings for utimes(path, NULL)
and similar calls.

Approved by:	re (rwatson)
2009-08-31 09:08:14 +00:00
Qing Li
c7276c59ff As part of r196609, a call to "rtalloc" did not take the fib into
account. So call the appropriate "rtalloc_ign_fib()" instead of
calling "rtalloc_ign()".

Reviewed by:	pointed out by bz
Approved by:	re
2009-08-31 00:18:17 +00:00
Qing Li
87d2d9c556 MFC r196649
Prefix on-link verification is being performed on statically
configured prefixes. Since these statically configured prefixes
do not have any associated advertising routers, these prefixes
are treated as unreachable and those prefix routes are deleted
from the routing table. Therefore bypass prefixes that are not
learned from router advertisements during prefix on-link check.

Reviewed by:	hrs
Approved by:	re
2009-08-30 22:44:12 +00:00
Qing Li
ba3ae75b3c MFC r196609
In ip_output(), the flow-table module must not try to cache L2/L3
information for interface of IFF_POINTOPOINT or IFF_LOOPBACK type.
Since the L2 information (rt_lle) is invalid for these interface
types, accidental caching attempt will trigger panic when the invalid
rt_lle reference is accessed.

When installing a new route, or when updating an existing route, the
user supplied gateway address may be an interface address (this is
particularly true for point-to-point interface related modules such
as ppp, if_tun, if_gif). Currently the routing command handler always
set the RTF_GATEWAY flag if the gateway address is given as part of the
command paramters. Therefore the gateway address must be verified against
interface addresses or else the route would be treated as an indirect
route, thus making that route unusable.

Reviewed by:	kmacy, julian, rwatson
Approved by:	re
2009-08-30 22:42:32 +00:00