Commit Graph

75289 Commits

Author SHA1 Message Date
Jaakko Heinonen
ab28e40a31 MFC r206859:
Fix ddb(4) "show geom addr" command when INVARIANTS is enabled. Don't
assert that the topology lock is held when g_valid_obj() is called from
debugger.
2010-04-26 16:20:18 +00:00
Warner Losh
39fc973d89 MFC r206916
Make sure that we free the passed in data message if we don't actually
  insert it onto the queue.  Also, fix a mtx leak if someone turns off
  devctl while we're processing a messages.

  MFC after:	5 days
2010-04-25 19:13:08 +00:00
Rick Macklem
a862e504da MFC: r206818
Avoid extraneous recovery cycles in the experimental NFS client
when an NFSv4 server reboots, by doing two things.
1 - Make the function that acquires a stateid for I/O operations
    block until recovery is complete, so that it doesn't acquire
    out of date stateids.
2 - Only allow a recovery once every 1/2 of a lease duration, since
    the NFSv4 server must provide a recovery grace period of at
    least a lease duration. This should avoid recoveries caused
    by an out of date stateid that was acquired for an I/O op.
    just before a recovery cycle started.
2010-04-25 01:56:31 +00:00
Matt Jacob
417e0e58bf This is an MFC of 204050.
Don't try and re-use a handle, even if the firmware tells you that's what is logged in.

PR:             kern/144026
2010-04-24 23:20:51 +00:00
Matt Jacob
4c35d8e092 This is an MFC of 205252.
We actually can generate a host number.
2010-04-24 23:10:13 +00:00
Matt Jacob
fbcd5da22b This is an MFC of 205236
Put gone device timer into a structure tag that can hold more than 32 seconds. Oops.

Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM
or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've
turned off autologin and find them, or rather don't, via camcontrol rescan.
2010-04-24 23:05:56 +00:00
Attilio Rao
47fd5bf73a MFC r206482, r206879:
- Introduce a blessed list for sxlocks that prevents the deadlkres to
  panic on those ones. Populate this list with getblk and so_snd_sx and
  so_rcv_sx.
- Fix ticks counter wrap-up

Sponsored by:	Sandvine Incorporated
2010-04-24 00:53:41 +00:00
Attilio Rao
a2bef3670a MFC r206421:
Default the machdep.lapic_allclocks to be enabled in order to cope with
broken atrtc.
Now if you want more correct stats on profhz and stathz it may be
disabled by setting to 0.

Sponsored by:	Sandvine Incorporated
2010-04-24 00:49:19 +00:00
Matt Jacob
a956023126 This is an MFC of 205847, 204071 and 196580
------
Change how multipath labels are created and managed. This makes it easier
to support various storage boxes which really aren't active-active.

We only write the label on the *first* provider. For all other providers
we just "add" the disk. This also allows for an "add" verb.

A usage implication is that you should specificy the currently active
storage path as the first provider.

Note that this does not add RDAC-like functionality, but better allows for
autovolumefailover configurations (additional checkins elsewhere will support
this).

------------------------------------------------------------------------

- Style fixes.
- Prefer strlcpy() over strncpy().

------------------------------------------------------------------------

There's no need for checking result of M_WAITOK allocation.
2010-04-23 16:49:18 +00:00
Matt Jacob
2ef84ecad4 This is an MFC of 205412.
Add 'rotate' and 'getactive' verbs to provide some control and information
about what the currently active path is.
2010-04-23 16:26:10 +00:00
Rick Macklem
bf129106d7 MFC: r206690
Add mutex lock calls to 2 cases in the experimental NFS client's
renew thread where they were missing.
2010-04-23 00:34:59 +00:00
Rick Macklem
4a9c979c0f MFC: r206688
The experimental NFS client was not filling in recovery credentials
for opens done locally in the client when a delegation for the file
was held. This could cause the client to crash in crsetgroups() when
recovering from a server crash/reboot. This patch fills in the
recovery credentials for this case, in order to avoid the client crash.
Also, add KASSERT()s to the credential copy functions, to catch any
other cases where the credentials aren't filled in correctly.
2010-04-23 00:12:23 +00:00
Andriy Gapon
a53cbf9286 MFC r206650: g_io_check: respond to zero pp->mediasize with ENXIO 2010-04-22 12:24:59 +00:00
Andriy Gapon
e5465d9c0c MFC r206648,206651: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set
d_sectorsize and d_mediasize

