160531 Commits

Author SHA1 Message Date
bz
0b955144bd MFC r206989:
Avoid memory access after free.  Use the (shortend) copy for the
  ipsec mtu lookup as well.

PR:		kern/145736
Submitted by:	Peter Molnar (peter molnar.cc)
2010-05-02 15:55:29 +00:00
jilles
0ec9cd62c7 MFC r207189: symlink(7): Add lpathconf(2) and *at system calls. 2010-05-02 13:36:23 +00:00
mav
36c08d5066 MFC r207222:
Move PI_TAG_ABLE check from ada driver to ATA XPT.
2010-05-02 12:50:29 +00:00
mav
f162992d8b MFC r206652:
Explicitly enable PCI busmastering on attach.
Now SiI3124 with siis(4) successfully works on sparc64 (SunBlade 100).
2010-05-02 12:45:22 +00:00
mav
3ec514bd21 MFC r205358:
Enable MSI by default for SiI3124.
2010-05-02 12:44:11 +00:00
jilles
45a3a1cde7 MFC r207188: symlink(7): The ownership of symlinks is used by the system,
in at least three ways, so do not say it is ignored:
* who may delete/rename a symlink in a sticky directory
* who may do lchflags(2)/lchown(2)/lchmod(2)
* whose inode quota is charged
2010-05-02 12:43:18 +00:00
mav
a4ca641c46 MFC r207221:
Mark ATA channel as idle on timeout in non-ATA_CAM mode.
This should fix possible duplicate request completion.
2010-05-02 12:40:54 +00:00
mav
492b3028cd MFC r206604:
For early ALI chips do not announce I/O sizes that require unsupported
48bit DMA commands.
2010-05-02 12:39:29 +00:00
jilles
49c4a03fe8 MFC r207187: kvm(3): Mention that some of the functions use sysctl(3)
instead of kmem.

Additionally, because of sysctl(3) use (which is generally good), behaviour
for crash dumps differs slightly from behaviour for live kernels and this
will probably never be fixed entirely, so weaken that claim.
2010-05-02 12:38:59 +00:00
imp
60f42d7ce3 Comment on new config version that's now required for amd64 and ia64.
Comment on the confusing error message from Apr 17th-May 2nd generated
by config(8) as well.
2010-05-02 06:34:13 +00:00
imp
6231a81f24 Revert 207494: it was only for testing purposes. 2010-05-02 06:24:17 +00:00
imp
822c9ce183 Ooops. Bump the version to 600009, not 600008. 2010-05-02 06:23:15 +00:00
imp
01384213a7 Move to the new way of specifying compat options. The backs out the
FOO = BAR form, in favor of listing the mapping in a separate file
for more compatibility with older versions of config.
2010-05-02 06:20:42 +00:00
imp
56a6fa1b61 MFC r207265:
Require the option that's mapped be listed in the options file.  This
  will allow people with old config options to either have it just work
  (if config is new enough), or get a version error (if their config is
  about 7.0 or newer) rather than getting a cryptic error about
  duplicated options in the options file, or getting an error about an
  unknown option, at which point they'd update their config file only to
  learn they need a new config, only to learn they didn't really need to
  update their config file...  All this because our version checking was
  in the wrong place for the past decade...

  # hopefully this is the last change, and we'll be able to config with an
  # 8.0 GENERIC file on stable/8 after I merge this change and add the
  # compat options.
2010-05-02 06:18:57 +00:00
imp
2e57b92d26 MFC r207263:
Redo how we add compat options so as to be compatible with old
  versions of config.  Remove support for the syntax OLD = NEW form the
  options file, and instead have a new file $S/conf/options-compat.
  This file will be parsed as OLD NEW on each line.  Bump version of
  config.  Since nothing in -current ever used this, there's no hazards
  for current users, so I'm not bumping the version in the
  Makefiles.$MACHINE.  No need, really, for this version bump in
  -current, but this was introduced into -stable before I realized the
  version check was ineffective there, so the verison bump doesn't hurt
  here and keeps the two branches in sync, versionwise, after the MFC.
