117588 Commits

Author SHA1 Message Date
rwatson
70be888bba Merge fifo_vnops.c:1.132 from HEAD to RELENG_6:
Second attempt at a work-around for fifo-related socket panics during
  make -j with high levels of parallelism: acquire Giant in fifo I/O
  routines.

  Discussed with: ups

Approved by:	re (scottl)
2005-10-04 15:33:06 +00:00
dds
a05f20d858 MFC 1.28
Bug fix: a numeric flag specification in the substitute command would
cause the next substitute flag to be ignored.
While working at it, detect and report overflows.

Reported by:	Jingsong Liu
Bugged by:	Xin Li
Approved by:	re (kensmith)
2005-10-04 15:26:10 +00:00
jhb
0950005259 MFC: Add interrupt counters for IPIs.
Approved by:	re (scottl)
2005-10-04 15:15:22 +00:00
jhb
fdc83af1f5 MFC: Rename the lapic timer interrupt counter to cpuX: timer.
Approved by:	re (scottl)
2005-10-04 15:13:06 +00:00
ache
7e1a58e7bc MFC: 1.26-1.28
Approved by: re
2005-10-04 14:33:09 +00:00
ache
9894c5fb7c MFC: 1.23
Approved by: re
2005-10-04 14:31:10 +00:00
glebius
37d9f48fcd MFC 1.73:
In em_process_receive_interrupts() store and clear adapter->fmt. This
  make function reenterable. In the runtime the race is masked by
  serializing
  of em_process_receive_interrupts() either by interrupt thread, or by
  polling. The race can be triggered when polling is switched on or off.

Approved by:	re (scottl)
2005-10-04 14:07:44 +00:00
phk
39f2622e6f MFC:
Add the flash device sizing subroutine.

Approved by:	re@ (scottle)
Reminded by:	simon@
2005-10-04 13:56:35 +00:00
peadar
5f354c9a11 MFC BOOTSIG[23] removal:
msdosfs_vfsops.c v1.146
    bootsect.h v1.13

    Remove checks for BOOTSIG[23] from FAT32 bootblocks.
    There seems to be very little documentary evidence outside this
    implementation to suggest a these checks are neccessary, and more
    than one camera-formatted flash disk fails the check, but mounts
    successfully on most other systems.

Approved by: re (scottl@)
2005-10-04 13:13:57 +00:00
cognet
053034ba29 MFC rev 1.146 (and 1.147)
revision 1.146
date: 2005/09/28 16:05:13;  author: cognet;  state: Exp;  lines: +7 -1
Use SO_REUSEADDR on the socket, to make the use of syslogd in jails easier.

Submitted by:   Jeremie Le Hen <jeremie le-hen org>
Approved by:	re
2005-10-04 12:50:11 +00:00
truckman
4df51e5f85 MFC snaplk deadlock fix
src/sys/kern/vfs_bio.c          1.495, 1.496
        src/sys/kern/vfs_subr.c         1.648
        src/sys/sys/buf.h               1.190, 1.191
        src/sys/sys/proc.h              1.436
        src/sys/ufs/ffs/ffs_snapshot.c  1.104, 1.105, 1.106

