]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoProvide an error message instead of silent failure if no disks are present
nwhitehorn [Tue, 25 Oct 2011 16:30:16 +0000 (16:30 +0000)]
Provide an error message instead of silent failure if no disks are present
in the system.

PR: bin/161950
MFC after: 3 days

12 years agoDon't look for includes in userland directories. There is no need for it
pjd [Tue, 25 Oct 2011 16:22:43 +0000 (16:22 +0000)]
Don't look for includes in userland directories. There is no need for it
and it breaks building the kernel without userland sources.

Reported by: andre, imp
MFC after: 3 days

12 years agoAllow upper layers to discover than BIO_DELETE and/or BIO_FLUSH is not
pjd [Tue, 25 Oct 2011 14:07:17 +0000 (14:07 +0000)]
Allow upper layers to discover than BIO_DELETE and/or BIO_FLUSH is not
supported by returning EOPNOTSUPP instead of 0 or ENODEV.

MFC after: 3 days

12 years agoImprove style a bit.
pjd [Tue, 25 Oct 2011 14:05:39 +0000 (14:05 +0000)]
Improve style a bit.

MFC after: 3 days

12 years agoSimplify disk_alloc().
pjd [Tue, 25 Oct 2011 14:04:59 +0000 (14:04 +0000)]
Simplify disk_alloc().

MFC after: 3 days

12 years agoThe v_data field is a pointer, so set it to NULL, not 0.
pjd [Tue, 25 Oct 2011 14:01:17 +0000 (14:01 +0000)]
The v_data field is a pointer, so set it to NULL, not 0.

MFC after: 3 days

12 years agoAdd support for creating GELI devices with older metadata version for use
pjd [Tue, 25 Oct 2011 13:57:50 +0000 (13:57 +0000)]
Add support for creating GELI devices with older metadata version for use
with older FreeBSD versions:
- Add -V option to 'geli init' to specify version number. If no -V is given
  the most recent version is used.
- If -V is given don't allow to use features not supported by this version.
- Print version in 'geli list' output.
- Update manual page and add table describing which GELI version is
  supported by which FreeBSD version, so one can use it when preparing GELI
  device for older FreeBSD version.

Inspired by: Garrett Cooper <yanegomi@gmail.com>
MFC after: 3 days

12 years agoFix typo in copyright notice introduced in r226724
mm [Tue, 25 Oct 2011 13:52:38 +0000 (13:52 +0000)]
Fix typo in copyright notice introduced in r226724
(missing character in e-mail adress)

Reported by: pjd
MFC after: 3 days

12 years agoRevert r226726. The line was not duplicated.
pjd [Tue, 25 Oct 2011 13:49:48 +0000 (13:49 +0000)]
Revert r226726. The line was not duplicated.

Spotted by: pluknet
MFC after: 3 days

12 years agoWhen decoding metadata, check magic string, so we know this is not GELI device
pjd [Tue, 25 Oct 2011 13:44:23 +0000 (13:44 +0000)]
When decoding metadata, check magic string, so we know this is not GELI device
before we check its version. We don't want to report that some garbage is
unsupported version if this is not even GELI provider.

MFC after: 3 days

12 years agoFix resize regressions tests - we need to destroy BSDlabel before we can
pjd [Tue, 25 Oct 2011 13:41:12 +0000 (13:41 +0000)]
Fix resize regressions tests - we need to destroy BSDlabel before we can
create GPT.

MFC after: 3 days

12 years agoPrefer G_ELI_VERSION_* defines for version numbers over plain digits.
pjd [Tue, 25 Oct 2011 13:09:22 +0000 (13:09 +0000)]
Prefer G_ELI_VERSION_* defines for version numbers over plain digits.

MFC after: 3 days

12 years agoFit lines into 80 chars.
pjd [Tue, 25 Oct 2011 13:08:03 +0000 (13:08 +0000)]
Fit lines into 80 chars.

MFC after: 3 days

12 years agoRemove duplicated line.
pjd [Tue, 25 Oct 2011 12:26:19 +0000 (12:26 +0000)]
Remove duplicated line.

MFC after: 3 days

12 years agoProtect NIS server with madvise(2) since this daemon is required
glebius [Tue, 25 Oct 2011 10:33:26 +0000 (10:33 +0000)]
Protect NIS server with madvise(2) since this daemon is required
for succesful authentication of users.

12 years agoUpdate copyright information in several ZFS files, as the clause 3.3
mm [Tue, 25 Oct 2011 08:35:30 +0000 (08:35 +0000)]
Update copyright information in several ZFS files, as the clause 3.3
of the CDDL licence explicitly requires every Contributor to add
a copyright notice.

