marcel [Wed, 7 Feb 2007 18:55:31 +0000 (18:55 +0000)]
Evolve the ctlreq interface added to geom_gpt into a generic
partitioning class that supports multiple schemes. Current
schemes supported are APM (Apple Partition Map) and GPT.
Change all GEOM_APPLE anf GEOM_GPT options into GEOM_PART_APM
and GEOM_PART_GPT (resp).
The ctlreq interface supports verbs to create and destroy
partitioning schemes on a disk; to add, delete and modify
partitions; and to commit or undo changes made.
jhb [Wed, 7 Feb 2007 17:43:11 +0000 (17:43 +0000)]
- Move 'struct swdevt' back into swap_pager.h and expose it to userland.
- Restore support for fetching swap information from crash dumps via
kvm_get_swapinfo(3) to fix pstat -T/-s on crash dumps.
bms [Wed, 7 Feb 2007 16:04:13 +0000 (16:04 +0000)]
Remove support for IPIP tunnels in IPv4 multicast forwarding. XORP has
never used them; with mrouted, their functionality may be replaced by
explicitly configuring gif(4) instances and specifying them with the
'phyint' keyword.
Bump __FreeBSD_version to 700030, and update UPDATING.
A doc update is forthcoming.
Discussed on: net
Reviewed by: fenner
MFC after: 3 months
kib [Wed, 7 Feb 2007 10:30:49 +0000 (10:30 +0000)]
Fix the race of dereferencing /proc/<pid>/file with execve(2) by caching
the value of p_textvp. This way, we always unlock the locked vnode.
While there, vhold() the vnode around the vn_lock().
Reported and tested by: Guy Helmer (ghelmer palisadesys com)
Approved by: des (procfs maintainer)
MFC after: 1 week
jhb [Tue, 6 Feb 2007 20:29:40 +0000 (20:29 +0000)]
Make iostat(8) fully work on crash dumps again (broken since 5.0):
- Pass the address of the variable we are reading to kvm_read() rather
than the index into the nlist array.
- Properly report errors from kvm_read() which returns -1 on error, not
0.
bde [Tue, 6 Feb 2007 18:04:02 +0000 (18:04 +0000)]
Fixed some style bugs. Routine except:
- don't use __GNUCLIKE___OFFSETOF, since __offsetof() is a standard
FreeBSD implementaion detail which has nothing to do with GNUC.
bde [Tue, 6 Feb 2007 16:21:09 +0000 (16:21 +0000)]
Simplified PCPU_GET() and PCPU_SET(). We must copy through a temporary
variable to avoid invalid constraints in dead code. Use an array of
u_char's (inside a struct) instead of a char/short/int/long variable so
that the variable and its accesses can be spelled in the same way in all
cases and code doesn't need to be cloned just to hold the spelling
differences.
Fixed strict-aliasing errors in PCPU_SET() and in the amd64 PCPU_GET().
Cast to (void *) as in rev.1.37 of the i386 version where the errors
were fixed for the i386 PCPU_GET() only. It would be more correct to
copy to and from the temp. variable using memcpy(), but then an
ifdef tangle would be required to ensure using the builtin memcpy().
We depend on fairly aggressive optimization to put the temp. variable
only in a register despite it being copied using
*(type *)(void *)&anothertype and could depend on this when using
memcpy() too. This seems to work right even for -O0, but the -O0 case
has not been completely tested.
This change gives identical object code for all object files in LINT
on amd64 (except for one file with a __TIME__ stamp). For LINT on
i386 it gives unimportant differences in instruction order and padding
in a few object files. This was only tested for -O.
This change (actually a previous version of it) gives the following
reductions in the number of object files in LINT that fail to compile
with -O2 but without the -fno-strict-aliasing kludge:
- amd64: 29 (down from 211)
- i386: 36 (down from 47)
gcc-3.4.6 actually allows the invalid constraints that result from not
using the temp. variable, at least with -O[1-2], but gcc-3.3.3 crashes
on them and I don't want to depend on compiler bugs.
rwatson [Tue, 6 Feb 2007 14:31:37 +0000 (14:31 +0000)]
Push UNIX domain socket locking further into uipc_ctloutput() in order to
avoid holding the UNIX domain socket subsystem lock over soooptcopyin()
and sooptcopyout(). This problem was introduced when LOCAL_CREDS, and
LOCAL_CONNWAIT support were added.
rwatson [Tue, 6 Feb 2007 14:19:25 +0000 (14:19 +0000)]
Introduce accessor functions mac_label_get() and mac_label_set() to replace
LABEL_TO_SLOT() macro used by policy modules to query and set label data
in struct label. Instead of using a union, store an intptr_t, simplifying
the API.
Update policies: in most cases this required only small tweaks to current
wrapper macros. In two cases, a single wrapper macros had to be split into
separate get and set macros.
Move struct label definition from _label.h to mac_internal.h and remove
_label.h. With this change, policies may now treat struct label * as
opaque, allowing us to change the layout of struct label without breaking
the policy module ABI. For example, we could make the maximum number of
policies with labels modifiable at boot-time rather than just at
compile-time.
imp [Tue, 6 Feb 2007 12:07:14 +0000 (12:07 +0000)]
at91_twi depends on the iicbus module to satisfy its symbols when
loaded, so make that explicit. Works for the monolithic kernel case,
won't work for the kldload case.
rwatson [Tue, 6 Feb 2007 10:59:23 +0000 (10:59 +0000)]
Continue 7-CURRENT MAC Framework rearrangement and cleanup:
Don't perform a nested include of _label.h in mac.h, as mac.h now
describes only the user API to MAC, and _label.h defines the in-kernel
representation of MAC labels.
Remove mac.h includes from policies and MAC framework components that do
not use userspace MAC API definitions.
Add _KERNEL inclusion checks to mac_internal.h and mac_policy.h, as these
are kernel-only include files
rodrigc [Tue, 6 Feb 2007 05:57:40 +0000 (05:57 +0000)]
Print warning that "-t msdos" is deprecated and being converted to
"-t msdosfs". The conversion has been happening since 1.43, but
no equivalent conversion happens in "umount -t", which led to some
confusion with some users.
mpp [Tue, 6 Feb 2007 05:51:55 +0000 (05:51 +0000)]
The change to the vm_page_queue_freelist lock from a spin lock to a
sleep lock missed the witness code, and the system will panic
immediately on boot if WITNESS is enabled.
jhb [Mon, 5 Feb 2007 21:48:32 +0000 (21:48 +0000)]
Change GDB_BUFSZ to be large enough to hold a register dump where each
register takes 16 characters (64-bit register in hex). In practice this
is a slight bit of overkill as 7 of the 56 registers are only 32-bit, but
having the buffer too small results in remote kgdb trashing kernel memory
when it connects.
PR: amd64/108673
Submitted by: Ravi Murty, Nikhil Rao @ Intel
MFC after: 3 days
jdp [Mon, 5 Feb 2007 16:36:25 +0000 (16:36 +0000)]
Use egrep instead of grep so that reporting of login failures (broken
by revision 1.6) works again. This fix is already in RELENG_6, but was
never committed to HEAD.
cperciva [Mon, 5 Feb 2007 16:30:40 +0000 (16:30 +0000)]
If (a == NULL), don't dereference (a) to record an error message. [1]
Fallout from changing the skip API to use off_t instead of size_t: Print
the skip length using %jd and cast to (intmax_t) instead of %d / (int),
and if ARCHIVE_API_VERSION >= 2, allow the client skipper to be called
for requests longer than SSIZE_MAX. [2]
Approved by: kientzle
Pointy hats to: kientzle [1], cperciva [2]
MFC after: 3 days
bms [Mon, 5 Feb 2007 11:15:52 +0000 (11:15 +0000)]
Clean up after tun(4) properly; remove routes whose ifp is set to
that of the tun instance even for the !AF_INET case, and properly
remove configured addresses by calling if_purgeaddrs().
Maintain the TUN_DSTADDR behaviour for compatibility with the OS/390
emulator.
alc [Mon, 5 Feb 2007 06:02:55 +0000 (06:02 +0000)]
Change the free page queue lock from a spin mutex to a default (blocking)
mutex. With the demise of Alpha support, there is no longer a reason for
it to be a spin mutex.
bms [Sun, 4 Feb 2007 16:48:56 +0000 (16:48 +0000)]
Be explicit in examples about the correct grammar for 'alias' and
'-alias', and that 'add' and 'delete are in fact synonyms for these
in the ifconfig(8) grammar.
Use network prefixes explicitly specified in IETF RFCs for
documentation purposes. (bz)
PR: 102701
MFC after: 1 day
See also: RFC 3330, RFC 3849
Submitted by: bz
bms [Sun, 4 Feb 2007 16:32:46 +0000 (16:32 +0000)]
Implement ifnet cloning for tun(4)/tap(4).
Make devfs cloning a sysctl/tunable which defaults to on.
If devfs cloning is enabled, only the super-user may create
tun(4)/tap(4)/vmnet(4) instances. Devfs cloning is still enabled by
default; it may be disabled from the loader or via sysctl with
"net.link.tap.devfs_cloning" and "net.link.tun.devfs_cloning".
Disabling its use affects potentially all tun(4)/tap(4) consumers
including OpenSSH, OpenVPN and VMware.
mpp [Sun, 4 Feb 2007 14:06:58 +0000 (14:06 +0000)]
If a user is over both the soft block limit and soft i-node
limit, quota will report one of the grace times incorrectly.
This is due to it storing the result in a static buffer, and the
routine being called like:
printf("....", ..., timeprnt(btime), timeprnt(itime), ...)
The problem becomes very obvious if you change one of the default
grace periods to be much larger than the other one.
Changed timeprnt to dynamically allocate the string to be displayed.
syrinx [Sun, 4 Feb 2007 13:31:05 +0000 (13:31 +0000)]
Remove all #if __FreeBSD_version checks now that RSTP support has been
MFCed to RELENG_6. We no longer need that to compile the bridge module
under both RELENG_6 and CURRENT.
dumbbell [Sun, 4 Feb 2007 12:47:52 +0000 (12:47 +0000)]
Synaptics TouchPad seems to go back to Relative Mode after the call
to set_controller_command_byte() call; by issueing a Read Mode Byte
command, the touchpad is in Absolute Mode again.
This problem occursed at least on Asus V6V laptops.
joel [Sun, 4 Feb 2007 06:52:33 +0000 (06:52 +0000)]
Orion originally wrote and added these files in 2002/2003, so with his
approval, change the copyright statement to point at him instead of
"FreeBSD, Inc".
Encouraged by: rwatson
Reviewed by: imp
Discussed with and approved by: orion
mpp [Sun, 4 Feb 2007 06:46:57 +0000 (06:46 +0000)]
If quotacheck or edquota reset the block or inode grace time for
a user or group, when the kernel first sees this, it will update
the grace time value. However, it never flags the quota as modified
and the updated value never makes it to the quota data file unless
the user actually makes some other change that would write the
data out.
Fixed to flag the quota as modified if the soft limit has actually
been reached and should be now enforced.
mpp [Sun, 4 Feb 2007 06:33:15 +0000 (06:33 +0000)]
If two files systems, /a and /b are marked as having quotas enabled
in fstab and they are normally mounted as /a/b, if /b is not mounted,
the various quota utilities will incorrectly operate with the quotas on
/a (silently) when operations are attemted on /b.
Sync up all the hasquota() routines between all the different
quota utilities and change it to detect if the file system we are
attempting to perform quota operations on is not currently mounted
and warn the user accordingly.
imp [Sun, 4 Feb 2007 06:33:13 +0000 (06:33 +0000)]
Patches to allow one to allow one to specify a directory to chroot to.
This includes support for running a script to setup that directory.
The kenv variables init_chroot and init_script control this behavior,
and are documented in loader(8) that's about to be committed (along
with the other variables like init_path...).
Submitted by: Oliver Fromme
Reviewed by: myself, jhb (earlier versions)
mpp [Sun, 4 Feb 2007 01:41:32 +0000 (01:41 +0000)]
If quotas are not currently enabled for a file system, edquota -p
will operate directly on the quota file. It will incorrectly write
the prototype user's usage information for each new quota it sets.
Fixed to read in the current quota information and update the
file correctly.
If quotas are enabled the kernel handles this case fine.
imp [Sat, 3 Feb 2007 16:33:47 +0000 (16:33 +0000)]
Fix non-use, but not memory leak, of devinfop. Set the device's
description here. The fix in the PR isn't necessary at all for memory
leaks, but we weren't setting the device description.
While I'm here, remove some of the obfuscating macros in attach.
imp [Sat, 3 Feb 2007 16:19:28 +0000 (16:19 +0000)]
Fix memory leak of devinfo. The leak itself was documented in
PR/108719, but there's a simpler fix: free it after it is used, and
then get rid of the redundant frees this causes. Other leaks in this
PR not yet fixed.
While I'm here, remove NetBSD/OpenBSD code and some of the portability
#defines that were getting in the way of understanding this code. The
devinfo bug was harder to spot because one needed to know that
device_set_desc_copy() was used inside of one of them (one that didn't
take an argument!).
Prefer device_printf(sc->sc_dev, "...") to printf("%s:...",
device_get_nameunit(sc->sc_dev)). This saves almost 300 bytes.
mpp [Sat, 3 Feb 2007 11:20:28 +0000 (11:20 +0000)]
Do not touch the block or i-node grace times for id 0.
These are used to indicate the default grace period for
the file system, and should not be touched by quotacheck.
bms [Sat, 3 Feb 2007 07:49:20 +0000 (07:49 +0000)]
Style; remove argument names from prototype, be consistent with
rest of file.
This has the additional side-effect of removing a C++ reserved keyword
from this file, which prevents the Click Modular Router's FreeBSD
kernel support from building.
bms [Sat, 3 Feb 2007 02:57:45 +0000 (02:57 +0000)]
Drop unicast Ethernet frames not destined for the configured address
of a tap(4) instance, if IFF_PROMISC is not set.
In tap(4), we should emulate the effect IFF_PROMISC would have on
hardware, otherwise we risk introducing layer 2 loops if tap(4) is
used with bridges. This means not even bpf(4) gets to see them.
This patch has been tested in a variety of situations. Multicast and
broadcast frames are correctly allowed through. I have observed this
behaviour causing problems with multiple QEMU instances hosted on
the same FreeBSD machine.
The checks in in ether_demux() [if_ethersubr.c, rev 1.222, line 638]
are insufficient to prevent this bug from occurring, as ifp->if_vlantrunk
will always be NULL for the non-vlan case.
pjd [Sat, 3 Feb 2007 00:12:18 +0000 (00:12 +0000)]
Add support for multiple exports files. This will be useful for example for
ZFS, where we have automatically generated /etc/zfs/exports file, which
should not be edited directly.
bms [Fri, 2 Feb 2007 21:10:37 +0000 (21:10 +0000)]
For the IPv4 multicast membership socket regression test:
Add command line flags to increase the number of test iterations.
Be deterministic by default, for automated operation.
Better document assumptions.
bms [Fri, 2 Feb 2007 20:31:44 +0000 (20:31 +0000)]
Comply with RFC 3927, by forcing ARP replies which contain a source
address within the link-local IPv4 prefix 169.254.0.0/16, to be
broadcast at link layer.
jhb [Fri, 2 Feb 2007 19:54:17 +0000 (19:54 +0000)]
- Teach pciconf(8) to list the PCI capabilities supported by each device
via a new -c flag to be used with -l. Some simple parsing code is
present for the following capabilities: Power Management, AGP, VPD,
MSI, PCI-X, HyperTransport, Vendor-specific, EHCI Debug Port, PCI-PCI
bridge subvendor ID, PCI-express, and MSI-X.
- Fix a few warnings in pciconf.c.
- Update some cruft in pciconf(8):
- PCI 2.1 is no longer a revolutionary standard, and subvendor ID's are
fairly common at this point, so reflect that.
- Header type 2 is used for PCI-CardBus bridges.
- Describe the -v option for -l after completing the basic -l description
instead of disrupting the flow in the middle.
bms [Fri, 2 Feb 2007 18:34:18 +0000 (18:34 +0000)]
Expose smoothed RTT and RTT variance measurements to userland via
socket option TCP_INFO.
Note that the units used in the original Linux API are in microseconds,
so use a 64-bit mantissa to convert FreeBSD's internal measurements
from struct tcpcb from ticks.
ambrisko [Fri, 2 Feb 2007 16:26:15 +0000 (16:26 +0000)]
Based on input from ru & rodrigc document the mount operation in the new
world order:
mount -t linsysfs linsys /compat/linux/sys
instead of mount_linsysfs. Now that 6.X requires mount_linsysfs to
work. This is why there is a mount_linsysfs in 6.X and not in -current.
joel [Fri, 2 Feb 2007 13:39:20 +0000 (13:39 +0000)]
Clean up the BSD license to match the preferred license in
/usr/share/examples/etc/bsd-style-copyright. I've fixed a
few minor wording and formatting differences.
Approved by: luigi, Hannu Savolainen <hannu@opensound.com>