2010-05-02 06:18:08 +00:00
imp
31fdf3079c MFC r207260:
Move checking the version up from Makefile generation to just after
  we've parsed the config file.  Makefile generation is too late if
  we've introduce changes to the syntax of the metafiles to warn about
  version skew, since we have to try to parse them and we get an parse
  error that's rather baffling to the user rather than a 'your config is
  too old, upgrade' which we should get.

  We have to defer doing it until after we've read the user's config
  file because we define machinename there.  The version required to
  compile the kernel is encoded in Makefile.machinename.  There's no
  real reason for this to be the case, but changing it now would
  introduce some logistical issues that I'd rather avoid for the moment.
  I intend to revisit this if we're still using config in FreeBSD 10.

  This also means that we cannot introduce any config metafile changes
  that result in a syntax error or other error for the user until 9.0 is
  released.  Otherwise, we break the upgrade path, or at least reduce
  the usefulness of the error messages we generate.

  # This implies that the config file option mapping will need to be redone.
2010-05-02 06:14:36 +00:00
weongyo
a1bb956efc MFC r207176:
ifp->if_ipackets++ when RX packet interrupts are occurred.
2010-05-01 23:25:53 +00:00
pjd
42ba5671e3 MFC r207070,r207343,r207345,r207347,r207348,r207371,r207372,r207390:
r207070:

Fix compilation with WITHOUT_CRYPT or WITHOUT_OPENSSL options.

Reported by:	Andrei V. Lavreniyuk <andy.lavr@reactor-xg.kiev.ua>

r207343:

Don't assume that "resource" property is in metadata.

Reported by:	Mikolaj Golub <to.my.trociny@gmail.com>

r207345:

Use WEXITSTATUS() to obtain real exit code.

r207347:

Mark temporary issues as such.

r207348:

Restart worker thread only if the problem was temporary.
In case of persistent problem we don't want to loop forever.

r207371:

Fix a problem where hastd will stuck in recv(2) after sending request to
secondary, which died between send(2) and recv(2). Do it by adding timeout
to recv(2) for primary incoming and outgoing sockets and secondary outgoing
socket.

Reported by:	Mikolaj Golub <to.my.trociny@gmail.com>
Tested by:	Mikolaj Golub <to.my.trociny@gmail.com>

r207372:

- Check if the worker process was killed by signal and restart it.
- Improve logging.

Pointed out by:	Garrett Cooper <yanefbsd@gmail.com>

r207390:

Default connection timeout is way too long. To make it shorter we have to
make socket non-blocking, connect() and if we get EINPROGRESS, we have to
wait using select(). Very complex, but I know no other way to define
connection timeout for a given socket.

Reported by:	hiroshi@soupacific.com
2010-05-01 19:16:08 +00:00
pjd
ae4fc16b95 MFC r207070:
Fix compilation with WITHOUT_CRYPT or WITHOUT_OPENSSL options.

Reported by:	Andrei V. Lavreniyuk <andy.lavr@reactor-xg.kiev.ua>
2010-05-01 19:12:37 +00:00
pjd
3bcbc02a08 MFC r207068,r207334:
r207068:

Allow to modify directory's content even if the ZFS_NOUNLINK (SF_NOUNLINK,
sunlnk) flag is set. We only deny dirctory's removal or rename.

PR:		kern/143343
Reported by:	marck

r207334:

Backport fix for 'zfs_znode_dmu_init: existing znode for dbuf' panic from OpenSolaris.