Original commit messages:

    Log:
    Un-staticize runningbufwakeup() and staticize updateproc.

    Add a new private thread flag to indicate that the thread should
    not sleep if runningbufspace is too large.

    Set this flag on the bufdaemon and syncer threads so that they skip
    the waitrunningbufspace() call in bufwrite() rather than than
    checking the proc pointer vs. the known proc pointers for these two
    threads.  A way of preventing these threads from being starved for
    I/O but still placing limits on their outstanding I/O would be
    desirable.

    Set this flag in ffs_copyonwrite() to prevent bufwrite() calls from
    blocking on the runningbufspace check while holding snaplk.  This
    prevents snaplk from being held for an arbitrarily long period of
    time if runningbufspace is high and greatly reduces the contention
    for snaplk.  The disadvantage is that ffs_copyonwrite() can start
    a large amount of I/O if there are a large number of snapshots,
    which could cause a deadlock in other parts of the code.

    Call runningbufwakeup() in ffs_copyonwrite() to decrement runningbufspace
    before attempting to grab snaplk so that I/O requests waiting on
    snaplk are not counted in runningbufspace as being in-progress.
    Increment runningbufspace again before actually launching the
    original I/O request.

    Prior to the above two changes, the system could deadlock if enough
    I/O requests were blocked by snaplk to prevent runningbufspace from
    falling below lorunningspace and one of the bawrite() calls in
    ffs_copyonwrite() blocked in waitrunningbufspace() while holding
    snaplk.

    See <http://www.holm.cc/stress/log/cons143.html>

    Revision  Changes    Path
    1.495     +3 -3      src/sys/kern/vfs_bio.c
    1.648     +2 -1      src/sys/kern/vfs_subr.c
    1.190     +1 -0      src/sys/sys/buf.h
    1.436     +1 -1      src/sys/sys/proc.h
    1.104     +16 -4     src/sys/ufs/ffs/ffs_snapshot.c

    Log:
    Un-staticize waitrunningbufspace() and call it before returning from
    ffs_copyonwrite() if any async writes were launched.

    Restore the threads previous TDP_NORUNNINGBUF state before returning
    from ffs_copyonwrite().

    Revision  Changes    Path
    1.496     +1 -1      src/sys/kern/vfs_bio.c
    1.191     +1 -0      src/sys/sys/buf.h
    1.105     +13 -1     src/sys/ufs/ffs/ffs_snapshot.c

    Log:
    Correct previous commit to fix the sense of the TDP_NORUNNINGBUF
    check in ffs_copyonwrite() that is a precondition for calling
    waitrunningbufspace().

    Pointed out by: tegge
    Pointy hat to:  truckman
    MFC after:      3 days

    Revision  Changes    Path
    1.106     +1 -1      src/sys/ufs/ffs/ffs_snapshot.c

Approved by:	re (scottl)
2005-10-04 04:41:27 +00:00
truckman
9f7e4b429e MFC kern_exec.c 1.276 (and 1.278)
Original commit messages:

  truckman    2005-10-01 08:33:57 UTC

    FreeBSD src repository

    Modified files:
      sys/kern             kern_exec.c
    Log:
    Copy new process argument list in do_execve() before grabbing PROC_LOCK
    to avoid touching pageable memory while holding a mutex.

    Simplify argument list replacement logic.

    PR:            kern/84935
    Submitted by:  "Antoine Pelisse" apelisse AT gmail.com (in a different form)
    MFC after:     3 days

    Revision  Changes    Path
    1.276     +10 -10    src/sys/kern/kern_exec.c

  truckman    2005-10-04 04:02:33 UTC

    FreeBSD src repository

    Modified files:
      sys/kern             kern_exec.c
    Log:
    Add missing word to comment.

    Revision  Changes    Path
    1.278     +1 -1      src/sys/kern/kern_exec.c

PR:		kern/84935
Submitted by:	"Antoine Pelisse" apelisse AT gmail.com (in a different form)
Approved by:	re (scottl)
2005-10-04 04:29:08 +00:00
grog
b4701f3c9a MFC:
Initialize uninitialized variables.
  Remove one possible way of shooting yourself in the foot.

Requested by:   Dan Lukes <dan@obluda.cz>
Approved by:	RE (kensmith@)

And now for the scripts which refuse the line above:

Approved by: re
2005-10-03 23:45:01 +00:00
cperciva
571f9d1571 MFC revision 1.11: Fix a bug introduced in revision 1.9 which causes
chkgrp to coredump on certain corrupt files.

Approved by:	re (scottl)
2005-10-03 21:39:21 +00:00
ups
22426a09ff MFC revision 1.9:
Fix the "fpudna: fpcurthread == curthread XXX times" problem.

Approved by: re (scottl@)
2005-10-03 20:08:00 +00:00
peadar
9da5a3fa01 MFC revision 1.494:
Close a race in biodone(), whereby the bio_done field of the passed
    bio may have been freed and reassigned by the wakeup before being
    tested after releasing the bdonelock.

Approved by: re (scottl@)
2005-10-03 09:30:12 +00:00
hrs
2b9de61ca4 Add KPnS (known problems and solutions) entries:
- /dev/ttyv* not found on FreeBSD/sparc64 when
   there is no framebuffer[1].

 - KLDs do not work on FreeBSD/sparc64 with >4GB RAM[2].

 - kgdb is broken for debugging panics on FreeBSD/sparc64[2].

