]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
12 years agoFix multiple OpenSSL vulnerabilities.
bz [Thu, 3 May 2012 15:25:11 +0000 (15:25 +0000)]
Fix multiple OpenSSL vulnerabilities.

Security: CVE-2011-4576, CVE-2011-4619, CVE-2011-4109
Security: CVE-2012-0884, CVE-2012-2110
Security: FreeBSD-SA-12:01.openssl
Approved by: so (bz,simon)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234954 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234701:
tuexen [Thu, 3 May 2012 09:47:22 +0000 (09:47 +0000)]
MFC r234701:

Fix a bug in the TCP tracerouting which resulted in not accepting any
incoming packets. So all packets seemed to be lost.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234948 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234715,r234716:
tuexen [Thu, 3 May 2012 07:12:38 +0000 (07:12 +0000)]
MFC r234715,r234716:
Export symbols for sctp_sendv() and sctp_recvv().
Move sctp_sendv and sctp_recvv to FBSD_1.3 as suggested by
Konstantin Belousov.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234942 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233787:
jh [Wed, 2 May 2012 15:15:28 +0000 (15:15 +0000)]
MFC r233787:

- Use more natural ip->i_flags instead of vap->va_flags in the final
  flags check.
- Add a comment for the immutable/append check done after handling of
  the flags.
- Style improvements.

No functional change intended.

MFC r234421:

The part about exec atime no longer applies in the comment.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234929 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234417:
marck [Wed, 2 May 2012 08:38:43 +0000 (08:38 +0000)]
MFC r234417:

  VMware environments are not unusual now.  Add VMware partitions recognition
  (both MBR for ESXi <= 4.1 and GPT for ESXi 5) to g_part.

  Reviewed by: ae
  Approved by: ae

git-svn-id: svn://svn.freebsd.org/base/stable/9@234922 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234415:
mav [Wed, 2 May 2012 07:17:53 +0000 (07:17 +0000)]
MFC r234415:
Some improvements to GEOM MULTIPATH:
 - Implement "configure" command to allow switching operation mode of
running device on-fly without destroying and recreation.
 - Implement Active/Read mode as hybrid of Active/Active and Active/Passive.
In this mode all paths not marked FAIL may handle reads same time,
but unlike Active/Active only one path handles write requests at any
point in time. It allows to closer follow original write request order
if above layers need it for data consistency (not waiting for requisite
write completion before sending dependent write).
 - Hide duplicate messages about device status change.
 - Remove periodic thread wake up with 10Hz rate.

Sponsored by: iXsystems, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234916 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233770:
delphij [Wed, 2 May 2012 00:30:30 +0000 (00:30 +0000)]
MFC r233770:

Eliminate two cases of unwanted strncpy().  The name is not required
by the current code, and the results would get overwritten anyway
by subsequent memset().

Reviewed by: ume

git-svn-id: svn://svn.freebsd.org/base/stable/9@234903 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234657:
kib [Tue, 1 May 2012 10:49:20 +0000 (10:49 +0000)]
MFC r234657:
Take the spinlock around clearing of the fp->_flags in fclose(3), which
indicates the avaliability of FILE, to prevent possible reordering of
the writes as seen by other CPUs.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234871 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234762:
tuexen [Tue, 1 May 2012 07:15:18 +0000 (07:15 +0000)]
MFC r234762:
Whitespace changes.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234864 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234345:
marck [Mon, 30 Apr 2012 22:03:43 +0000 (22:03 +0000)]
MFC r234345:

VMware environment is frequent nowadays.  Add VMFS id.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234853 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233998-r234000 and r234325:
gleb [Mon, 30 Apr 2012 17:56:49 +0000 (17:56 +0000)]
MFC r233998-r234000 and r234325:

r233998:
Add reserved memory limit sysctl to tmpfs.  Cleanup availble and used
memory functions.  Check if free pages available before allocating new
node.

r233999 (partial):
Add vfs_getopt_size. Support human readable file system options in tmpfs.
Increase maximum tmpfs file system size to 4GB*PAGE_SIZE on 32 bit archs.

NOTE: To preserve KBI add tmpfs_getopt_size function instead of global
vfs_getopt_size.

r234000:
tmpfs supports only INT_MAX nodes due to limitations of unit number
allocator.  Replace UINT32_MAX checks with INT_MAX. Keeping more than 2^31
nodes in memory is not likely to become possible in foreseeable feature
and would require new unit number allocator.

r234325:
Provide better description for vfs.tmpfs.memory_reserved sysctl.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234849 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233575:
dumbbell [Mon, 30 Apr 2012 15:46:41 +0000 (15:46 +0000)]
MFC r233575:
Make ReiserFS MPSAFE

Most functions seemed to be already fine w.r.t. what's done in msdosfs.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234845 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233507:
dumbbell [Mon, 30 Apr 2012 13:34:15 +0000 (13:34 +0000)]
MFC r233507:
Use program exit status as pam_exec return code (optional)

pam_exec(8) now accepts a new option "return_prog_exit_status". When
set, the program exit status is used as the pam_exec return code. It
allows the program to tell why the step failed (eg. user unknown).
However, if it exits with a code not allowed by the calling PAM service
module function (see $PAM_SM_FUNC below), a warning is logged and
PAM_SERVICE_ERR is returned.

The following changes are related to this new feature but they apply no
matter if the "return_prog_exit_status" option is set or not.

The environment passed to the program is extended:
    o  $PAM_SM_FUNC contains the name of the PAM service module function
       (eg. pam_sm_authenticate).
    o  All valid PAM return codes' numerical values are available
       through variables named after the return code name. For instance,
       $PAM_SUCCESS, $PAM_USER_UNKNOWN or $PAM_PERM_DENIED.

