Commit Graph

149470 Commits

Author SHA1 Message Date
Konstantin Belousov
88c45ef724 MFC r197662:
Do not dereference vp->v_mount without holding vnode lock and checking
that the vnode is not reclaimed.

Approved by:	re (bz)
2009-10-08 11:28:32 +00:00
Robert Watson
f41dd6dca9 Merge r197795 from head to stable/8:
In tcp_input(), we acquire a global write lock at first only if a
  segment is likely to trigger a TCP state change (i.e., FIN/RST/SYN).
  If we later have to upgrade the lock, we acquire an inpcb reference
  and drop both global/inpcb locks before reacquiring in-order.  In
  that gap, the connection may transition into TIMEWAIT, so we need
  to loop back and reevaluate the inpcb after relocking.

  Reported by:        Kamigishi Rei <spambox at haruhiism.net>
  Reviewed by:        bz

Approved by:	re (kib)
2009-10-08 11:07:15 +00:00
Yoshihiro Takahashi
8fe1fb2047 MFC: revision 197730
unifdef NFSCLIENT because the nlm depends on the nfsclient even if NFSCLIENT
  is not defined.

  Now the nfslockd module works with the nfsclient module.

  Reviewed by:	kib

Approved by:	re (kensmith)
2009-10-07 14:14:05 +00:00
Doug Barton
a3cd0ffc70 MFC r197725:
The 6bone was decommissioned on 6/6/06, so remove references to it.

Approved by:	re (kib)
2009-10-06 22:15:12 +00:00
Jilles Tjoelker
815fc7356d MFC r197625: Fix using lp(1) without the new -t option after r194171.
Approved by:	re (kib)
2009-10-06 21:23:49 +00:00
Qing Li
c8c92b5491 MFC r197696
Remove a log message from production code. This log message can be
triggered by a misconfigured host that is sending out gratuious ARPs.
This log message can also be triggered during a network renumbering
event when multiple prefixes co-exist on a single network segment.

Approved by:	re
2009-10-06 20:33:02 +00:00
Qing Li
7ec99f713d MFC 197695
Previously, if an address alias is configured on an interface, and
this address alias has a prefix matching that of another address
configured on the same interface, then the ARP entry for the alias
is not deleted from the ARP table when that address alias is removed.
This patch fixes the aforementioned issue.

PR:		kern/139113
Reviewed by:	bz
Approved by:	re
2009-10-06 19:44:44 +00:00
Qing Li
e85f0cc52d MFC r197687
The flow-table associates TCP/UDP flows and IP destinations with
specific routes. When the routing table changes, for example,
when a new route with a more specific prefix is inserted into the
routing table, the flow-table is not updated to reflect that change.
As such existing connections cannot take advantage of the new path.
In some cases the path is broken. This patch will update the affected
flow-table entries when a more specific route is added. The route
entry is properly marked when a route is deleted from the table.
In this case, when the flow-table performs a search, the stale
entry is updated automatically. Therefore this patch is not
necessary for route deletion.

Reviewed by:	bz, kmacy
Approved by:	re
2009-10-06 18:47:02 +00:00
Joe Marcus Clarke
31b752f117 Properly record merginfo for r197681 into lib/libc instead of lib/libc/gen.
Kib didn't see the previous commit before I committed it.  I had assumed
implicit approval when he requested the merginfo.  So pointhats to me
all around.  This commit was reviewed by kib.

Approved by:	re (kib)
2009-10-06 17:10:38 +00:00
Coleman Kane
4718640084 MFC: r197403, r197644, r197654, and r197659
Fix some unexpected potential NULL de-references in kernel mode due to
usage of pre-8.0 wifi operations with the ndis driver wrapping a Win32/64
wifi driver.

Submitted by:	Paul B Mahol <onemda@gmail.com>
Approved by:	re
2009-10-06 16:05:06 +00:00
Pyun YongHyeon
0baf4d9450 MFC r197461:
Use __NO_STRICT_ALIGNMENT to determine whether de(4) have to apply
  alignment fixup code for received frames on strict alignment
  architectures.

MFC r197463:
  Consistently use bus_addr_t.

MFC r197464:
  Destroy dmamap in dma cleanup.