Thanks to:	marius[1], kris[2]
Approved by:	re (implicitly)
2005-10-02 20:11:34 +00:00
cperciva
bf4a52992c MFC revision 1.639: Don't let the upper bits of %dr6/%dr7 get set.
Submitted by:	Nate Eldredge
Approved by:	re@ (scottl)
Security:	Local denial of service
2005-10-02 16:38:12 +00:00
andre
882a000881 MFC IP_DONTFRAG IP socket option.
Approved by:	re (scottl)
2005-10-02 15:45:47 +00:00
joel
b737a883c5 MFC rev 1.55-1.58:
*  Document existing support for:
  -  ALI M5229
  -  ALI M5281
  -  ALI M5287
  -  ALI M5289
  -  CMD 646U2
  -  Highpoint HPT372N
  -  Intel 6300ESB
  -  Intel ICH7
  -  Nvidia nForce2 MCP
  -  Nvidia nForce3 MCP
  -  Nvidia nForce3 Pro
  -  Nvidia nForce4
  -  Promise PDC20571
  -  Promise PDC20575
  -  Promise PDC20579
  -  Promise PDC20580
  -  Promise PDC20621
  -  Promise PDC20622
  -  Promise PDC40518
  -  Promise PDC40519
  -  Promise PDC40718
  -  Promise PDC40719
  -  SIS 180
  -  SIS 181
  -  SIS 182
  -  SIS 965
  -  VIA VT6410
  -  VIA VT6420
  -  VIA VT6421

*  Add two missing dots.

*  Remove HPT366 duplicate.

Approved by:	re (hrs)
2005-10-02 14:32:06 +00:00
ru
6efd618657 MFC: 1.46: Document that -q also affects "route change".
Approved by:	re (hrs)
2005-10-02 13:44:05 +00:00
fjoe
9319fa7172 MFC g_uzip.c rev. 1.5:
- Fix "end_blk out of range" panic when INVARIANTS.
- Do not allow rw access.

Approved by:	re (scott)
2005-10-02 11:22:28 +00:00
rwatson
5adaceafef Merge kern_lock.c:1.95 from HEAD to RELENG_6:
Include kdb.h so that kdb_active is declared regardless of KDB being
  included in the kernel.

Approved by:	re (kensmith)
2005-10-02 10:08:29 +00:00
rwatson
f58713cf53 Merge fifo_vnops.c:1.130 from HEAD to RELENG_6:
Assert v_fifoinfo is non-NULL in fifo_close() in order to catch
  non-conforming cases sooner.

  Reported by:    Peter Holm <peter at holm dot cc>

Approved by:	re (scottl)
2005-10-02 10:07:21 +00:00
rwatson
6817015865 Merge subr_pcpu.c:1.7 from HEAD to RELENG_6:
Add "show allpcpu" to DDB, which prints the current CPU id followed by
  the per-cpu data for all CPUs.  This is easier to ask users to do than
  "figure out how many CPUs you have, now run show pcpu, then run it
  once for each CPU you have".

Approved by:	re (scottl)
2005-10-02 10:06:49 +00:00
rwatson
f2f6c85a6b Merge subr_kdb.c:1.13 from HEAD to RELENG_6:
If KDB_STOP_NMI is compiled into the kernel, default
  debug.kdb.stop_cpus_with_nmi to 1 rather than 0.

Approved by:	re (scottl)
2005-10-02 10:06:15 +00:00
rwatson
5b2f9f7b7e Merge kern_lock.c:1.94 from HEAD to RELENG_6:
In lockstatus(), don't lock and unlock the interlock when testing the
  sleep lock status while kdb_active, or we risk contending with the
  mutex on another CPU, resulting in a panic when using "show
  lockedvnods" while in DDB.

  Reviewed by:    jhb
  Reported by:    kris