This also reflects the copyright notices for the changes recently
added by Illumos.

MFC after: 3 days

12 years agoAdd 'geli version' subcommand, which will print GELI metadata version of each
pjd [Tue, 25 Oct 2011 08:03:51 +0000 (08:03 +0000)]
Add 'geli version' subcommand, which will print GELI metadata version of each
given GEOM provider or if not providers are given it will print versions
supported by userland geli(8) utility and by ELI GEOM class.

MFC after: 3 days

12 years agoWhen we detect GELI metadata version that is newer than the highest we
pjd [Tue, 25 Oct 2011 07:56:27 +0000 (07:56 +0000)]
When we detect GELI metadata version that is newer than the highest we
support, inform the user about that instead of 'MD5 hash mismatch'.

Suggested by: Garrett Cooper <yanegomi@gmail.com>
MFC after: 3 days

12 years agoWhen metadata is at newer version than the highest supported, return
pjd [Tue, 25 Oct 2011 07:48:53 +0000 (07:48 +0000)]
When metadata is at newer version than the highest supported, return
EOPNOTSUPP when decoding.

MFC after: 3 days

12 years agoSimplify eli_resize() function.
pjd [Tue, 25 Oct 2011 07:44:10 +0000 (07:44 +0000)]
Simplify eli_resize() function.

MFC after: 3 days

12 years agoSimplify eli_dump() function and allow to dump metadata stored in backup file.
pjd [Tue, 25 Oct 2011 07:37:02 +0000 (07:37 +0000)]
Simplify eli_dump() function and allow to dump metadata stored in backup file.

MFC after: 3 days

12 years agoIf 'req' is NULL, print error on stderr.
pjd [Tue, 25 Oct 2011 07:34:35 +0000 (07:34 +0000)]
If 'req' is NULL, print error on stderr.

MFC after: 3 days

12 years agoSimplify eli_is_attached() function and make it return boot instead of int.
pjd [Tue, 25 Oct 2011 07:32:43 +0000 (07:32 +0000)]
Simplify eli_is_attached() function and make it return boot instead of int.

MFC after: 3 days

12 years agoSimplify eli_backup_create() and eli_backup_restore() functions.
pjd [Tue, 25 Oct 2011 07:31:13 +0000 (07:31 +0000)]
Simplify eli_backup_create() and eli_backup_restore() functions.
As a side-effect it is now possible to backup unsupported (newer)
GELI metadata versions.

MFC after: 3 days

12 years agoSort includes.
pjd [Tue, 25 Oct 2011 07:24:51 +0000 (07:24 +0000)]
Sort includes.

MFC after: 3 days

12 years agoFix argument name. This fixes EINVAL when boot0cfg uses GEOM_PART'
ae [Tue, 25 Oct 2011 04:15:45 +0000 (04:15 +0000)]
Fix argument name. This fixes EINVAL when boot0cfg uses GEOM_PART'
control interface.

MFC after: 3 days

12 years agoExclude host routes when checking for prefix coverage on multiple
qingli [Tue, 25 Oct 2011 04:06:29 +0000 (04:06 +0000)]
Exclude host routes when checking for prefix coverage on multiple
interfaces. A host route has a NULL mask so check for that condition.
I have also been told by developers who customize the packet output
path with direct manipulation of the route entry (or the outgoing
interface to be specific). This patch checks for the route mask
explicitly to make sure custom code will not panic.

PR: kern/161805
MFC after: 3 days

12 years agoAdd new option -F to specify alternative location of the /etc/fstab
sobomax [Tue, 25 Oct 2011 01:47:33 +0000 (01:47 +0000)]
Add new option -F to specify alternative location of the /etc/fstab
file.

MFC after: 1 month

12 years agoAdd new option -c to specify alternatve location of the /etc/fstab
sobomax [Tue, 25 Oct 2011 01:46:42 +0000 (01:46 +0000)]
Add new option -c to specify alternatve location of the /etc/fstab
file.

MFC after: 1 month

12 years agoThe host-id/interface-id can have a specific value and is properly
qingli [Tue, 25 Oct 2011 00:34:39 +0000 (00:34 +0000)]
The host-id/interface-id can have a specific value and is properly
masked out when adding a prefix route through the "route" command.
However, when deleting the route, simply changing the command keyword
from "add" to "delete" does not work. The failoure is observed in
both IPv4 and IPv6 route insertion. The patch makes the route command
behavior consistent between the "add" and the "delete" operation.

MFC after: 1 week