MFC r197465:
  Align Tx/Rx descriptors on 32 bytes boundary instead of PAGE_SIZE.
  Also align setup descriptor on 32 bytes boundary. Tx buffer have no
  alignment limitation so create dmamap without alignment
  restriction[1]. Rx buffer still seems to require 4 bytes alignment
  limitation but we can simply use MCLBYTES for size to map the
  buffer instead of TULIP_DATA_PER_DESC as the buffer is allocated
  with m_getcl(9).
  de(4) supports up to TULIP_MAX_TXSEG segments for Tx buffers,
  increase maximum dma segment size to TULIP_MAX_TXSEG * MCLBYTES.
  While I'm here remove TULIP_DATA_PER_DESC as it is not used anymore.

  This should fix de(4) breakage introduced after r176206.
  Submitted by:	jhb [1]
  Reported by:	WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >
  Tested by:	WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >,
		Takahashi Yoshihiro < nyan <> jp dot freebsd dot org >
Approved by:	re (kib)
2009-10-05 19:29:25 +00:00
Andrew Gallatin
c005a51c4e MFC:197645
Two more mxge watchdog fixes

1) Restore the PCI Express control register after a watchdog
   reset.  This is required because the device will come out
   of watchdog reset with the pectl reg at its default state,
   and important BIOS configuration (like max payload size)
   could be lost.

2) Call mxge_start_locked() for every tx queue before dropping
   the lock in the watchdog handler.   This is required, as
   the queue's buf ring may have filled during the reset.

Approved by:	re (kib)
2009-10-05 14:28:23 +00:00
Yoshihiro Takahashi
ec89a806b8 MFC: revision 197709
Fix build nfscl and/or nfsd.

Approved by:	re (kib)
2009-10-05 14:03:26 +00:00
Joe Marcus Clarke
6c09384ae8 MFC: rev. 197681
Correct the pthread stub prototype for pthread_mutexattr_settype to allow for
the type argument.  This is known to fix some pthread_mutexattr_settype()
invocations, especially when it comes to pulseaudio.

Approved by:	re (kib)
2009-10-04 21:46:43 +00:00
Andrew Thompson
3a3dfbf8c4 MFC r197682
EHCI Hardware BUG workaround

 The EHCI HW can use the qtd_next field instead of qtd_altnext when a short
 packet is received. This contradicts what is stated in the EHCI datasheet.
 Also the total-bytes field in the status field of the following TD gets
 corrupted upon reception of a short packet!  We work this around in software by
 not queueing more than one job/TD at a time of up to 16Kbytes! The bug has been
 seen on multiple INTEL based EHCI chips.  Other vendors have not been tested
 yet.

 - Applications using /dev/usb/X.Y.Z, where Z is non-zero are affected, but not
   applications using LibUSB v0.1, v1.2 and v2.0.
 - Mass Storage (umass) is affected.

Approved by:	re (kib)
2009-10-04 19:03:32 +00:00
Konstantin Belousov
9072a0309e MFC r197663:
As a workaround, for Intel CPUs, do not use CLFLUSH in
pmap_invalidate_cache_range() when self-snoop is apparently not reported
in cpu features.

Approved by:	re (bz, kensmith)
2009-10-04 12:20:59 +00:00
Konstantin Belousov
6832666db4 MFC r197661:
Move the annotation for vm_map_startup() immediately before the function.

Approved by:	re (bz, kensmith)
2009-10-04 12:14:49 +00:00
Konstantin Belousov
68ee1aac0a MFC r197660:
Fix typo.

Approved by:	re (bz, kensmith)
2009-10-04 12:11:44 +00:00
Xin LI
9516a85cc3 MFC revision 197683:
Return EOPNOTSUPP instead of EINVAL when doing chflags(2) over an old
format ZFS, as defined in the manual page.

Submitted by:	pjd (response of my original patch but bugs are mine)
Approved by:	re (kib)
2009-10-04 09:07:29 +00:00
Yoshihiro Takahashi
485080c4c4 MFC: revision 197657
MFi386: revision 197653

    Improve 802.11s comment.

Approved by:	re (bz)
2009-10-03 14:38:22 +00:00
Marius Strobl
721f5d589f MFC: r197490
Merge r194204 from amd64/i386:

Enable PRINTF_BUFR_SIZE by default.