Approved by:	re (scottl)
2005-10-02 09:58:54 +00:00
truckman
670ac96738 MFC ffs_softdep.c 1.185
Original commit message:

  truckman    2005-09-29 21:50:26 UTC

   FreeBSD src repository

   Modified files:
     sys/ufs/ffs          ffs_softdep.c
   Log:
   After a rmdir()ed directory has been truncated, force an update of
   the directory's inode after queuing the dirrem that will decrement
   the parent directory's link count.  This will force the update of
   the parent directory's actual link to actually be scheduled.  Without
   this change the parent directory's actual link count would not be
   updated until ufs_inactive() cleared the inode of the newly removed
   directory, which might be deferred indefinitely.  ufs_inactive()
   will not be called as long as any process holds a reference to the
   removed directory, and ufs_inactive() will not clear the inode if
   the link count is non-zero, which could be the result of an earlier
   system crash.

   If a background fsck is run before the update of the parent directory's
   actual link count has been performed, or at least scheduled by
   putting the dirrem on the leaf directory's inodedep id_bufwait list,
   fsck will corrupt the file system by decrementing the parent
   directory's effective link count, which was previously correct
   because it already took the removal of the leaf directory into
   account, and setting the actual link count to the same value as the
   effective link count after the dangling, removed, leaf directory
   has been removed.  This happens because fsck acts based on the
   actual link count, which will be too high when fsck creates the
   file system snapshot that it references.

   This change has the fortunate side effect of more quickly cleaning
   up the large number dirrem structures that linger for an extended
   time after the removal of a large directory tree.  It also fixes a
   potential problem with the shutdown of the syncer thread timing out
   if the system is rebooted immediately after removing a large directory
   tree.

   Submitted by:   tegge
   MFC after:      3 days

   Revision  Changes    Path
   1.185     +2 -0      src/sys/ufs/ffs/ffs_softdep.c

Submitted by:	tegge
Approved by:	re (scottl)
2005-10-02 08:25:33 +00:00
kensmith
0b3b3a9b30 MFC revision 1.890:
> date: 2005/09/28 12:39:00;  author: kensmith;  state: Exp;  lines: +17 -6
> Add SHA256 checksums to the release build.
>
> Requested by:           cperciva (so)
> Reviewed/improved by:   ru

Approved by:	re (scottl)
2005-10-02 05:47:04 +00:00
csjp
0fcc9c347d MFC bpf.c v1.159
Make stats a bit more accurate by refreshing the PID after each
descriptor operation.

Approved by:	re (scottl)
2005-10-01 18:43:16 +00:00
phk
d1a2719799 MFC:
one character fix in mount option name.

Approved by:	re@ (scottl)
2005-10-01 17:39:50 +00:00
ume
33dceb90f2 MFC: add product ID for Linux Ethernet/RNDIS gadget on pxa210/25x/26x.
sys/dev/usb/if_cdce.c:	1.11
	sys/dev/usb/usbdevs:	1.234

Approved by:	re (scottl)
2005-10-01 16:26:25 +00:00
andre
1d50cd7eb9 MFC: IP_MINTTL socket option.
Approved by:	re (scottl)
2005-10-01 15:56:44 +00:00
jkoshy
25968c47c3 MFC r1.11-1.12:
- Correct a typo.
  - Note the requirement for 'device apic' on i386 systems.
  - Consistently use 'x86' when referring to behaviour common to the
    i386 and amd64.

Approved by:	re (hrs)
2005-10-01 15:52:13 +00:00
jkoshy
9944742e75 MFC r1.5:
The 'intr_bufferfull' driver statistic actually counts the number
  of times sampling was stopped due to a space shortage; change its
  description in the output of `pmcstat -s` to match reality.

Approved by:	re (scottl)
2005-10-01 15:48:02 +00:00
des
b0f5f61587 MFC: don't take unprotected keys into account for authentication.
PR:		bin/81231
Approved by:	re (kensmith)
2005-09-30 14:02:29 +00:00
nyan
9fa3c16a94 MFC: Call gctl_free() to free resource allocated with gctl_get_handle().
Approved by:	re (kensmith)
2005-09-30 13:09:01 +00:00
delphij
15d6d1b68d MFC sys/fs/hpfs/hpfs_vfsops.c:1.54-1.56,
sys/fs/msdosfs/msdosfs_vfsops.c:1.145,
    sys/fs/ntfs/ntfs_vfsops.c:1.79-1.80,
    sys/fs/udf/udf_vfsops.c:1.34-1.35,
    sys/gnu/fs/ext2fs/ext2_vfsops.c:1.152-1.153,
    sys/gnu/fs/reiserfs/reiserfs_vfsops.c:1.2-1.3 (by ssouhlal):

*_mountfs() (if the filesystem mounts from a device) needs devvp to be
locked, so lock it.