PR:		kern/138789
2010-04-22 11:46:42 +00:00
Pyun YongHyeon
93a3952553 MFC r206563:
Add Agere ET1011 PHY which is found on Belkin F5D5055 USB
  controller. Unlike Agere ET1011C, Agere ET1011 does not seem to
  need special DSP programming to workaround silicon bug.
2010-04-22 01:39:45 +00:00
Bjoern A. Zeeb
b6a02e249f MFC r206488:
Take a reference to make sure that the interface cannot go away during
  if_clone_destroy() in case parallel threads try to.

PR:		kern/116837
Submitted by:	Mikolaj Golub (to.my.trociny gmail.com)
2010-04-21 20:00:13 +00:00
Bjoern A. Zeeb
984c5c6804 MFC r206486:
Check that the interface is on the list of cloned interfaces before trying
  to remove it to avoid panics in case of two threads trying to remove it in
  parallel.

PR:	      kern/116837
Submitted by: Takahiro Kurosawa (takahiro.kurosawa gmail.com) (orig version)
2010-04-21 19:55:43 +00:00
Bjoern A. Zeeb
feb3a5f7df MFC r206481:
Plug reference leaks in the link-layer code ("new-arp") that previously
  prevented the link-layer entry from being freed.

  In both in.c and in6.c (though that code path seems to be basically dead)
  plug a reference leak in case of a pending callout being drained.

  In if_ether.c consistently add a reference before resetting the callout
  and in case we canceled a pending one remove the reference for that.
  In the final case in arptimer, before freeing the expired entry, remove
  the reference again and explicitly call callout_stop() to clear the active
  flag.

  In nd6.c:nd6_free() we are only ever called from the callout function and
  thus need to remove the reference there as well before calling into
  llentry_free().

  In if_llatbl.c when freeing the entire tables make sure that in case we
  cancel a pending callout to remove the reference as well.

  Reviewed by:          qingli (earlier version)
  MFC after:            10 days
  Problem observed, patch tested by: simon on ipv6gw.f.o,
                        Christian Kratzer (ck cksoft.de),
                        Evgenii Davidov (dado korolev-net.ru)
PR:			kern/144564
Configurations still affected:	with options FLOWTABLE
2010-04-21 19:51:22 +00:00
Bjoern A. Zeeb
1ed532bb3d MFC r206470:
In if_detach_internal() we cannot hold the af_data lock over the
  dom_ifdetach() calls as they might sleep for callout_drain().
  Do as we do in if_attachdomain1() [r121470] and handle
  if_afdata_initialized earlier and call dom_ifdetach() unlocked.

  Discussed with:       rwatson
2010-04-21 19:48:40 +00:00
Bjoern A. Zeeb
b0cf9f5f20 MFC r206469:
In if_detach_internal() only try to do the detach run if if_attachdomain1()
  has actually succeeded to initialize and attach.  There is a theoretical
  possibility to drop out early in if_attachdomain1() leaving the array
  uninitialized if we cannot get the lock.

  Discussed with:       rwatson
2010-04-21 19:47:19 +00:00
Bjoern A. Zeeb
407b19379c MFC r205345:
Split eventhandler_register() into an internal part and a wrapper function
  that provides the allocated and setup eventhandler entry.

  Add a new wrapper for VIMAGE that allocates extra space to hold the
  callback function and argument in addition to an extra wrapper function.
  While the wrapper function goes as normal callback function the
  argument points to the extra space allocated holding the original func
  and arg that the wrapper function can then call.

  Provide an iterator function for the virtual network stack (vnet) that
  will call the callback function for each network stack.

  Provide a new set of macros for VNET that in the non-VIMAGE case will
  just call eventhandler_register() while in the VIMAGE case it will use
  vimage_eventhandler_register() passing in the extra iterator function
  but will only register once rather than per-vnet.
  We need a special macro in case we are interested in the tag returned
  as we must check for curvnet and can neither simply assign the
  return value, nor not change it in the non-vnet0 case without that.

  Discussed with:       jhb
  Reviewed by:  zec (earlier version), jhb
2010-04-21 19:45:41 +00:00
Weongyo Jeong
06c84dc09b MFC r205141:
enables S/W beacon miss handler.

  Reported by:	imp
2010-04-21 00:23:23 +00:00
Weongyo Jeong
87ecd62c3d MFC r205003:
Revert r204992 and just wrap it all in ifdef INVARIANTS to fix the debug
  and non-debug cases