PR:		139134
Approved by:	re (kib)
2009-10-02 18:33:40 +00:00
Simon L. B. Nielsen
bc7f0010f1 MFC r197711:
Add no zero mapping feature.

NOTE: Unlike in the other branches where this change will be "merged"
to, the 'no zero mapping' is enabled by default in stable/8.

Errata:		FreeBSD-EN-09:05.null
Approved by:	re (kib)
2009-10-02 17:58:47 +00:00
Alan Cox
1040e2e4d1 MFC r197580
Temporarily disable the use of 1GB page mappings by the direct map.

Approved by:	re (kib)
2009-10-02 05:11:46 +00:00
Yoshihiro Takahashi
4d1ed2a5c6 MFC: revision 197535
Add '#define NFSCLIENT' into opt_nfs.h if the NFSCLIENT variable is 1
  (the default is 1).

  This makes the nfslockd module works for NFS client.

  Reviewed by:	dfr

Approved by:	re (kib)
2009-10-01 14:42:55 +00:00
Jamie Gritton
a301d3226a MFC r197581, r197583, r197584:
Set the prison in NFS anon and GSS SVC creds.

Reviewed by:	marcel
Approved by:	re (kib)
2009-10-01 13:11:45 +00:00
Rui Paulo
f24f7ffbd4 MFC r197653:
Improve 802.11s comment.

Approved by:	re (kib)
2009-10-01 10:06:09 +00:00
Ken Smith
3c5548d5cc Remove an extra 'S' that snuck in.
Submitted by:	danfe
Approved by:	re (implicit)
2009-09-30 12:53:21 +00:00
Ken Smith
10d9c2f795 Update description of debugging support.
Submitted by:	ivoras (but heavily modified)
Pointy hat:	me
Approved by:	re (implicit)
2009-09-29 19:57:06 +00:00
Doug Barton
d89eb6fc62 MFC r197297
Add a knob to show 'Starting foo:' messages when faststart is used,
such as at boot time.

MFC 197619

By popular acclaim, enable "Starting foo:" messages by default

Approved by:	re (bz)
2009-09-29 18:44:34 +00:00
Rui Paulo
5c58c682cb Mention 802.11s D3.03 support.
Approved by:	re (implicit)
2009-09-29 12:20:10 +00:00
Rui Paulo
f785216c4f Update 802.11s mesh support to draft 3.03. This includes a revised frame
format for peering and changes to the PERR frames.
Note that this is incompatible with the previous code.

Reviewed by:	sam
Approved by:	re (kib)
2009-09-29 12:18:23 +00:00
Pawel Jakub Dawidek
01985d6884 MFC r197287, r197289, r197351, r197426, r197458, r197459, r197497, r197498,
r197512, r197513, r197514, r197515, r197525:

r197287:

Purge namecache for the file system being rolled back, so it doesn't point at
invalid vnodes after the rollback resulting in EIO errors when trying to access
files which are in the namecache.

Reported by:	des

r197289:

Purge file system namecache when receiving incremental stream and rolling back
to it.

r197351:

Purge namecache in the same place OpenSolaris does.

r197426:

Restore BSD behaviour - when creating new directory entry use parent directory
gid to set group ownership and not process gid.

This was overlooked during v6 -> v13 switch.

PR:	kern/139076
Reported by:	Sean Winn <sean@gothic.net.au>

r197458:

Close race in zfs_zget(). We have to increase usecount first and then
check for VI_DOOMED flag. Before this change vnode could be reclaimed
between checking for the flag and increasing usecount.

r197459:

Before calling vflush(FORCECLOSE) mark file system as unmounted so the
following vnops will fail. This is very important, because without this change
vnode could be reclaimed at any point, even if we increased usecount. The only
way to ensure that vnode won't be reclaimed was to lock it, which would be very
hard to do in ZFS without changing a lot of code. With this change simply
increasing usecount is enough to be sure vnode won't be reclaimed from under
us. To be precise it can still be reclaimed but we won't be able to see it,
because every try to enter ZFS through VFS will result in EIO.

The only function that cannot return EIO, because it is needed for vflush() is
zfs_root(). Introduce ZFS_ENTER_NOERROR() macro that only locks
z_teardown_lock and never returns EIO.

r197497:

Switch to fletcher4 as the default checksum algorithm. Fletcher2 was proven to
be a bit weak and OpenSolaris also switched to fletcher4.