12 years agoThis change makes it possible to define driver specific attach
yongari [Mon, 24 Oct 2011 23:38:11 +0000 (23:38 +0000)]
This change makes it possible to define driver specific attach
handler such that driver can announce interface capabilities and
can do its own MII attach.  Currently all USB ethernet controllers
have no way to establish a link with pause capabilities. Lack of
checksum offloading support also was one of reason to bring this
change in.

This change adds a couple of wrappers to USB ethernet drivers
(uether_ifmedia_upd, uether_init and uether_start). All exported
functions in uether has prefix uether_ so I think it's more
consistent to have wrappers that follow the convention.
This change preserves ABI/KPI so it should be safe to merge this
change to stable/8.

While I'm here add missing __FBSDID and clean up headers.

Reviewed by: hselasky

12 years agoStaticify elide_root() for now to fix build.
delphij [Mon, 24 Oct 2011 21:38:25 +0000 (21:38 +0000)]
Staticify elide_root() for now to fix build.

12 years ago- Use better naming now that we allow to rename any mounted file system (not
pjd [Mon, 24 Oct 2011 21:31:53 +0000 (21:31 +0000)]
- Use better naming now that we allow to rename any mounted file system (not
  only legacy).
- Update copyright to include myself.

MFC after: 2 weeks

12 years agoUpdate copyright to include myself.
pjd [Mon, 24 Oct 2011 21:22:55 +0000 (21:22 +0000)]
Update copyright to include myself.

MFC after: 2 weeks

12 years agoExtend r226676 to allow rename without unmount even for file systems with
pjd [Mon, 24 Oct 2011 21:14:50 +0000 (21:14 +0000)]
Extend r226676 to allow rename without unmount even for file systems with
non-legacy mountpoints. It is better to be able to rename such file systems and
let them be mounted in old places until next reboot than using live CD, etc. to
rename with remount.

This is implemented by adding -u option to 'zfs rename'. If file system's
mountpoint property is set to 'legacy' or 'none', there is no need to specify -u.

Update zfs(8) manual page to reflect this addition.

MFC after: 2 weeks

12 years agoAll dc(4) controllers support VLAN over-sized frame.
yongari [Mon, 24 Oct 2011 21:01:20 +0000 (21:01 +0000)]
All dc(4) controllers support VLAN over-sized frame.
Xr vlan

12 years agoAdd ALi/ULi M5261/M5263 to supported hardware chipets.
yongari [Mon, 24 Oct 2011 20:57:50 +0000 (20:57 +0000)]
Add ALi/ULi M5261/M5263 to supported hardware chipets.

12 years ago* Don't give the impression that this compiler is GPLv3.
obrien [Mon, 24 Oct 2011 20:52:41 +0000 (20:52 +0000)]
* Don't give the impression that this compiler is GPLv3.
  (It is "well known" that GCC 4.2.2 is GPLv3.)
* Don't give the impression that this compiler isn't "trustable".
* Fix dependency nit.

12 years agoAdd support for ALi/ULi, now NVIDIA, M5261/M5263 PCI FastEthernet
yongari [Mon, 24 Oct 2011 20:48:02 +0000 (20:48 +0000)]
Add support for ALi/ULi, now NVIDIA, M5261/M5263 PCI FastEthernet
controller which is found on ULi M1563 South Bridge & M1689 Bridge.
These controllers look like a tulip clone.
M5263 controller does not support MII bitbang so use DC_ROM
register to access MII registers.  Like other tulip variants, ULi
controller uses a setup frame to configure RX filter and uses new
setup frame format.  It's not clear to me whether the controller
supports a hash based multicast filtering so this patch uses 14
perfect multicast filter to filter multicast frames.  If number of
multicast addresses is greater than 14, controller is put into a
mode that receives all multicast frames.
Due to lack of access to M5261, this change was not tested with
M5261 but it probably works.  Many thanks to Marco who provided
remote access to M5263.

Tested by: Marco Steinbach <coco <> executive-computing dot de>,
Martin MATO <martin.mato <> orange dot fr>

12 years agoDon't forget to rename mounted snapshots of the file system being renamed.
pjd [Mon, 24 Oct 2011 20:41:31 +0000 (20:41 +0000)]
Don't forget to rename mounted snapshots of the file system being renamed.

MFC after: 2 weeks

12 years agoWhen driver is run for the first time there would be no established
yongari [Mon, 24 Oct 2011 20:26:37 +0000 (20:26 +0000)]
When driver is run for the first time there would be no established
link such that calling dc_setcfg() right after media change would
be meaningless unless controller in question is not Davicom DM9102.
Ideally dc_setcfg() should be called when speed/duplex is resolved
otherwise it would reprogram controller with wrong speed/duplex
information.  Because MII status change callback already calls
dc_setcfg() I think calling dc_setcfg() in dc_init_locked() is
wrong.  For instance, it would take some time to establish a link
after mii_mediachg(), so blindly calling dc_setcfg() right after
mii_mediachg() will always yield wrong media configuration.

Extend dc_ifmedia_upd() to handle media change and still allow
21143 and Davidcom controllers program speed/duplex regardless of
current resolved speed/duplex of link. In theory 21143 may not need
to call dc_setcfg() right after media change, but leave it as it is
because there are too many variants to test that change.  Probably
dc(4) shall need a PHY reset in dc_ifmedia_upd() but it's hard to
verify correctness of the change.

This change reliably makes ULi M5263 establish a link.

While I'm here correctly report media change result. Previously it
always reported a success.

12 years agoPut in a temporary band-aid to fix kernel builds when CC=clang, after
dim [Mon, 24 Oct 2011 18:35:16 +0000 (18:35 +0000)]
Put in a temporary band-aid to fix kernel builds when CC=clang, after
r226665.

12 years agoAvoid printing // for packages that install to /
emaste [Mon, 24 Oct 2011 18:29:50 +0000 (18:29 +0000)]
Avoid printing // for packages that install to /

I have some packages that install to / (for whatever reason).  Right now we
print entries of the form //path/to/file when listing files (pkg_info -L,
pkg_info -g etc.)  This change avoids printing the redundant / .