MFC r204992:
  fixes a compile error if INVARIANTS is disabled.

  Pointy hat to: me
  Submitted by: Michael Butler <imb at protected-networks dot net>

MFC r204983:
  Fix build breakage introduced in r204922.

MFC r204923:
  uses KOBJMETHOD_END macro to indicate the end of method table.

  Submitted by: yongari

MFC r204922:
  o uses bus accessor macros to read values from ivar so no more values
    are referenced directly from ivar pointer.  It's to do like what other
    buses do. [1]
  o changes exported prototypes.  It doesn't use struct siba_* structures
    anymore that instead of it it uses only device_t.
  o removes duplicate code and debug messages.
  o style(9)

  Pointed out by:        imp [1]
2010-04-21 00:22:16 +00:00
Weongyo Jeong
947d8d8758 MFC r204662:
Hook up the bwn driver.

  Pointed by: nwhitehorn
2010-04-21 00:15:58 +00:00
Weongyo Jeong
489d21bb61 MFC r204657:
fixes an attached-at-boot issue that bwn(4) using device_identify
  interface didn't be attached automatically at boot time so changes a
  approach to attach children based on leveraging some newbus niceties.

  Submitted by: nwhitehorn
2010-04-21 00:13:44 +00:00
Weongyo Jeong
dcad5dbe15 MFC r204542:
calculates the integer square root if a positive integer X is larger
  than 256 instead of using sqrt_table.

  Reported by: Joe Marcus Clarke <marcus at freebsd dot org>