PR:		kern/144402
Reported by:	Alex Bakhtin <alex.bakhtin@gmail.com>
Tested by:	Alex Bakhtin <alex.bakhtin@gmail.com>
Obtained from:	OpenSolaris, Bug ID 6895088
2010-05-01 19:00:33 +00:00
jilles
da41f34c69 MFC r207168: builtin(1): Add missing escaping for !, . and : in the table.
This caused these commands to look differently (not bold) from the other
commands in the table (bold).
2010-05-01 14:49:20 +00:00
jilles
33646a4f3e MFC r207166: builtin(1): Mention [ sh builtin. 2010-05-01 14:41:37 +00:00
jilles
8f3ade4bcf MFC r207153: stat: Allow -f %Sf to display the file flags symbolically.
PR:		124349
2010-05-01 14:36:04 +00:00
jilles
f8b7614cce MFC r207021: ln: Allow a trailing slash when creating a link to a directory.
In the 'ln source... directory' synopsis, the basename of each source
determines the name of the created link. Determine this using basename(3)
instead of strrchr(..., '/') which is incorrect if the pathname ends in a
slash.

PR:		121568
2010-05-01 14:33:26 +00:00
jilles
2a43985ae6 MFC r206773: ln: Do not delete a file by hardlinking it to itself.
Two pathnames refer to the same directory entry iff the directories match
and the final components' names match.

Example: (assuming file1 is an existing file)
  ln -f file1 file1
This now fails while leaving file1 intact. It used to delete file1 and then
complain it cannot be linked because it is gone.

With -i, this error is detected before the question is asked.
2010-05-01 14:29:33 +00:00
rmacklem
3ff47db4d9 MFC: r207170
An NFSv4 server will reply NFSERR_GRACE for non-recovery RPCs
during the grace period after startup. This grace period must
be at least the lease duration, which is typically 1-2 minutes.
It seems prudent for the experimental NFS client to wait a few
seconds before retrying such an RPC, so that the server isn't
flooded with non-recovery RPCs during recovery. This patch adds
an argument to nfs_catnap() to implement a 5 second delay
for this case.
2010-05-01 00:50:51 +00:00
bschmidt
84c319279e Remove 2 empty files, leftovers from previous MFCs.
Approved by:	rpaulo (mentor)
2010-04-30 18:39:07 +00:00
bschmidt
c8089716b6 MFC r206443-206446, 206474-206477, 207001
r206443:
Small whitespace cleanup.

r206444 [1]:
- Rename bluetooth coexistence flags, no binary change.
- Enable DC calibration and crystal calibration on Centrino Advanced-N
  6250 parts.
- Workaround for a HW bug (does not affect 4965AGN) that may sporadically
  affect latency under some rare circumstances. From a similar commit to
  iwlwifi.
- Update sensitivity settings for 5000 series to workaround a performance
  bug in the DSP (1000 is not affected so we keep the old values for 5000).
- Update sensitivity settings for 6000 series.
- Set differential gains on 6250 too (but use a 1.0 factor, not 1.5).
- Init OFDM sensitivity with min value (which depends on the chip)
  instead of hardcoding it to 90.
- Read calibration version from ROM and set IWN_GP_DRIVER_CALIB_VER6
  bit on 6x50 if version >= 6.

r206445 [2]:
iwn4965_set_txpower() uses maxpwr from EEPROM to calculate the power to
set, it make sense to actually initialize that array.  This fixes some
issues with 4965 adapters where the TX power is crucial.

This got lost somewhere while merging with the OpenBSD code.

r206446:
Update firmware for the 6000 series Intel cards to version 9.193.4.1.

r206474:
Add some missing protoypes.

r206475:
iwn5000_reset_sched() is not used; #ifdef it.

r206476:
Hook ieee80211_media_change() to ieee80211_vap_attach().

r206477:
Declare all functions as static.

r207001 [3]:
Use correct bus_dma_tag_t for TX frames.

Approved by:	rpaulo (mentor)
Obtained from:	Openbsd [1], [2]
Reported by:	Andreas Nilsson <andrnils at gmail.com> [3]
2010-04-30 18:13:11 +00:00
bschmidt
2e0405635a MFC r206763-206767:
r206763:
Fix comment about ipw_assoc and remove some whitespaces; no functional
changes.

r206764:
Pass correct RSSI to ieee80211_input*().

r206765:
- Make ipw usable again by moving directly into ASSOC state.
- No need to manually switch to RUN state, assoc response takes care
  of that.

r206766:
Use iv_appie_wpa, with this commit WPA works again.

r206767:
Remove IPW_LOCK_DECL and fix various LORs.

Approved by:	rpaulo (mentor)
2010-04-30 17:08:27 +00:00
rmacklem
e7d6f4713b MFC: r207082
When the experimental NFS client is handling an NFSv4 server reboot
with delegations enabled, the recovery could fail if the renew
thread is trying to return a delegation, since it will not do the
recovery. This patch fixes the above by having nfscl_recalldeleg()
fail with the I/O operations returning EIO, so that they will be
attempted later. Most of the patch consists of adding an argument
to various functions to indicate the delegation recall case where
this needs to be done.
2010-04-29 23:48:09 +00:00
thompsa
e5f1285e7a MFC r207080
Use a more obvious prefix for the USB control (endpoint 0) transfers rather
 than default_*.
2010-04-29 22:49:21 +00:00
thompsa
454602a9ae MFC r207079
Properly name the sxlocks, mutexes and condvars.
2010-04-29 22:48:19 +00:00
thompsa
4ad8d144a3 MFC r207078
Use SX_DUPOK rather than making the string unique.
2010-04-29 22:47:01 +00:00
thompsa
ef43ecae04 MFC r207077
Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had
 the illusion of a tunable setting but was always turned on regardless.
2010-04-29 22:44:04 +00:00
thompsa
c4a3a58edd MFC r207020, r207027, r207072.
Change usb devd events from fake attach to a notify. The ugen device is not a
 proper device_t so it faked the devctl event to appear like one, this is now a
 notify which allows more information to be passed.

 We notify for both the device attach/detach and for each usb interface. A devd
 rule can now match on the interface properties, including composite devices
 which may have a uvideo interface and also usound and possibly uhid too.

 An example to match a umass device with a scsi subclass and BBB protocol would be

 notify 100 {
 	match "system"          "USB";
 	match "subsystem"       "INTERFACE";
 	match "type"            "ATTACH";
 	match "intclass"        "0x08";
 	match "intsubclass"     "0x06";
 	match "intprotocol"     "0x50";
 	action ...
 };

 The old attach devctl event has been retained for the moment to make merging to
 8.1 easier. This was never compatible with 7.x or earlier due to the ugen regex
 change needed.

 Document the new USB notification types.
2010-04-29 22:40:12 +00:00
mjacob
fa60432685 This is an MFC of 205932.
nit: xpt_bus_deregister has to be called with the sim lock held.
2010-04-29 19:11:25 +00:00
mjacob
ccc1f7fced This is an MFC of 205847
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).
2010-04-29 19:06:43 +00:00
delphij
fcff1c0ce3 MFC r205938:
Sync with OpenBSD:
 - avoid coredump when there's only one token on a line;
 - Use calloc();
 - Remove a line inherited from example mdoc.