pam_exec return code better reflects what went on:
    o  If the program exits with !0, the return code is now
       PAM_PERM_DENIED, not PAM_SYSTEM_ERR.
    o  If the program fails because of a signal (WIFSIGNALED) or doesn't
       terminate normally (!WIFEXITED), the return code is now
       PAM_SERVICE_ERR, not PAM_SYSTEM_ERR.
    o  If a syscall in pam_exec fails, the return code remains
       PAM_SYSTEM_ERR.

waitpid(2) is called in a loop. If it returns because of EINTR, do it
again. Before, it would return PAM_SYSTEM_ERR without waiting for the
child to exit.

Several log messages now include the PAM service module function name.

The man page is updated accordingly.

Reviewed by: des@
Sponsored by: Yakaz (http://www.yakaz.com)

MFC r234184:
Fix error messages containing the executed command name

Before, we took the first argument to pam_exec(8). With the addition of
options in front of the command, this could be wrong.

Now, options are parsed before calling _pam_exec() and messages contain
the proper command name.

While here, fix a warning.

Sponsored by: Yakaz (http://www.yakaz.com)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234842 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234616:
kib [Mon, 30 Apr 2012 13:07:21 +0000 (13:07 +0000)]
MFC r234616:
Allow for the process information sysctls to accept a thread id in addition
to the process id.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234839 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234731:
tuexen [Mon, 30 Apr 2012 06:48:18 +0000 (06:48 +0000)]
MFC r234731:
Remove unused structure.
Reported by Irene Ruengeler.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234827 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234699:
tuexen [Sun, 29 Apr 2012 16:35:55 +0000 (16:35 +0000)]
MFC r234699:
Fix a type in an SCTP AUTH related notification. Keep the old name
for backwards compatibility.
Spotted by Irene Ruengeler.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234802 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234614:
tuexen [Sun, 29 Apr 2012 16:33:30 +0000 (16:33 +0000)]
MFC r234614:

Use the flags defined in RFC 6525 in the stream reset event.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234801 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234539:
tuexen [Sun, 29 Apr 2012 16:29:39 +0000 (16:29 +0000)]
MFC r234539:
Fix check used by stream reset related events.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234800 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234464:
tuexen [Sun, 29 Apr 2012 16:26:55 +0000 (16:26 +0000)]
MFC r234464:

Whitespace changes.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234798 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234461:
tuexen [Sun, 29 Apr 2012 16:25:01 +0000 (16:25 +0000)]
MFC r234461:

Use the same pattern for mbuf logging everywhere.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234797 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234460:
tuexen [Sun, 29 Apr 2012 16:22:55 +0000 (16:22 +0000)]
MFC r234460:

Fix reported errno.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234796 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234459:
tuexen [Sun, 29 Apr 2012 16:20:29 +0000 (16:20 +0000)]
MFC r234459:

Fix a bug where we copy out more data from a mbuf chain that are
actually in it. This happens when SCTP receives an unknown chunk, which
requires the sending of an ERROR chunk, and there is no final padding but
the chunk is not 4-byte aligned.
Reported by yueting via rwatson@

git-svn-id: svn://svn.freebsd.org/base/stable/9@234794 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234296,r234297:
tuexen [Sun, 29 Apr 2012 16:16:31 +0000 (16:16 +0000)]
MFC r234296,r234297:

Bugfix: Don't send HBs on path which are not idle.
Send always HBs when in PF state.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234793 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233940:
tuexen [Sun, 29 Apr 2012 16:12:31 +0000 (16:12 +0000)]
MFC r233940:

Remove duplicate condition in if statement.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234791 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233660:
tuexen [Sun, 29 Apr 2012 16:10:24 +0000 (16:10 +0000)]
MFC r233660:

Make stream our stream reset implementation
compliant to RFC6525.
From rrs@.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234790 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233597:
tuexen [Sun, 29 Apr 2012 13:37:32 +0000 (13:37 +0000)]
MFC r233597:
Honor the net.inet.udp.checksum sysctl when using SCTP/UDP/IPv4
encapsulation.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234788 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233311:
tuexen [Sun, 29 Apr 2012 13:34:37 +0000 (13:34 +0000)]
MFC r233311:

Small cleanup of the code. No functional change (in FreeBSD kernel).

git-svn-id: svn://svn.freebsd.org/base/stable/9@234787 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233554:
bz [Sun, 29 Apr 2012 08:50:50 +0000 (08:50 +0000)]
MFC r233554:

 Export the udp_cksum sysctl for upcoming SCTP work.  Rather than always,
 SCTP will only do IPv4 UDP checksum calculation as defined by the host
 policy.  When tunneling SCTP always calculates the inner checksum already
 so not doing the outer UDP can save cycles.

 While here virtualize the variable.

 Requested by: tuexen

git-svn-id: svn://svn.freebsd.org/base/stable/9@234780 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234038
alc [Sat, 28 Apr 2012 20:34:14 +0000 (20:34 +0000)]
MFC r234038
  If a page belonging a reservation is cached, then mark the reservation so
  that it will be freed to the cache pool rather than the default pool.
  Otherwise, the cached pages within the reservation may be recycled sooner
  than necessary.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234771 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234556:
kib [Sat, 28 Apr 2012 18:46:48 +0000 (18:46 +0000)]
MFC r234556:
When MAP_STACK mapping is created, the map entry is created only to
cover the initial stack size. For MCL_WIREFUTURE maps, the subsequent
call to vm_map_wire() to wire the whole stack region fails due to
VM_MAP_WIRE_NOHOLES flag.

Use the VM_MAP_WIRE_HOLESOK to only wire mapped part of the stack.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234767 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234039
alc [Sat, 28 Apr 2012 18:43:27 +0000 (18:43 +0000)]
MFC r234039
  Fix mincore(2) so that it reports PG_CACHED pages as resident.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234766 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233097
alc [Sat, 28 Apr 2012 18:03:57 +0000 (18:03 +0000)]
MFC r233097
  With the changes over the past year to how accesses to the page's dirty
  field are synchronized, there is no need for pmap_protect() to acquire
  the page queues lock unless it is going to access the pv lists.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234765 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234554
alc [Sat, 28 Apr 2012 17:54:54 +0000 (17:54 +0000)]
MFC r234554
  Updates to the vm_page's flags no longer require the page queues lock.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234764 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232166
alc [Sat, 28 Apr 2012 17:29:08 +0000 (17:29 +0000)]
MFC r232166
  Simplify vm_mmap()'s control flow.

  Add a comment describing what vm_mmap_to_errno() does.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234763 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234540:
dim [Sat, 28 Apr 2012 09:21:43 +0000 (09:21 +0000)]
MFC r234540:

Fix the following clang warning in dpt(4):

  sys/dev/dpt/dpt_scsi.c:612:18: error: implicit truncation from 'int' to bitfield changes value from -2 to 2 [-Werror,-Wconstant-conversion]
    dpt->cache_type = DPT_CACHE_WRITEBACK;
                    ^ ~~~~~~~~~~~~~~~~~~~

by defining DPT_CACHE_WRITEBACK as 2, since dpt_softc::cache_type is an
unsigned bitfield.  No binary change.

MFC after: 1 week

git-svn-id: svn://svn.freebsd.org/base/stable/9@234755 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r228572:
dim [Sat, 28 Apr 2012 09:18:20 +0000 (09:18 +0000)]
MFC r228572:

Fix format string Z --> z, since the former is a deprecated and (in FreeBSD)
unsupported form of the latter. This change has been reviewed and accepted
in the -hackers list.

Submitted by: Alexander Best
Reviewed by: David Schulz

git-svn-id: svn://svn.freebsd.org/base/stable/9@234754 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r225941:
dim [Sat, 28 Apr 2012 09:15:01 +0000 (09:15 +0000)]
MFC r225941:
  Fix an unaligned access issue; tidy up OFDM/DS rate decoding from the PLCP.

  This fixes a panic on PPC.

  Submitted by: novel
  Obtained from: OpenBSD, sys/dev/ic/bwi.c r1.89

MFC r226181:
  Update from OpenBSD: Include 0x4402 in the bbp id mapping table used on older devices.

  http://bcm-specs.sipsolutions.net/BackPlane agrees.

  Obtained from: OpenBSD, sys/dev/ic/bwi.c r1.88

MFC r226182:
  Fix an incorrect use of sizeof().

  Obtained from: OpenBSD sys/dev/ic/bwi.c r1.87

MFC r228621:
  Fix some net80211 enum nits:
  - ic_vap_create() uses an ieee80211_opmode argument
  - ieee80211_rate2media() takes an ieee80211_phymode argument
  - ieee80211_plcp2rate() takes an ieee80211_phytype argument
  - cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
    compiler warnings

  Submitted by: arundel@

git-svn-id: svn://svn.freebsd.org/base/stable/9@234753 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 234611:
marcel [Fri, 27 Apr 2012 20:10:43 +0000 (20:10 +0000)]
MFC 234611:
Update the bugs section. We don't consider tmpfs as experimental,
though we do not claim to support all mount options equally well.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234738 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoFix several 'format string is not a literal' warnings in sysinstall.
dim [Fri, 27 Apr 2012 19:26:19 +0000 (19:26 +0000)]
Fix several 'format string is not a literal' warnings in sysinstall.

Since sysinstall does not exist anymore in head, this is a direct
commit.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234737 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234507:
dim [Fri, 27 Apr 2012 18:21:45 +0000 (18:21 +0000)]
MFC r234507:

Fix the following compilation warnings in sys/contrib/rdma/rdma_cma.c:

  sys/contrib/rdma/rdma_cma.c:1259:8: error: case value not in enumerated type 'enum iw_cm_event_status' [-Werror,-Wswitch]
    case ECONNRESET:
 ^
  @/sys/errno.h:118:20: note: expanded from macro 'ECONNRESET'
  #define ECONNRESET      54              /* Connection reset by peer */
    ^
  sys/contrib/rdma/rdma_cma.c:1263:8: error: case value not in enumerated type 'enum iw_cm_event_status' [-Werror,-Wswitch]
    case ETIMEDOUT:
 ^
  @/sys/errno.h:124:19: note: expanded from macro 'ETIMEDOUT'
  #define ETIMEDOUT       60              /* Operation timed out */
    ^
  sys/contrib/rdma/rdma_cma.c:1260:8: error: case value not in enumerated type 'enum iw_cm_event_status' [-Werror,-Wswitch]
    case ECONNREFUSED:
 ^
  @/sys/errno.h:125:22: note: expanded from macro 'ECONNREFUSED'
  #define ECONNREFUSED    61              /* Connection refused */
    ^

This is because the switch uses iw_cm_event::status, which is an enum
iw_cm_event_status, while ECONNRESET, ETIMEDOUT and ECONNREFUSED are
just plain defines from errno.h.

It looks like there is only one use of any of the enumeration values of
iw_cm_event_status, in:

  sys/contrib/rdma/rdma_iwcm.c:       if (iw_event->status == IW_CM_EVENT_STATUS_ACCEPTED) {

So messing around with the enum definitions to fix the warning seems too
disruptive; the simplest fix is to cast the argument of the switch to
int.

Reviewed by: kmacy

git-svn-id: svn://svn.freebsd.org/base/stable/9@234736 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234506:
dim [Fri, 27 Apr 2012 18:08:15 +0000 (18:08 +0000)]
MFC r234506:

Fix the following compilation warnings in nxge(4):

  sys/dev/nxge/if_nxge.c:1276:11: error: case value not in enumerated type 'xge_hal_event_e' (aka 'enum xge_hal_event_e') [-Werror,-Wswitch]
            case XGE_LL_EVENT_TRY_XMIT_AGAIN:
                 ^
  sys/dev/nxge/if_nxge.c:1289:11: error: case value not in enumerated type 'xge_hal_event_e' (aka 'enum xge_hal_event_e') [-Werror,-Wswitch]
            case XGE_LL_EVENT_DEVICE_RESETTING:
                 ^

This is because the switch uses xge_queue_item_t::event_type, which is
an enum xge_hal_event_e, while the XGE_LL_EVENT_xx values are of the
enum xge_event_e.

Since messing around with the enum definitions is too disruptive, the
simplest fix is to cast the argument of the switch to int.

Reviewed by: gnn

git-svn-id: svn://svn.freebsd.org/base/stable/9@234735 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234503:
dim [Fri, 27 Apr 2012 18:05:24 +0000 (18:05 +0000)]
MFC r234503:

Replace homegrown list implementation in sys/dev/asr/asr.c with
STAILQ().  While here, fix another clang warning about a switch which
tests an enum type for a regular integer value.

Submitted by: jhb

git-svn-id: svn://svn.freebsd.org/base/stable/9@234734 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234502:
dim [Fri, 27 Apr 2012 06:49:35 +0000 (06:49 +0000)]
MFC r234502:

After r217375, some startup objects under lib/csu are built in a special
way: first they are compiled to assembly, then some sed'ing is done on
the assembly, and lastly the assembly is compiled to an object file.

This last step is done using ${CC}, and not ${AS}, because when the
compiler is clang, it outputs directives that are too advanced for our
old gas.  So we use clang's integrated assembler instead.  (When the
compiler is gcc, it just calls gas, and nothing is different, except one
extra fork.)

However, in the .s to .o rules in lib/csu/$ARCH/Makefile, I still passed
CFLAGS to the compiler, instead of ACFLAGS, which are specifically for
compiling .s files.

In case you are using '-g' for debug info anywhere in your CFLAGS, it
causes the .s files to already contain debug information in the assembly
itself.  In the next step, the .s files are also compiled using '-g',
and if the compiler is clang, it complains: "error: input can't have
.file dwarf directives when -g is used to generate dwarf debug info for
assembly code".

Fix this by using ${ACFLAGS} for compiling the .s files instead.

Reported by: jasone

git-svn-id: svn://svn.freebsd.org/base/stable/9@234726 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232159:
gjb [Thu, 26 Apr 2012 20:22:14 +0000 (20:22 +0000)]
MFC r232159:
  Whitespace cleanup:
   o Wrap sentences on to new lines
   o Rewrap lines where possible while trying to keep the diff to a
     minimum

git-svn-id: svn://svn.freebsd.org/base/stable/9@234721 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234289:
dim [Thu, 26 Apr 2012 20:19:05 +0000 (20:19 +0000)]
MFC r234289:

Add files and directories to be cleaned up if WITHOUT_GCC is in effect
to OptionalObsoleteFiles.inc.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234720 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232157, r232158:
gjb [Thu, 26 Apr 2012 20:11:57 +0000 (20:11 +0000)]
MFC r232157, r232158:

r232157:
  Fix various typos in manual pages.

  Submitted by: amdmi3
  PR:           165431

r232158:
  Whitespace cleanup:
    o Wrap sentences on to new lines
    o Cleanup trailing whitespace

git-svn-id: svn://svn.freebsd.org/base/stable/9@234717 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r233580
jkim [Thu, 26 Apr 2012 18:16:44 +0000 (18:16 +0000)]
MFC: r233580

- Do not clobber softc when psm(4) is reintialized.
- Make INITAFTERSUSPEND flag independent of HOOKRESUME flag.
- Automatically set INITAFTERSUSPEND flag when ALPS GlidePoint is detected.
- Always probe Synaptics Touchpad.  Allow MOUSE_SYN_GETHWINFO ioctl and
automatically set INITAFTERSUSPEND flag when a supported device is detected,
regardless of "hw.psm.synaptics_support" tunable setting.
- Update psm(4) to reflect the above changes.
- Remove long-time defunct SYNCHACK flag while I am in the neighborhood.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234713 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234615:
nwhitehorn [Thu, 26 Apr 2012 14:02:39 +0000 (14:02 +0000)]
MFC r234615:
Fix copy-and-paste error in r230400 that would cause ppc64 executables
built with -fvisibility=hidden to fail to link with a message about
hidden symbol main being referenced from a DSO.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234708 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234579:
nwhitehorn [Thu, 26 Apr 2012 14:00:29 +0000 (14:00 +0000)]
MFC r234579:
Avoid a lock order reversal in pmap_extract_and_hold() from relocking
the page. This PMAP requires an additional lock besides the PMAP lock
in pmap_extract_and_hold(), which vm_page_pa_tryrelock() did not release.

Suggested by: kib

git-svn-id: svn://svn.freebsd.org/base/stable/9@234707 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234542:
nwhitehorn [Thu, 26 Apr 2012 13:59:00 +0000 (13:59 +0000)]
MFC r234542:
Organize some members of ucontext_t in the same order they are in the
trap frame. These are usually not used, and so this changes very little.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234706 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234589:
nwhitehorn [Thu, 26 Apr 2012 13:57:41 +0000 (13:57 +0000)]
MFC r234589:
Correctly specify assembler constrains for synchronization instructions.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234705 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234517:
nwhitehorn [Thu, 26 Apr 2012 13:56:38 +0000 (13:56 +0000)]
MFC r234517:
Make sure all pending operations have completed on the existing thread
before (potentially) migrating it to a different CPU.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234704 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234156:
nwhitehorn [Thu, 26 Apr 2012 13:55:15 +0000 (13:55 +0000)]
MFC r234156:
We don't need kcopy() in any of the remaining places it is used, so
remove it.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234703 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234697:
ru [Thu, 26 Apr 2012 09:14:52 +0000 (09:14 +0000)]
MFC r234697:
  Fixed a misspelling of OLD_LIBS in r232671 by pluknet@.
  (The patch in the PR 165523 had this spelled correctly.)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234698 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234692:
ae [Thu, 26 Apr 2012 05:17:25 +0000 (05:17 +0000)]
MFC r234692:
  Read backup GPT header from the last LBA only when primary GPT header and
  table aren't valid. If they are ok, use hdr_lba_alt value to read backup
  header. This will make gptboot happy when GPT used atop of some GEOM
  provider, e.g. GEOM_MIRROR.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234693 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234574
melifaro [Wed, 25 Apr 2012 09:55:34 +0000 (09:55 +0000)]
MFC r234574

Fix panic in ng_patch(4) caused by checksum flags being added to mbuf flags.

Tested by:        Maxim Ignatenko <gelraen.ua@gmail.com>
Approved by:      ae(mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234681 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234339: zfsboot: honor -q if it's present in boot.config
avg [Wed, 25 Apr 2012 07:23:35 +0000 (07:23 +0000)]
MFC r234339: zfsboot: honor -q if it's present in boot.config

git-svn-id: svn://svn.freebsd.org/base/stable/9@234679 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234338: intpm: add ATI IXP400 pci id
avg [Wed, 25 Apr 2012 07:13:16 +0000 (07:13 +0000)]
MFC r234338: intpm: add ATI IXP400 pci id

PR: kern/136762

git-svn-id: svn://svn.freebsd.org/base/stable/9@234677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge r233167 from head:
glebius [Wed, 25 Apr 2012 07:09:02 +0000 (07:09 +0000)]
Merge r233167 from head:
  Rotate auth.log and messages at the beginning of a year. Otherwise,
  daily security checks 800.loginfail and 900.tcpwrap may produce
  false positive alerts.

PR: 142467, 165331

git-svn-id: svn://svn.freebsd.org/base/stable/9@234675 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge r233257, r233258 from head:
glebius [Wed, 25 Apr 2012 07:04:48 +0000 (07:04 +0000)]
Merge r233257, r233258 from head:
  Don't run through time checks when entry is definitely oversized. This
  leads to newsyslog rotating on (size OR time) if both are specified.

  Fix a sentence in a paragraph that describes time and interval based
  trimming. This sentence vaguely can be interpreted as if it was speaking
  about time and size interaction, while it wasn't about it.

PR: 100018, 160432

git-svn-id: svn://svn.freebsd.org/base/stable/9@234674 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234208: add actual interrupt counters to back ipi_invlcache_counts
avg [Wed, 25 Apr 2012 06:52:26 +0000 (06:52 +0000)]
MFC r234208: add actual interrupt counters to back ipi_invlcache_counts

git-svn-id: svn://svn.freebsd.org/base/stable/9@234673 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234207: bump INTRCNT_COUNT values to reflect actual numbers of IPI counters
avg [Wed, 25 Apr 2012 06:43:40 +0000 (06:43 +0000)]
MFC r234207: bump INTRCNT_COUNT values to reflect actual numbers of IPI counters

git-svn-id: svn://svn.freebsd.org/base/stable/9@234671 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234414:
mav [Wed, 25 Apr 2012 06:18:49 +0000 (06:18 +0000)]
MFC r234414:
Alike to SCSI make adaclose() to not return error if device gone.
This fixes KASSERT panic inside GEOM if kernel built with INVARIANTS.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234416:
kib [Wed, 25 Apr 2012 04:53:04 +0000 (04:53 +0000)]
MFC r234416:
Fix string buffer overflow when preparing the line of output.

PR: bin/161739

git-svn-id: svn://svn.freebsd.org/base/stable/9@234667 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232317:
trociny [Tue, 24 Apr 2012 19:08:40 +0000 (19:08 +0000)]
MFC r232317:

Introduce VOP_UNP_BIND(), VOP_UNP_CONNECT(), and VOP_UNP_DETACH()
operations for setting and accessing vnode's v_socket field.

The operations are necessary to implement proper unix socket handling
on layered file systems like nullfs(5).

This change fixes the long standing issue with nullfs(5) being in that
unix sockets did not work between lower and upper layers: if we bound
to a socket on the lower layer we could connect only to the lower
path; if we bound to the upper layer we could connect only to the
upper path. The new behavior is one can connect to both the lower and
the upper paths regardless what layer path one binds to.

PR: kern/51583, kern/159663
Suggested by: kib
Reviewed by: arch

git-svn-id: svn://svn.freebsd.org/base/stable/9@234660 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r232702
pho [Tue, 24 Apr 2012 19:00:42 +0000 (19:00 +0000)]
MFC: r232702

Free up allocated memory used by posix_fadvise(2).

git-svn-id: svn://svn.freebsd.org/base/stable/9@234659 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234376:
mav [Tue, 24 Apr 2012 07:27:56 +0000 (07:27 +0000)]
MFC r234376:
Add some more SCSI mode pages from SPC-4 spec.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234638 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234529:
das [Tue, 24 Apr 2012 03:59:21 +0000 (03:59 +0000)]
MFC r234529:
  Ensure that the {,v}swprintf functions always null-terminate the
  output string, even if an encoding error or malloc failure occurs.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234635 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234528, r234536:
das [Tue, 24 Apr 2012 03:56:45 +0000 (03:56 +0000)]
MFC r234528, r234536:
  Fix an infinite loop in fputws().

git-svn-id: svn://svn.freebsd.org/base/stable/9@234632 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233160:
bjk [Tue, 24 Apr 2012 03:27:27 +0000 (03:27 +0000)]
MFC r233160:
    Expound a bit more about the system maximum number of FIBs,
    how it may be set, and current limitations on the value.

PR: docs/157453
Approved by: hrs (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234628 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234132:
eadler [Mon, 23 Apr 2012 22:37:48 +0000 (22:37 +0000)]
MFC r234132:
Make the item numbers match the crypt magic number

PR: kern/161553
Approved by: cperciva (implicit)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234622 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233298:
pluknet [Mon, 23 Apr 2012 12:18:38 +0000 (12:18 +0000)]
MFC r233298:
 Garbage collect defunct nlist(3) symbols.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234602 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232865, r232868, r233478
melifaro [Mon, 23 Apr 2012 07:15:15 +0000 (07:15 +0000)]
MFC r232865, r232868, r233478

- Add ipfw eXtended tables permitting radix to be used for any kind of keys.
- Add support for IPv6 and interface extended tables
- Make number of tables to be changed in runtime in range 0..65534.
- Use IP_FW3 opcode for all new extended table cmds

No ABI changes are introduced. Old userland will see valid tables for
IPv4 tables and no entries otherwise. Flush works for any table.

IP_FW3 socket option is used to encapsulate all new opcodes:
 /* IP_FW3 header/opcodes */
 typedef struct _ip_fw3_opheader {
        uint16_t opcode;        /* Operation opcode */
        uint16_t reserved[3];   /* Align to 64-bit boundary */
 } ip_fw3_opheader;

New opcodes added:
 IP_FW_TABLE_XADD, IP_FW_TABLE_XDEL, IP_FW_TABLE_XGETSIZE, IP_FW_TABLE_XLIST

ipfw(8) table argument parsing behavior is changed:
 'ipfw table 999 add host' now assumes 'host' to be interface name instead of
 hostname.

New tunable:
 net.inet.ip.fw.tables_max controls number of table supported by ipfw in given
 VNET instance. 128 is still the default value.

Sysctl change:
  net.inet.ip.fw.tables_max is now read-write.

New syntax:
ipfw add skipto tablearg ip from any to any via table(42) in
ipfw add skipto tablearg ip from any to any via table(4242) out

This is a bit hackish, special interface name '\1' is used to signal interface
table number is passed in p.glob field.

Sponsored by Yandex LLC

Approved by:        kib(mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234597 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234121:
yongari [Mon, 23 Apr 2012 03:38:40 +0000 (03:38 +0000)]
MFC r234121:
  Back out r228476.
  r228476 fixed superfluous link UP/DOWN messages but broke IPMI
  access during boot.  It's not clear why r228476 breaks IPMI and
  should be revisited.

  Reported by: Paul Guyot <paulguyot <> ieee dot org >

git-svn-id: svn://svn.freebsd.org/base/stable/9@234593 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233387:
bschmidt [Sun, 22 Apr 2012 09:19:10 +0000 (09:19 +0000)]
MFC r233387:
Use suspend/resume methods provided by net80211. This ensures that the
appropriate state handling takes place, not doing so results in the
device doing nothing until manual intervention.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234570 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: revision 232784
nyan [Sun, 22 Apr 2012 03:53:11 +0000 (03:53 +0000)]
MFC: revision 232784

  MFi386: revisions 232570 and 232754

  Fix boot2 to handle boot config files that only contain a custom path to
  a loader or kernel.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234562 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r227730:
raj [Sat, 21 Apr 2012 20:22:02 +0000 (20:22 +0000)]
MFC r227730:

 Initial version of cesa(4) driver for Marvell crypto engine and security
 accelerator.

 The following algorithms and schemes are supported:
  - 3DES, AES, DES
  - MD5, SHA1

 Obtained from: Semihalf
 Written by: Piotr Ziecik

git-svn-id: svn://svn.freebsd.org/base/stable/9@234559 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233230, r233323:
raj [Sat, 21 Apr 2012 20:10:26 +0000 (20:10 +0000)]
MFC r233230, r233323:

Improve device tree blob (DTB) handling in loader(8).

 Enable using the statically embedded blob from the kernel, if present. The
 KLD loaded DTB takes precedence, but they are both recognized and handled in
 the same way.

Improve FDT handling in loader(8) and make it more robust.

 o Fix buffer overflows when using a long property body in node paths.
 o Fix loop end condition when iterating through the symbol table.
 o Better error handling during node modification, better problem reporting.
 o Eliminate build time warnings.

Submitted by:   Lukasz Wojcik
Obtained from:  Semihalf

git-svn-id: svn://svn.freebsd.org/base/stable/9@234558 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r232921:
melifaro [Sat, 21 Apr 2012 19:22:53 +0000 (19:22 +0000)]
MFC r232921:

Use rt_numfibs variable instead of compile-time RT_NUMFIBS.

Approved by:    kib(mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234557 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229930
melifaro [Sat, 21 Apr 2012 18:12:24 +0000 (18:12 +0000)]
MFC r229930

Add setsockopt(2) example to ng_ksocket(4).
While here, fix formatting a bit

Approved by:     ae(mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234552 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233973:
das [Sat, 21 Apr 2012 07:00:39 +0000 (07:00 +0000)]
MFC r233973:
  Fix bugs in remquo{,f,l}.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234535 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234115:
nwhitehorn [Sat, 21 Apr 2012 00:26:03 +0000 (00:26 +0000)]
MFC r234115:
Do not restore the register holding the TLS pointer when doing various
usermode context switches (long jumps and ucontext operations). If these
are used across threads, multiple threads can end up with the same TLS base.
Madness will then result.

This makes behavior on PPC match that on x86 systems and on Linux.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r234303
davide [Fri, 20 Apr 2012 22:43:04 +0000 (22:43 +0000)]
MFC: r234303

Fix a typo.

Approved by: gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234514 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC of r227310:
rmh [Fri, 20 Apr 2012 22:14:26 +0000 (22:14 +0000)]
MFC of r227310:

Don astbestos garment and remove the warning about TMPFS being experimental
-- highly experimental even. So far the closest to a bug in TMPFS that people
have gotten to relates to how ZFS can take away from the memory that TMPFS
needs. One can argue that such is not a bug in TMPFS. Irrespective, even if
there is a bug here and there in TMPFS, it's not in our own advantage to
scare people away from using TMPFS. I for one have been using it, even with
ZFS, very successfully.

Reviewed by: marcel

git-svn-id: svn://svn.freebsd.org/base/stable/9@234511 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r233045, r234302
davide [Fri, 20 Apr 2012 21:40:31 +0000 (21:40 +0000)]
MFC: r233045, r234302

r233045:
Add rudimentary profiling of the hash table used in the umtx code to
hold active lock queues.

r234302:
Fix some style bugs introduced in a previous commit (r233045)

Approved by: gnn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@234505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: 234234
gnn [Fri, 20 Apr 2012 16:20:16 +0000 (16:20 +0000)]
MFC: 234234

Change SIGUSR1 to SIGTHR to properly wake up a process that is being
traced.  The use of SIGUSR1 caused traced processes (those attached to
with dtrace -p) to exit when dtrace exited.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r234247
marius [Fri, 20 Apr 2012 13:47:22 +0000 (13:47 +0000)]
MFC: r234247

Merge from x86:

r233961:

Fix interrupt load balancing regression, introduced in revision
222813, that left all un-pinned interrupts assigned to CPU 0.
In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized
the "intr_cpus" cpuset to only contain CPU0.

This initialization is too late and nullifies the results of calls
to the intr_add_cpu() that occur much earlier in the boot process.

r234074 (partial):

The BSP is not added to the mask of valid target CPUs for interrupts.
Fix this by adding the BSP as an interrupt target directly in

r234105:

Fix !SMP build after r234074.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234490 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233949,233957,233964,234149,234155:
nwhitehorn [Fri, 20 Apr 2012 00:45:23 +0000 (00:45 +0000)]
MFC r233949,233957,233964,234149,234155:
More PMAP concurrency and performance improvements by only flushing icaches
when needed and executing ptesync only when architecturally required.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234476 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC of 234158:
mckusick [Thu, 19 Apr 2012 22:42:28 +0000 (22:42 +0000)]
MFC of 234158:

Export vinactive() from kern/vfs_subr.c (e.g., make it no longer
static and declare its prototype in sys/vnode.h) so that it can be
called from process_deferred_inactive() (in ufs/ffs/ffs_snapshot.c)
instead of the body of vinactive() being cut and pasted into
process_deferred_inactive().

Reviewed by: kib
MFC after:   2 weeks

git-svn-id: svn://svn.freebsd.org/base/stable/9@234473 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC of 234157:
mckusick [Thu, 19 Apr 2012 22:28:42 +0000 (22:28 +0000)]
MFC of 234157:

Whitespace cleanup.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234471 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC of 233817:
mckusick [Thu, 19 Apr 2012 22:22:21 +0000 (22:22 +0000)]
MFC of 233817:

A file cannot be deallocated until its last name has been removed
and it is no longer referenced by a user process. The inode for a
file whose name has been removed, but is still referenced at the
time of a crash will still be allocated in the filesystem, but will
have no references (e.g., they will have no names referencing them
from any directory).

With traditional soft updates these unreferenced inodes will be
found and reclaimed when the background fsck is run. When using
journaled soft updates, the kernel must keep track of these inodes
so that it can find and reclaim them during the cleanup process.
Their existence cannot be stored in the journal as the journal only
handles short-term events, and they may persist for days. So, they
are tracked by keeping them in a linked list whose head pointer is
stored in the superblock. The journal tracks them only until their
linked list pointers have been commited to disk. Part of the cleanup
process involves traversing the list of unreferenced inodes and
reclaiming them.

This bug was triggered when confusion arose in the commit steps
of keeping the unreferenced-inode linked list coherent on disk.
Notably, a race between the link() system call adding a link-count
to a file and the unlink() system call removing a link-count to
the file. Here if the unlink() ran after link() had looked up
the file but before link() had incremented the link-count of the
file, the file's link-count would drop to zero before the link()
incremented it back up to one. If the file was referenced by a
user process, the first transition through zero made it appear
that it should be added to the unreferenced-inode list when in
fact it should not have been added. If the new name created by
link() was deleted within a few seconds (with the file still
referenced by a user process) it would legitimately be a candidate
for addition to the unreferenced-inode list. The result was that
there were two attempts to add the same inode to the unreferenced-inode
list which scrambled the unreferenced-inode list's pointers leading
to a panic. The fix is to detect and avoid the false attempt at
adding it to the unreferenced-inode list by having the link()
system call check to see if the link count is zero before it
increments it. If it is, the link() fails with ENOENT (showing that
it has failed the link()/unlink() race).

While tracking down this bug, we have added additional assertions
to detect the problem sooner and also simplified some of the code.

Reported by:      Kirk Russell
Fix submitted by: Jeff Roberson
Tested by:        Peter Holm
PR:               kern/159971

git-svn-id: svn://svn.freebsd.org/base/stable/9@234470 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFV r234164/MFC r234165:
dougb [Thu, 19 Apr 2012 20:44:40 +0000 (20:44 +0000)]
MFV r234164/MFC r234165:

The BIND 9.8.2 tarball was re-rolled to remove 9.8.1 release notes.
This change was noticed by ISC at:

https://lists.isc.org/pipermail/bind-users/2012-April/087345.html

and verified by me both by comparing the contents of the old and new
distfiles and by verifying the PGP signature on the new distfile.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234468 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r234350
jkim [Thu, 19 Apr 2012 20:11:43 +0000 (20:11 +0000)]
MFC: r234350

- When interrupt is not requested for VM86 call, make a fake exit point and
push the address onto stack as we do for INTn emulation.  This avoids stack
underflow when we encounter RETF instruction in VM86 mode.  Lack of this
exit point actually caused page fault in VM86 mode with VESA module when we
resume from suspend state.
- Remove unnecessary CLI and STI instructions from BIOS interrupt emulation.
INTn and IRET must be able to emulate the flag correctly.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234467 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC of 233627, 234024, 234025, and 234026
mckusick [Thu, 19 Apr 2012 18:03:24 +0000 (18:03 +0000)]
MFC of 233627, 234024, 234025, and 234026

Restore per mount-point counts of synchronous and asynchronous
reads and writes associated with UFS and MSDOS filesystems.

MFS 233627:
Keep track of the mount point associated with a special device
to enable the collection of counts of synchronous and asynchronous
reads and writes for its associated filesystem. The counts are
displayed using `mount -v'.

Ensure that buffers used for paging indicate the vnode from
which they are operating so that counts of paging I/O operations
from the filesystem are collected.

This checkin only adds the setting of the mount point for the
UFS/FFS filesystem, but it would be trivial to add the setting
and clearing of the mount point at filesystem mount/unmount
time for other filesystems too.

Reviewed by: kib

MFC 234024:
Drop an unnecessary setting of si_mountpt when updating a UFS mount point.
Clearly it must have been set when the mount was done.

Reviewed by: kib

MFC 234025:
Add I/O accounting to msdos filesystem.

Suggested and reviewed by: kib

MFC 234026:
Expand locking around identification of filesystem mount point when
accounting for I/O counts at completion of I/O operation. Also switch
from using global devmtx to vnode mutex to reduce contention.

Suggested and reviewed by: kib

git-svn-id: svn://svn.freebsd.org/base/stable/9@234466 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234172:
kib [Thu, 19 Apr 2012 10:36:23 +0000 (10:36 +0000)]
MFC r234172:
Add thread-private flag to indicate that error value is already placed
in td_errno. Flag is supposed to be used by syscalls returning
EJUSTRETURN because errno was already placed into the usermode frame
by a call to set_syscall_retval(9). Both ktrace and dtrace get errno
value from td_errno if the flag is set.

Use the flag to fix sigsuspend(2) error return ktrace records.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234455 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234170:
kib [Thu, 19 Apr 2012 10:17:28 +0000 (10:17 +0000)]
MFC r234170:
Propagate the current state of rtld_bind_lock to dlopen_object() calls
through the filter loading call chain. This fixes attempts to
write-lock the already locked rtld_bind_lock when filter loading is
initiated by relocation of dlopening dso.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234454 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234336:
mm [Thu, 19 Apr 2012 07:43:28 +0000 (07:43 +0000)]
MFC r234336:
Fix typo miror -> mirror

Reported by: Glen Barber <gjb@FreeBSD.org>

git-svn-id: svn://svn.freebsd.org/base/stable/9@234452 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r234058:
dim [Wed, 18 Apr 2012 20:32:07 +0000 (20:32 +0000)]
MFC r234058:
  In kdump's mkioctls script, use '${CPP}' instead of hardcodedly using
  'gcc -E'.  This fixes building when WITH_CLANG_IS_CC is in effect.

  Report by: Niclas Zeising <zeising@daemonic.se>

MFC r234060:
  Since truss also uses kdump's mkioctls script, pass the value of ${CPP}
  there too, similar to r234058.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234444 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230778
ambrisko [Wed, 18 Apr 2012 19:15:59 +0000 (19:15 +0000)]
MFC r230778
When detaching an AIO or LIO requests grab the lock and tell knlist_remove
that we have the lock now.  This cleans up a locking panic ASSERT when
knlist_empty is called without a lock when INVARIANTS etc. are turned.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234438 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r233713
ambrisko [Wed, 18 Apr 2012 18:58:18 +0000 (18:58 +0000)]
MFC r233713
Remove the magic mfi_array is 288 bytes and just use the
sizeof the array since it is not 288 bytes.

Change reporting of a "SYSTEM" disk to "JBOD" to match
LSI MegaCli and firmware reporting.

This means that mfiutil command to "create jbod" is now a
little confusing since a RAID per drive is not really what
LSI defines JBOD to be.  This should be fixed in the future
and support added to really create LSI JBOD and enable that
feature on cards that support it.

git-svn-id: svn://svn.freebsd.org/base/stable/9@234433 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f