Approved by:	re (scottl)
2005-09-30 06:26:42 +00:00
delphij
8eaf585962 MFC 1.293 (by ssouhlal):
ffs_mountfs() needs devvp to be locked, so lock it.

Approved by:	re (scottl)
2005-09-30 06:14:44 +00:00
delphij
4bdf4b1161 MFC 1.197 (by ssouhlal):
Don't unbusy the devfs mount in vfs_mountroot_try() as it gets accessed
and unbusied in devfs_fixup(), which assumes that the devfs mount is
still locked.

Approved by:	re (scottl)
2005-09-30 06:10:59 +00:00
csjp
7c428d998f MFC src/contrib/pf/pflogd/pflogd.c rev 1.9
Implement BIOCLOCK

Approved by:	re (kensmith)
2005-09-29 23:50:29 +00:00
csjp
a49552acda MFC privilege separation enhancements for bpf(4)
Introduce BIOCLOCK and BIOCSETWF

Revision(s)
    1.158     +81 -23    src/sys/net/bpf.c
    1.40      +2 -0      src/sys/net/bpf.h
    1.31      +4 -1      src/sys/net/bpfdesc.h

Approved by:	re (scottl)
2005-09-29 23:48:04 +00:00
rwatson
a15c06842e Merge if.c:1.247, in.c:1.88, in.h:1.92 from HEAD to RELENG_6:
Take a first cut at cleaning up ifnet removal and multicast socket
  panics, which occur when stale ifnet pointers are left in struct
  moptions hung off of inpcbs:

  - Add in_ifdetach(), which matches in6_ifdetach(), and allows the
    protocol to perform early tear-down on the interface early in
    if_detach().

  - Annotate that if_detach() needs careful consideration.

  - Remove calls to in_pcbpurgeif0() in the handling of SIOCDIFADDR --
    this is not the place to detect interface removal!  This also
    removes what is basically a nasty (and now unnecessary) hack.

  - Invoke in_pcbpurgeif0() from in_ifdetach(), in both raw and UDP
    IPv4 sockets.

  It is now possible to run the msocket_ifnet_remove regression test
  using HEAD without panicking.

  Reported by:	Gavin Atkinson <gavin dot atkinson at ury dot york dot ac dot uk>

Approved by:	re (scottl)
2005-09-29 20:57:07 +00:00
jhb
3f3d85126f MFC: Use correct VFS locking in kern_alternate_path().
Approved by:	re (scottl)
2005-09-29 18:53:10 +00:00
jhb
81459002f4 MFC various fixes to sis(4):
- Remove sis_unit and use device_printf() and if_printf() instead.
- Use callout_init_mtx() for the callout.
- Remove spls.
- Fix locking for ifmedia to happen in the ifmedia handlers rather than in
  sis_ioctl().

Approved by:	re (scottl)
2005-09-29 18:52:21 +00:00
jhb
9016005ea3 MFC: Add the spin lock used by the binary nvidia-driver to the static lock
order list.

Approved by:	re (scottl)
2005-09-29 18:47:31 +00:00
rwatson
5db6e492ee Merge subr_prof.c:1.119, 1.120, 1.121, nfs_socket.c:1.130,
rpcclnt.c:1.14 from HEAD to RELENG_6:

Acquire Giant in uprintf() and tprintf() due to the non-MPSAFEty of
the tty code invoked from these functions.  In two cases, during
timeout handling in NFS-related RPC client code, acquire Giant in
the caller before other mutexes the caller might hold, in order to
avoid lock order reversals with Giant (a recursive acquire is not
a reversal as it won't ever wait).

Correct age-old comments about uprintf()/tprintf() sleeping: they
will never sleep.

Much useful feedback from:	bde
Approved by:			re (scottl)
2005-09-29 18:40:36 +00:00
glebius
ebe24453ed MFC 1.62:
- Print space character in show_stat(). Remove a lot of priuntf(" ").
  - Utilize show_stat() in sidewaysintpr() loop. This makes periodic
    statistics to honor -h flag.

Approved by:	re (kensmith)
2005-09-29 13:19:10 +00:00
brueffer
d687ed0ea8 MFC: rev. 1.6
Fix typo.

Approved by:	re (hrs)
2005-09-28 16:51:27 +00:00
ru
25fd00f1d2 MFC: 1.57: Respect IFF_PROMISC.
Approved by:	re (scottl)
2005-09-28 16:46:17 +00:00