r197498:	head/cddl/contrib/opensolaris

Fletcher4 is not the default checksum algorithm.

r197512:

- Don't depend on value returned by gfs_*_inactive(), it doesn't work
  well with forced unmounts when GFS vnodes are referenced.
- Make other preparations to GFS for forced unmounts.

PR:	kern/139062
Reported by:	trasz

r197513:

Use traverse() function to find and return mount point's vnode instead of
covered vnode when snapshot is already mounted.

r197514:

On lookup error VFS expects *vpp to be set to NULL, be sure to do that.

r197515:

Handle cases where virtual (GFS) vnodes are referenced when doing forced
unmount. In that case we cannot depend on the proper order of invalidating
vnodes, so we have to free resources when we have a chance.

PR:	kern/139062
Reported by:	trasz

r197525:

Ensure that tv_sec is between INT32_MIN and INT32_MAX, so ZFS won't object.
This completes the fix from r185586.

PR:	kern/139059
Reported by:	Daniel Braniss <danny@cs.huji.ac.il>
Submitted by:	Jaakko Heinonen <jh@saunalahti.fi>
Tested by:	Daniel Braniss <danny@cs.huji.ac.il>

Approved by:	re (kib)
2009-09-29 10:53:06 +00:00
Andrew Gallatin
264d14d30d MFC 197395: Improve mxge watchdog routine's ability to reliably reset a failed NIC
Approved by: re (kib)
2009-09-28 23:48:16 +00:00
Michael Tuexen
fe36e02918 MFC r197341.
Fix errnos.

Approved by: re (bz), rrs (mentor)
2009-09-28 18:32:28 +00:00
Konstantin Belousov
b57f5ce0bd MFC r197390:
Remove forward_roundrobin().

Approved by:	re (kensmith)
2009-09-28 11:31:21 +00:00
Marius Strobl
238bc19306 MFC: r197401
- According to Linux, the ALi M5451 can do 31-bit DMA instead of just
  30-bit like the reset of the controllers supported by this driver.
  Actually ALi M5451 can be setup up to generate 32-bit addresses by
  setting the 31st bit via the accompanying ISA bridge, which allows
  it to work in sparc64 machines whose IOMMU require at least 32-bit
  DMA. Even though other architectures would also benefit from 32-bit
  DMA, enabling this bit is limited to sparc64 as bus_dma(9) doesn't
  generally guarantee that a low address of BUS_SPACE_MAXADDR_32BIT
  results in a buffer in the 32-bit range.
- According to Tatsuo YOKOGAWA's ali(4), the the DMA transfer size of
  ALi M5451 is fixed to 64k and in fact using the default size of 4k
  causes the chip to overrun the mapping, triggering uncorrectable
  DMA errors on sparc64.
- The 4DWAVE DX and NX require the recording buffer to be 8-byte
  aligned so adjust the bus_dma_tag_create(9) accordingly.
- Unlike the rest of the controllers supported by this driver, the
  ALi M5451 only has 32 hardware channels instead of 64 so limit the
  loop in tr_intr() accordingly. [1]

Submitted by:	yongari [1]
Reviewed by:	yongari (superset of what is committed)
Approved by:	re (kib)
2009-09-25 19:59:18 +00:00
Alexander Motin
b8b5722c5d Remove constraint, requiring request data to fulfill controller's
alignment requirements. It is busdma task, to manage proper alignment by
loading data to bounce buffers.

PR:		kern/127316
Reviewed by:	current@
Tested by:	Ryan Rogers
Approved by:	re (kib)
2009-09-25 18:07:23 +00:00
Alexander Motin
2adf464fea MFC rev. 197462:
Do not call BUS_DRIVER_ADDED() for detached buses (attach failed) on
driver load. This fixes crash on atapicam module load on systems, where
some ata channels (usually ata1) was probed, but failed to attach.

Reviewed by:    jhb, imp
Tested by:      many
Approved by:    re (kib)
2009-09-25 18:04:55 +00:00
Marcel Moolenaar
3b9790003e MFC rev 197449:
Don't create more partitions than can fit in the table by checking
that the index is within bounds.