12 years agoAdd missing bus_dmamap_sync() in setup frame transmit.
yongari [Mon, 24 Oct 2011 17:09:22 +0000 (17:09 +0000)]
Add missing bus_dmamap_sync() in setup frame transmit.

MFC after: 3 days

12 years agoFix a regression introduced in r218832. For TX status check, driver
yongari [Mon, 24 Oct 2011 17:05:59 +0000 (17:05 +0000)]
Fix a regression introduced in r218832. For TX status check, driver
should use a TX list DMA tag.

MFC after: 3 days

12 years agoProtect NIS client with madvise(2) since this daemon is required
glebius [Mon, 24 Oct 2011 14:35:31 +0000 (14:35 +0000)]
Protect NIS client with madvise(2) since this daemon is required
for succesful authentication of users.

12 years agoThe use of VOP_ISLOCKED() without a check for the return values can cause
kib [Mon, 24 Oct 2011 13:56:31 +0000 (13:56 +0000)]
The use of VOP_ISLOCKED() without a check for the return values can cause
false positives. Replace the #ifdef block with the proper
ASSERT_VOP_UNLOCKED() assert.

Tested by: pho
MFC after: 1 week

12 years agoThe only possible error return from null_nodeget() is due to insmntque1
kib [Mon, 24 Oct 2011 13:53:32 +0000 (13:53 +0000)]
The only possible error return from null_nodeget() is due to insmntque1
failure (the getnewvnode cannot return an error). In this case, the
null_insmntque_dtr() already unlocked the reclaimed vnode, so VOP_UNLOCK()
in the nullfs_mount() after null_nodeget() failure is wrong.

Tested by: pho
MFC after: 1 week

12 years agoThe covered vnode must be reloced if it was unlocked. Remove VOP_ISLOCKED
kib [Mon, 24 Oct 2011 13:48:13 +0000 (13:48 +0000)]
The covered vnode must be reloced if it was unlocked. Remove VOP_ISLOCKED
test because of this and also because it can lead to false positives.

Tested by: pho
MFC after: 1 week

12 years agoApparently, "ada" drives are better treated similarly to "da" drives.
ivoras [Mon, 24 Oct 2011 12:59:39 +0000 (12:59 +0000)]
Apparently, "ada" drives are better treated similarly to "da" drives.

12 years agoIt seems that the warning is much less severe than its message says. The
ivoras [Mon, 24 Oct 2011 12:43:20 +0000 (12:43 +0000)]
It seems that the warning is much less severe than its message says. The
device is certainly added to the list after the first pass.

12 years agoFix typo
ivoras [Mon, 24 Oct 2011 12:21:58 +0000 (12:21 +0000)]
Fix typo

MFC after: 1 month

12 years agoOnly unlock if the lock is exclusive.
pho [Mon, 24 Oct 2011 10:35:37 +0000 (10:35 +0000)]
Only unlock if the lock is exclusive.

Reported by: Subbsd <subbsd gmail com>
Discussed with: kib

12 years agoSome dmesg cosmetics:
mav [Mon, 24 Oct 2011 08:47:23 +0000 (08:47 +0000)]
Some dmesg cosmetics:
 - for the legacy PCI ATA channels move channel number out of the device
description, same as it is for ahci(4), siis(4) and mvs(4);
 - add device description for the ISA ATA channels.