Obtained from:  OpenBSD
2010-04-29 00:28:34 +00:00
jfv
a5107a3ecf Only enable MAGIC WOL by default, MCAST causes
systems to just wakeup immediately in many
environments.
2010-04-28 18:28:08 +00:00
rpaulo
f038d069e2 MFC r206617:
Make this code a little more portable by wrapping the mtx calls
  into macros.
2010-04-28 15:15:06 +00:00
kib
79c3d79534 MFC r207008:
Provide compat32 shims for kinfo_proc sysctl.

MFC r207016:
Fix typo.
2010-04-28 10:03:54 +00:00
kib
32a0d07245 MFC r207007:
Extract the code to copy-out struct rusage32 from struct rusage
into the new function.
2010-04-28 09:59:28 +00:00
delphij
248d9cd26d MFC r206637:
When an underlying ioctl(2) handler returns an error, our ioctl(2)
interface considers that it hits a fatal error, and will not copyout
the request structure back for _IOW and _IOWR ioctls, keeping them
untouched.

The previous implementation of the SIOCGIFDESCR ioctl intends to
feed the buffer length back to userland.  However, if we return
an error, the feedback would be defeated and ifconfig(8) would
trap into an infinite loop.

This commit changes SIOCGIFDESCR to set buffer field to NULL to
indicate the previous ENAMETOOLONG case.