Approved by:	re (kib)
2009-09-25 17:48:30 +00:00
Marius Strobl
54577e2314 - Add missing bus_dmamap_sync(9) calls for the work DMA map. Previously
the work area was totally unsynchronized which means this driver only
  had a chance of working on x86 when no bounce buffers were involved,
  which isn't that likely given that support for 64-bit DMA is currently
  broken throughout ata(4).
- Add necessary little-endian conversion of accesses to the work area,
  making this driver work on big-endian hosts. While at it, use the
  alignment-agnostic byte order encoders in order to be on the safe side.
- Clear the reserved member of the SG list entries in order to be on the
  safe side. [1]

Submitted by:	yongari [1]
Reviewed by:	yongari
Approved by:	re (kib)
2009-09-25 16:45:27 +00:00
John Baldwin
424b2e64a2 MFC 197415:
The elements in the component arrays may be direct Package objects rather
than references to objects.  In that case, simply use the Package directly.

Approved by:	re (kib)
2009-09-25 15:14:11 +00:00
John Baldwin
57a0ee4c0b MFC 197410:
- Split the logic to parse an SMAP entry out into a separate function on
  amd64 similar to i386.  This fixes a bug on amd64 where overlapping
  entries would not cause the SMAP parsing to stop.
- Change the SMAP parsing code to do a sorted insertion into physmap[]
  instead of an append to support systems with out-of-order SMAP entries.

Approved by:	re (kib)
2009-09-25 15:08:26 +00:00
John Baldwin
b10d205de2 MFC 197406:
Don't reread the command register to see if enabling I/O or memory
decoding "took".  Other OS's that I checked do not do this and it breaks
some amdpm(4) devices.  Prior to 7.2 we did not honor the error returned
when this failed anyway, so this in effect restores previous behavior.

Approved by:	re (kib)
2009-09-25 14:58:00 +00:00
Brooks Davis
ad00749016 MFC r196990:
cr_groups is no longer embedded in struct ucred and is instead stored
in a seperate array.  As such we need to use kvm_read rather than bcopy
to populate the ki_groups field.

This fixes a crash when running ps -ax on a coredump.

Reported by:	brucec
Tested by:	brucec
MFC after:	3 days
Approved by:	re@ (kib)
2009-09-24 21:35:13 +00:00
Brooks Davis
7bd26ba4cc MFC r197269:
Allocate space for the group array in a static credential used in
the quota code.  One case was correctly handled in r194498, but
this one was missed.

PR:		kern/138657
Tested by:	PR submitter
MFC after:	3 days
Approved by:	re@ (kib)
2009-09-24 21:32:56 +00:00
Stephane E. Potvin
0c6c8b3e8f MFC r197259
The buffer returned by fgetln is not a "C" string and might not be NUL
terminated. Make sure that it is before using it.

Reviewed by:    marck@
Approved by:	re (kib)
2009-09-24 20:43:08 +00:00
Yoshihiro Takahashi
8b1e4172cb MFC: r197322 and r197374
Revision: 197322
  Log:
    Correct BIOS header sanitizing on pc98.

  Revision: 197374
  Log:
    Disable a check on a disk size because it's too strict.  This change is
    to avoid using incorrect geometry.

   It seems that this is the same problem in g_part_bsd_read()@g_part_bsd.c.

   Reviewed by: rink

Approved by:	re (kib)
2009-09-24 15:34:18 +00:00
Attilio Rao
917c07ca1d MFC r197445:
Let fall down in the hard path (thus handling shared waiters wakeup
correctly) for the shared waiters also in the rwlock held in shared mode
as well, fixing possible deadlocks.

Please note that this is a special condition as we want this fix in
before RC2 as we assume it is critical and so it has been handled
as an instant-merge.  For the STABLE_7 branch, 1 week before the MFC
is assumed.

Approved by:	re (kib)
2009-09-24 08:35:17 +00:00
John Baldwin
4e36c32793 MFC 197350:
Re-remove the IBM0057 ID used for PS/2 mouse controllers.  The asl for the
61p includes the hotkey device as IBM0068 and the mouse as IBM0057 similar
to other systems.

Approved by:	re (kensmith)
2009-09-23 15:56:09 +00:00
Konstantin Belousov
2c5f9fbe6a MFC r197348:
For a.out and pre-8 ELF binaries, allow the mmap of zero length.

Approved by:	re (kensmith)
2009-09-23 13:49:41 +00:00