12 years agoLet net80211 also know about stopped BA sessions. This fixes some issues
bschmidt [Mon, 24 Oct 2011 07:37:01 +0000 (07:37 +0000)]
Let net80211 also know about stopped BA sessions. This fixes some issues
where the driver assumed that BA resources are still available due to
net80211 saying so.

PR: 161407, 159768
Tested by: cperciva, rene
MFC after: 3 days

12 years agoInclude <sys/zfs_vfsops.h> only when compiling kernel module.
pjd [Mon, 24 Oct 2011 05:26:40 +0000 (05:26 +0000)]
Include <sys/zfs_vfsops.h> only when compiling kernel module.

MFC after: 2 weeks

12 years agoAllow to rename file systems without remounting if it is possible.
pjd [Mon, 24 Oct 2011 00:38:09 +0000 (00:38 +0000)]
Allow to rename file systems without remounting if it is possible.
It is possible for file systems with 'mountpoint' preperty set to 'legacy'
or 'none' - we don't have to change mount directory for them.
Currently such file systems are unmounted on rename and not even mounted back.

This introduces layering violation, as we need to update 'f_mntfromname'
field in statfs structure related to mountpoint (for the dataset we are
renaming and all its children).

In my opinion it is worth it, as it allow to update FreeBSD in even cleaner
way - in ZFS-only configuration root file system is ZFS file system with
'mountpoint' property set to 'legacy'. If root dataset is named system/rootfs,
we can snapshot it (system/rootfs@upgrade), clone it (system/oldrootfs),
update FreeBSD and if it doesn't boot we can boot back from system/oldrootfs
and rename it back to system/rootfs while it is mounted as /. Before it was
not possible, because unmounting / was not possible.

MFC after: 2 weeks

12 years agoDon't terminate the interactive root mount prompt on mount failure.
marcel [Sun, 23 Oct 2011 20:03:33 +0000 (20:03 +0000)]
Don't terminate the interactive root mount prompt on mount failure.
This restores the previous behaviour. While here, match '?' and '.'
inputs exactly and improve the error message.

Requested by: avg@
Derived from a patch by: Arnaud Lacombe <lacombar@gmail.com>