Reported by:	bschmidt
2010-04-28 00:49:24 +00:00
gavin
f74ef765d2 Merge r204418 from head (original commit by antoine)
Add files moved in r203976 and r207292 to ObsoleteFiles.inc

Requested by:	Alex Kozlov <spam rm-rf.kiev.ua>
Merge OK'd by:	antoine
2010-04-27 20:51:50 +00:00
gavin
46c58e7c76 Merge r203692 from head:
Kernel modules for these drivers are installed on all platforms, so
  install the man pages on all platforms too.
2010-04-27 20:18:54 +00:00
gallatin
54971ffe88 MFC 206662: Cleanup if_media handling in mxge(4) 2010-04-27 15:38:58 +00:00
bms
4ce0f3b585 MFC 206452:
Fix a few issues related to the legacy 4.4 BSD multicast APIs.

  IPv4 addresses can and do change during normal operation. Testing by
  pfSense developers exposed an issue where OpenOSPFD was using the IPv4
  address to leave the OSPF link-scope multicast groups on a dynamic
  OpenVPN tun interface, rather than using RFC 3678 with the interface
  index, which won't be raced when the interface's addresses change.

  In inp_join_group():
   If we are already a member of an ASM group, and IP_ADD_MEMBERSHIP or
   MCAST_JOIN_GROUP ioctls are re-issued, return EADDRINUSE as per the
   legacy 4.4BSD multicast API. This bends RFC 3678 slightly, but does
   not violate POLA for apps using the old API.
   It also stops us falling through to kicking IGMP state transactions
   in what is otherwise a no-op case.
   [This has already been dealt with in HEAD, but make it explicit before
    we MFC the change to 8.]

  In inp_leave_group():
   Fix a bogus conditional.
   Move the ifp null check to ioctls MCAST_LEAVE* in the switch..case
   where it actually belongs.
   If an interface was specified, by primary IPv4 address, for ioctl
   IP_DROP_MEMBERSHIP or MCAST_LEAVE_GROUP (an ASM full leave operation),
   then and only then should we look up the ifp from the IPv4 address in
   mreqs.imr_interface.
   If not, we fall through to imo_match_group() as before, but only in
   the IP_DROP_MEMBERSHIP case.

  With these changes, the legacy 4.4BSD multicast API idempotence should
  be mostly preserved in the SSM enabled IPv4 stack.

  [Note: this is not a straight svn merge as head and 8 differ slightly]

Found by:	ermal (with pfSense)
2010-04-27 13:50:15 +00:00
bms
57486a00dd MFC 206454:
When embedding the scope ID in MLDv1 output, check if the scope of the address
  being embedded is in fact link-local, before attempting to embed it.

  Note that this operation is a side-effect of trying to avoid recursion on
  the IN6 scope lock.

PR:		144560
Submitted by:	Petr Lampa
2010-04-27 13:27:51 +00:00
kib
7550515288 MFC r206992:
As was done in r155238 for i386 and in r155239 for amd64, clear the carry
flag for ia32 binary executed on amd64 host in get_mcontext().
2010-04-27 10:50:09 +00:00
kib
135cee2c86 MFC r206547:
Handle a case in kern_openat() when vn_open() change file type from
DTYPE_VNODE.
2010-04-27 10:47:54 +00:00