2010-04-21 00:06:39 +00:00
Weongyo Jeong
b0b1f91e38 MFC r204437:
fixes a bug to load firmware images for LP PHY. For LP PHY always,
  `lp_' string is contained in its full image names.
2010-04-21 00:05:22 +00:00
Weongyo Jeong
95def843ce MFC r204436:
supports the adhoc demo mode that it's tested on modified aircrack-ng
  suite and worked.

  Submitted by:	Paul B Mahol <onemda at gmail dot com>
2010-04-21 00:02:48 +00:00
Weongyo Jeong
be58dd8584 MFC r204385:
don't need to check BWN_RX_PHYST0_SHORTPRMBL flag because it's already
  handled in later.

  Reported from: imp, nwhitehorn
2010-04-21 00:01:38 +00:00
Weongyo Jeong
499ba4648d MFC r204328:
Add bwn(4) driver.
2010-04-20 22:55:07 +00:00
Weongyo Jeong
56ffe55185 MFC r204326:
Add bwn(4) driver to the build.
2010-04-20 21:55:44 +00:00
Weongyo Jeong
460ea5b2fd MFC r204257:
o adds sysctl variables to show device statistics.
  o records RTS success/fail statistics.

  Pointed by:   imp
2010-04-20 21:52:54 +00:00
Weongyo Jeong
f60b07631b MFC r204256:
fixes a compile error; invalid type argument of '->'.
2010-04-20 21:51:45 +00:00
Weongyo Jeong
286546e3d5 MFC r204242:
Fix compilation problems with INVARIANTS.

  # also limit RX decryption attempted messages to 50

  Reviewed by:  weongyo

Approved by:	imp (implicit)
2010-04-20 21:48:48 +00:00
Weongyo Jeong
5533a0c47e MFC r204081:
o print msgs with length if the frame is too short to pass to
    net80211.
  o print key index for debugging if the frame is attempted to decrypt
    for WEP, AES or TKIP though currently HW decryption isn't supported.
2010-04-20 21:41:43 +00:00
Weongyo Jeong
3e1e21c9a4 MFC r203945:
adds bwn(4) driver for supporting Broadcom BCM43xx chipsets.

    o uses v4 firmware instead of v3.  A port will be committed to
      create the bwn firmware module.
    o supports B/G and LP(low power) PHYs.
    o supports 32 / 64 bits DMA operations.
    o tested on big / little endian machines so should work on all
      architectures.

  It'd not connected to the build until the firmware port is committed.
2010-04-20 21:40:09 +00:00
Weongyo Jeong
a9a1ff5e80 MFC r203944:
supports SPROM rev8 informations properly which are used to support
  low-power PHY of bwn(4) and LDO voltage adjustments.
2010-04-20 21:37:47 +00:00
Weongyo Jeong
f90970557d MFC r203320:
Hook up the siba_bwn module to the build.
2010-04-20 21:35:48 +00:00
Luigi Rizzo
509fc65cb0 MFC r206551 (forgotten in previous commit): fix builds with ktr 2010-04-20 21:33:14 +00:00
Weongyo Jeong
4b1a8666b9 MFC r203319:
Adds siba_bwn module which is used with bwn(4).  Main purpose of this
  module is to distinguish parts of Silicon Backplane and of Broadcom
  Wireless.
2010-04-20 21:29:53 +00:00
Weongyo Jeong
5c07bd7cf5 MFC r201978:
Merge from projects/mips to head by hand:

  Merge the siba bus device.  This was moved from mips to dev because
  siba bus can be in other architectures, like ARM.

MFC r202056:
  Move this to the right location.  Grump.

MFC r202057:
  This was somehow copied to the wrong place :(.  Remove the spare copy.

Approved by:	imp
2010-04-20 21:24:32 +00:00
Luigi Rizzo
31a3c43a0f MFC geom_sched code, a geom-based disk scheduling framework. 2010-04-20 15:23:12 +00:00
Konstantin Belousov
66df5bde4d MFC r206553:
Change printf() calls to uprintf() for sigreturn() and trap() complaints
about inacessible or wrong mcontext, and for dreaded "kernel trap with
interrupts disabled" situation. The later is changed when trap is
generated from user mode (shall never be ?).

Normalize the messages to include both pid and thread name.
2010-04-20 08:19:43 +00:00
Rick Macklem
0c58adb2fa MFC: r206236
Harden the experimental NFS server a little, by adding range
checks on the length of the client's open/lock owner name. Also,
add free()'s for one case where they were missing and would
have caused a leak if NFSERR_BADXDR had been replied. Probably
never happens, but the leak is now plugged, just in case.
2010-04-20 01:25:18 +00:00
Edward Tomasz Napierala
49ea01c1ce MFC r202971:
Return proper error code.

Found with:	clang
2010-04-19 18:22:21 +00:00
Edward Tomasz Napierala
6867f97625 MFC r196987:
Remove useless variable assignment.
2010-04-19 18:19:59 +00:00
Rick Macklem
cf66cfa0b1 MFC: r206170
Harden the experimental NFS server a little, by adding extra checks
in the readdir functions for non-positive byte count arguments.
For the negative case, set it to the maximum allowable, since it
was actually a large positive value (unsigned) on the wire.
Also, fix up the readdir function comment a bit.
2010-04-18 22:51:15 +00:00
Pawel Jakub Dawidek
3a482ccc5e MFC r203504,r204067,r204073,r204101,r204804,r205079,r205080,r205132,r205133,
r205134,r205231,r205253,r205264,r205346,r206051,r206667,r206792,r206793,
    r206794,r206795,r206796,r206797:

r203504:

Open provider for writting when we find the right one. Opening too much
providers for writing provokes huge traffic related to taste events send
by GEOM on close. This can lead to various problems with opening GEOM
providers that are created on top of other GEOM providers.

Reorted by:	Kurt Touet <ktouet@gmail.com>, mr
Tested by:	mr, Baginski Darren <kickbsd@ya.ru>

r204067:

Update comment. We also look for GPT partitions.

r204073:

Add tunable and sysctl to skip hostid check on pool import.

r204101:

Don't set f_bsize to recordsize. It might confuse some software (like squid).

Submitted by:	Alexander Zagrebin <alexz@visp.ru>

r204804:

Remove racy assertion.

Reported by:	Attila Nagy <bra@fsn.hu>
Obtained from:	OpenSolaris, Bug ID 6827260

r205079:

Remove bogus assertion.

Reported by:	Johan Ström <johan@stromnet.se>
Obtained from:	OpenSolaris, Bug ID 6920880

r205080:

Force commit to correct Bug ID:

Obtained from:	OpenSolaris, Bug ID 6920880

r205132:

Don't bottleneck on acquiring the stream locks - this avoids a massive
drop off in throughput with large numbers of simultaneous reads

r205133:

fix compilation under ZIO_USE_UMA

r205134:

make UMA the default allocator for ZFS buffers - this avoids
a great deal of contention in kmem_alloc

r205231:

- reduce contention by breaking up ARC state locks in to 16 for data
  and 16 for metadata
- export L2ARC tunables as sysctls
- add several kstats to track L2ARC state more precisely
- avoid holding a contended lock when atomically incrementing a
  contended counter (no lock protection needed for atomics)

r205253:

use CACHE_LINE_SIZE instead of hardcoding 128 for lock pad

pointed out by Marius Nuennerich and jhb@

r205264:

- cache line align arcs_lock array (h/t Marius Nuennerich)
- fix ARCS_LOCK_PAD to use architecture defined CACHE_LINE_SIZE
- cache line align buf_hash_table ht_locks array

r205346:

The same code is used to import and to create pool.
The order of operations is the following:
1. Try to open vdev by remembered path and guid.
2. If 1 failed, try to find vdev which guid matches and ignore the path.
3. If 2 failed this means either that the vdev we're looking for is gone
   or that pool is being created and vdev doesn't contain proper guid yet.
   To be able to handle pool creation we open vdev by path anyway.

Because of 3 it is possible that we open wrong vdev on import which can lead to
confusions.

The solution for this is to check spa_load_state. On pool creation it will be
equal to SPA_LOAD_NONE and we can open vdev only by path immediately and if it
is not equal to SPA_LOAD_NONE we first open by path+guid and when that fails,
we open by guid. We no longer open wrong vdev on import.

r206051:

IOCPARM_MAX defines maximum size of a structure that can be passed
directly to ioctl(2). Because of how ioctl command is build using _IO*()
macros we have only 13 bits to encode structure size. So the structure
can be up to 8kB-1.

Currently we define IOCPARM_MAX as PAGE_SIZE.

This is IMHO wrong for three main reasons:

1. It is confusing on archs with page size larger than 8kB (not really
   sure if we support such archs (sparc64?)), as even if PAGE_SIZE is
   bigger than 8kB, we won't be able to encode anything larger in ioctl
   command.

2. It is a waste. Why the structure can be only 4kB on most archs if we
   have 13 bits dedicated for that, not 12?

3. It shouldn't depend on architecture and page size. My ioctl command
   can work on one arch, but can't on the other?

Increase IOCPARM_MAX to 8kB and make it independed of PAGE_SIZE and
architecture it is compiled for. This allows to use all the bits on all the
archs for size. Note that this doesn't mean we will copy more on every ioctl(2)
call. No. We still copyin(9)/copyout(9) only exact number of bytes encoded in
ioctl command.

Practical use for this change is ZFS. zfs_cmd_t structure used for ZFS
ioctls is larger than 4kB.

Silence on:	arch@

r206667:

Fix 3-way deadlock that can happen because of ZFS and vnode lock
order reversal.

thread0 (vfs_fhtovp)	thread1 (vop_getattr)	thread2 (zfs_recv)
--------------------	---------------------	------------------
			vn_lock
rrw_enter_read
						rrw_enter_write (hangs)
			rrw_enter_read (hangs)
vn_lock (hangs)

Reported by:	Attila Nagy <bra@fsn.hu>

r206792:

Set ARC_L2_WRITING on L2ARC header creation.

Obtained from:	OpenSolaris

r206793:

Remove racy assertion.

Obtained from:	OpenSolaris

r206794:

Extend locks scope to match OpenSolaris.

r206795:

Add missing list and lock destruction.

r206796:

Style fixes.

r206797:

Restore previous order.
2010-04-18 21:36:34 +00:00
Pawel Jakub Dawidek
48ed64d027 MFC r206665:
Use lower priority for GELI worker threads. This improves system
responsiveness under heavy GELI load.
2010-04-18 21:26:59 +00:00
Pawel Jakub Dawidek
2b98f8400d MFC r204076,r204077,r204083,r205279:
r204076:

Please welcome HAST - Highly Avalable Storage.

HAST allows to transparently store data on two physically separated machines
connected over the TCP/IP network. HAST works in Primary-Secondary
(Master-Backup, Master-Slave) configuration, which means that only one of the
cluster nodes can be active at any given time. Only Primary node is able to
handle I/O requests to HAST-managed devices. Currently HAST is limited to two
cluster nodes in total.

HAST operates on block level - it provides disk-like devices in /dev/hast/
directory for use by file systems and/or applications. Working on block level
makes it transparent for file systems and applications. There in no difference
between using HAST-provided device and raw disk, partition, etc. All of them
are just regular GEOM providers in FreeBSD.

For more information please consult hastd(8), hastctl(8) and hast.conf(5)
manual pages, as well as http://wiki.FreeBSD.org/HAST.

Sponsored by:	FreeBSD Foundation
Sponsored by:	OMCnet Internet Service GmbH
Sponsored by:	TransIP BV

r204077:

Remove some lines left over by accident.

r204083:

Add missing KEYWORD line.

Pointed out by:	dougb

r205279 sys:

Simplify loops.
2010-04-18 21:14:49 +00:00