12 years agoAdd a "-P olddistfiles" facility to prefetch ports distfiles, using an
phk [Sun, 23 Oct 2011 19:46:01 +0000 (19:46 +0000)]
Add a "-P olddistfiles" facility to prefetch ports distfiles, using an
old distfile directory as primary source:

      mkdir /freebsd/ports/distfiles.old
      mv /freebsd/ports/distfiles/* /freebsd/ports/distfiles.old
      sh sysbuild.sh -c $yourconfig -P /freebsd/ports/distfiles.old
      rm -rf /freebsd/ports/distfiles.old

Unfortunately bsd.ports.mk does not attempt to use a hard-link so
while this runs you need diskspace for both your old and your "new"
distfiles.

12 years agoAvoid some "Invalid argument" errors in the installer.
nwhitehorn [Sun, 23 Oct 2011 16:57:10 +0000 (16:57 +0000)]
Avoid some "Invalid argument" errors in the installer.

PR: bin/161926
MFC after: 5 days

12 years agoConditionalize a pair of FreeBSD GCC extensions so that its CFLAGS are only
rmh [Sun, 23 Oct 2011 16:27:03 +0000 (16:27 +0000)]
Conditionalize a pair of FreeBSD GCC extensions so that its CFLAGS are only
used with FreeBSD GCC.

Approved by: kib (mentor)

12 years ago- Fix installation when WITH_BSD_GREP is set to yes
gabor [Sun, 23 Oct 2011 16:04:07 +0000 (16:04 +0000)]
- Fix installation when WITH_BSD_GREP is set to yes

Submitted by: Aleksandr Rybalko <ray@ddteam.net>

12 years agoMerge several fixes to bulk update processing from OpenBSD. Merged
glebius [Sun, 23 Oct 2011 15:15:17 +0000 (15:15 +0000)]
Merge several fixes to bulk update processing from OpenBSD. Merged
revisions: 1.148, 1.149, 1.150. This makes number of states on
master/slave to be of a sane value.

12 years agoFix indentation, no code changed.
glebius [Sun, 23 Oct 2011 15:10:15 +0000 (15:10 +0000)]
Fix indentation, no code changed.

12 years ago- Fix a bad typo (FreeBSD specific) in pfsync_bulk_update(). Instead
glebius [Sun, 23 Oct 2011 15:08:18 +0000 (15:08 +0000)]
- Fix a bad typo (FreeBSD specific) in pfsync_bulk_update(). Instead
  of scheduling next run pfsync_bulk_update(), pfsync_bulk_fail()
  was scheduled.
  This lead to instant 100% state leak after first bulk update
  request.
- After above fix, it appeared that pfsync_bulk_update() lacks
  locking. To fix this, sc_bulk_tmo callout was converted to an
  mtx one. Eventually, all pf/pfsync callouts should be converted
  to mtx version, since it isn't possible to stop or drain a
  non-mtx callout without risk of race.
- Add comment that callout_stop() in pfsync_clone_destroy() lacks
  locking. Since pfsync0 can't be destroyed (yet), let it be here.

12 years agoFix from r226623 is not sufficient to close all races in pfsync(4).
glebius [Sun, 23 Oct 2011 14:59:54 +0000 (14:59 +0000)]
Fix from r226623 is not sufficient to close all races in pfsync(4).

The root of problem is re-locking at the end of pfsync_sendout().
Several functions are calling pfsync_sendout() holding pointers
to pf data on stack, and these functions expect this data to be
consistent.

To fix this, the following approach was taken:

- The pfsync_sendout() doesn't call ip_output() directly, but
  enqueues the mbuf on sc->sc_ifp's interfaces queue, that
  is currently unused. Then pfsync netisr is scheduled. PF_LOCK
  isn't dropped in pfsync_sendout().
- The netisr runs through queue and ip_output()s packets
  on it.

Apart from fixing race, this also decouples stack, fixing
potential issues, that may happen, when sending pfsync(4)
packets on input path.

Reviewed by: eri (a quick review)

12 years agoAdd information about static_ndp_pairs to rc.conf(5) manual page
mm [Sun, 23 Oct 2011 10:20:31 +0000 (10:20 +0000)]
Add information about static_ndp_pairs to rc.conf(5) manual page

Submitted by: Sergey Kandaurov <pluknet@FreeBSD.org>
MFC after: 3 days

12 years agoCorrectly reassign copyright of etc/rc.d/static_ndp back to delphij@
mm [Sun, 23 Oct 2011 10:17:42 +0000 (10:17 +0000)]
Correctly reassign copyright of etc/rc.d/static_ndp back to delphij@
as the project itself is no legal entity

Reported by: Joe Dahl <joel@vnode.se>
MFC after: 3 days

12 years agoAbsense of M_WAITOK in malloc flags for UMA doesn't
glebius [Sun, 23 Oct 2011 10:13:20 +0000 (10:13 +0000)]
Absense of M_WAITOK in malloc flags for UMA doesn't
equals presense of M_NOWAIT. Specify M_NOWAIT explicitly.

This fixes sleeping with PF_LOCK().

12 years agoCorrect flag for uma_zalloc() is M_WAITOK. M_WAIT is an old and
glebius [Sun, 23 Oct 2011 10:05:25 +0000 (10:05 +0000)]
Correct flag for uma_zalloc() is M_WAITOK. M_WAIT is an old and
deprecated flag from historical mbuf(9) allocator.

This is style only change.

12 years agoAdd etc/rc.d/static_ndp, analogous to etc/rc.d/static_arp.
mm [Sun, 23 Oct 2011 09:08:42 +0000 (09:08 +0000)]
Add etc/rc.d/static_ndp, analogous to etc/rc.d/static_arp.
Make sure that static ARP and NDP bindings are set before NETWORKING.

As static_ndp is based on static_arp, pass copyright to the project with
permission of the original author (delphij@).

Reviewed by: delphij@FreeBSD.org
MFC after: 3 days

12 years agoFix typos.
hrs [Sun, 23 Oct 2011 07:38:55 +0000 (07:38 +0000)]
Fix typos.

12 years agoAdd support for removing addresses added by ipv6_prefix_hostid_addr_up()
hrs [Sun, 23 Oct 2011 07:37:36 +0000 (07:37 +0000)]
Add support for removing addresses added by ipv6_prefix_hostid_addr_up()
upon rc.d/netif stop.

12 years ago- Add description that IPv6 configuration will be ignored if $ifconfig_IF_ipv6
hrs [Sun, 23 Oct 2011 06:34:52 +0000 (06:34 +0000)]
- Add description that IPv6 configuration will be ignored if $ifconfig_IF_ipv6
  is empty.
- Move a configuration example "inet6 accept_rtadv" to just after the manual
  GUA configuration.
- Add an example of $ipv6_prefix_IF.

12 years agoAdd '%' and '@' to the set of characters which can appear in path names.
cperciva [Sun, 23 Oct 2011 06:23:11 +0000 (06:23 +0000)]
Add '%' and '@' to the set of characters which can appear in path names.
Without this change, freebsd-update refuses to accept 9.0 metadata files.

12 years agoFix an issue that 127/8 is not configured when $ifconfig_DEFAULT is not empty.
hrs [Sun, 23 Oct 2011 05:56:59 +0000 (05:56 +0000)]
Fix an issue that 127/8 is not configured when $ifconfig_DEFAULT is not empty.

Spotted by: ume

12 years agoFix missing space in SEE ALSO section.
nwhitehorn [Sun, 23 Oct 2011 02:52:20 +0000 (02:52 +0000)]
Fix missing space in SEE ALSO section.

Submitted by: novel

12 years agoAdd support for Boot Camp. The support is defined as follows:
marcel [Sun, 23 Oct 2011 02:51:23 +0000 (02:51 +0000)]
Add support for Boot Camp. The support is defined as follows:
o   Detect when Boot Camp is enabled (i.e. the MBR mirrors the GPT).
o   When Boot Camp is enabled, update the MBR whenever we write the GPT.
o   Creation of a Boot Camp enabled GPT is not supported.
o   Automatically disable Boot Camp when the GPT has been changed so that
    there's either no EFI partition or no HFS+ partition.
o   The first 4 partitions (by index) get mirrored in the MBR.

Requested by, discussed with and tested by: kris@pcbsd.org
MFC after: 1 week

12 years agoFix Buildworld WITHOUT_OPENSSL.
kientzle [Sat, 22 Oct 2011 22:22:46 +0000 (22:22 +0000)]
Fix Buildworld WITHOUT_OPENSSL.

PR: kern/160922
MFC after: 3 days

12 years agoVN_NRESERVLEVEL is used in this file but opt_vm is not included
attilio [Sat, 22 Oct 2011 22:00:35 +0000 (22:00 +0000)]
VN_NRESERVLEVEL is used in this file but opt_vm is not included
thus the stub switch won't be correctly handled.
Include opt_vm.h.

Submitted by: jeff
MFC after: 3 days

12 years agoCorrect the spelling of getgrgid and getpwuid in the man page.
kientzle [Sat, 22 Oct 2011 17:56:24 +0000 (17:56 +0000)]
Correct the spelling of getgrgid and getpwuid in the man page.

MFC after: 3 days

12 years agoTypo from previous commit. Urgh.
kientzle [Sat, 22 Oct 2011 16:53:29 +0000 (16:53 +0000)]
Typo from previous commit. Urgh.

12 years agoBring in the --gid --gname --uid and --uname implementation
kientzle [Sat, 22 Oct 2011 16:52:04 +0000 (16:52 +0000)]
Bring in the --gid --gname --uid and --uname implementation
from libarchive.googlecode.com.

MFC after: 3 days

12 years agoUpgrade our copy of llvm/clang to r142614, from upstream's release_30
dim [Sat, 22 Oct 2011 14:08:43 +0000 (14:08 +0000)]
Upgrade our copy of llvm/clang to r142614, from upstream's release_30
branch.  This brings us very close to the 3.0 release, which is expected
in a week or two.

MFC after: 1 week

12 years agoRevert the previous commit and add a comment explaining why it was wrong.
des [Sat, 22 Oct 2011 14:08:21 +0000 (14:08 +0000)]
Revert the previous commit and add a comment explaining why it was wrong.

12 years agoopenpam_static.c isn't auto-generated.
des [Sat, 22 Oct 2011 04:39:12 +0000 (04:39 +0000)]
openpam_static.c isn't auto-generated.

12 years agoFix a race: we should update sc_len before dropping the pf lock, otherwise a
glebius [Fri, 21 Oct 2011 22:28:15 +0000 (22:28 +0000)]
Fix a race: we should update sc_len before dropping the pf lock, otherwise a
number of packets can be queued on sc, while we are in ip_output(), and then
we wipe the accumulated sc_len. On next pfsync_sendout() that would lead to
writing beyond our mbuf cluster.

12 years agoUpdate per-thread I/O statistics collection in ZFS.
pjd [Fri, 21 Oct 2011 21:49:34 +0000 (21:49 +0000)]
Update per-thread I/O statistics collection in ZFS.
This allows to see processes I/O activity in 'top -m io' output.

PR kern/156218
Reported by: Marcus Reid <marcus@blazingdot.com>
Patch by: avg
MFC after: 3 days

12 years agoSpelling.
glebius [Fri, 21 Oct 2011 20:23:40 +0000 (20:23 +0000)]
Spelling.

Submitted by: dougb

12 years agoMinor corrections and clarifications regarding exceptions.
das [Fri, 21 Oct 2011 14:23:59 +0000 (14:23 +0000)]
Minor corrections and clarifications regarding exceptions.

12 years agozfs vdev_file_io_start: validate vdev before using vdev_tsd
pjd [Fri, 21 Oct 2011 14:00:48 +0000 (14:00 +0000)]
zfs vdev_file_io_start: validate vdev before using vdev_tsd

vdev_tsd can be NULL for certain vdev states.
At least in userland testing with ztest.

Submitted by: avg
MFC after: 3 days

12 years agozdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS
pjd [Fri, 21 Oct 2011 13:56:17 +0000 (13:56 +0000)]
zdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS

Submitted by: avg
MFC after: 3 days

12 years agothr_create: new_thread_ID may be NULL
pjd [Fri, 21 Oct 2011 13:54:58 +0000 (13:54 +0000)]
thr_create: new_thread_ID may be NULL

Submitted by: avg
MFC after: 3 days

12 years agoNote that it is still not possible to guard special kind of allocations, those
glebius [Fri, 21 Oct 2011 13:54:17 +0000 (13:54 +0000)]
Note that it is still not possible to guard special kind of allocations, those
that have special relationships with uma(9). Currently only mbuf clusters.

12 years agolibzpool task_alloc: pass only valid flags to kmem_alloc
pjd [Fri, 21 Oct 2011 13:53:06 +0000 (13:53 +0000)]
libzpool task_alloc: pass only valid flags to kmem_alloc

tqflags may contain other flags besided those that are suitable for
kmem_alloc == umem_alloc

Submitted by: avg
MFC after: 3 days

12 years agoBecause ZFS boot code was very fragile in the past and real PITA to debug,
pjd [Fri, 21 Oct 2011 13:44:26 +0000 (13:44 +0000)]
Because ZFS boot code was very fragile in the past and real PITA to debug,
introduce zfsboottest.sh script that will verify if it will be possible to boot
from the given pool.

# zfsboottest.sh system

Where "system" is pool name of the pool we want to boot from.

What is being verified by the script:
- Does the pool exist?
- Does it have bootfs property configured?
- Is mountpoint property of the boot dataset set to 'legacy'?

Dataset configured in bootfs property has to be mounted to perform more
checks:
- Does the /boot directory in boot dataset exist?
- Is this dataset configured as root file system in /etc/fstab or set
  in vfs.root.mountfrom variable in /boot/loader.conf?

By using zfsboottest tool the script will read all the files in /boot
directory using ZFS boot code and calculate their checksums.
Then, it will walk /boot directory using find(1) though regular file sytem
and also read all the files in /boot directory and calculate their checksums.
If any of the files cannot be looked up, read or checksum is invalid it will
be reported and booting off of this pool is probably not possible.

Some additional checks may be interesting as well. For example if the disks
contain proper pmbr and gptzfsboot code or if all expected files in /boot/
are present.

When upgrading FreeBSD, one should snapshot datasets that contain operating
system, upgrade (install new world and kernel) and use zfsboottest.sh to verify
if it will be possible to boot from new configuration. If all is good one
should upgrade boot blocks, by eg.:

# gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1

If something is wrong, one should rollback datasets and report the problems.

MFC after: 3 days

12 years ago- Allow to specify multiple files to check, eg.
pjd [Fri, 21 Oct 2011 13:13:18 +0000 (13:13 +0000)]
- Allow to specify multiple files to check, eg.

zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel /boot/zfsloader

- Instead of printing file's content calculate MD5 hash of the file,
  so it can be easly compared to the hash calculated via file system.
- Some other minor improvements.

MFC after: 3 days

12 years agoAdd missing #includes.
ed [Fri, 21 Oct 2011 12:58:34 +0000 (12:58 +0000)]
Add missing #includes.

According to POSIX, these two header files should be able to be included
by themselves, not depending on other headers. The <net/if.h> header
uses struct sockaddr when __BSD_VISIBLE=1, while <netinet/tcp.h> uses
integer datatypes (u_int32_t, u_short, etc).

MFC after: 2 months

12 years agoIn FreeBSD ip_output() expects ip_len and ip_off in host byte order
glebius [Fri, 21 Oct 2011 11:11:18 +0000 (11:11 +0000)]
In FreeBSD ip_output() expects ip_len and ip_off in host byte order

PR: kern/159029

12 years agoIt turns out that truss also used kdump's mkioctls script, and expected
des [Fri, 21 Oct 2011 11:08:25 +0000 (11:08 +0000)]
It turns out that truss also used kdump's mkioctls script, and expected
ioctlname() to return a pointer to the name rather than print it.  This did
not show up in testing because truss had its own prototype for ioctlname(),
so it would build fine and run fine as long as the program being traced did
not issue an ioctl.

Teach mkioctls to generate different versions of ioctlname() based on its
first command-line argument.

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