]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years ago- Add support for loading passphrase from a file (-J and -j options).
pjd [Sat, 25 Sep 2010 17:38:57 +0000 (17:38 +0000)]
- Add support for loading passphrase from a file (-J and -j options).
  This is especially useful for things like installers, where regular
  geli prompt can't be used.
- Add support for specifing multiple -K or -k options, so there is no
  need to cat all keyfiles and read them from standard input.

Requested by: Kris Moore <kris@pcbsd.org>, thompsa
MFC after: 2 weeks

13 years agoDon't hardcode md0 in message, use $md instead.
pjd [Sat, 25 Sep 2010 15:37:41 +0000 (15:37 +0000)]
Don't hardcode md0 in message, use $md instead.

Reported by: Ronald Klop <ronald-freebsd8@klop.yi.org>

13 years agoDon't leave zombies behind.
trasz [Sat, 25 Sep 2010 14:54:31 +0000 (14:54 +0000)]
Don't leave zombies behind.

13 years agoAdd a shell script to generate a test script for trivial ACLs.
trasz [Sat, 25 Sep 2010 14:33:35 +0000 (14:33 +0000)]
Add a shell script to generate a test script for trivial ACLs.

13 years agoUpdate regression tests after AES-XTS addition.
pjd [Sat, 25 Sep 2010 10:34:42 +0000 (10:34 +0000)]
Update regression tests after AES-XTS addition.

MFC after: 2 weeks

13 years ago- Use $md instead of md0, which fixes tests when md(4) device is already
pjd [Sat, 25 Sep 2010 10:34:11 +0000 (10:34 +0000)]
- Use $md instead of md0, which fixes tests when md(4) device is already
  present.
- Correct message - we create GPT, not MBR.

MFC after: 2 weeks

13 years agoFix two copy&paste bugs.
pjd [Sat, 25 Sep 2010 10:32:52 +0000 (10:32 +0000)]
Fix two copy&paste bugs.

MFC after: 2 weeks

13 years agoChange g_eli_debug to int, so one can turn off any GELI output by setting
pjd [Sat, 25 Sep 2010 10:32:04 +0000 (10:32 +0000)]
Change g_eli_debug to int, so one can turn off any GELI output by setting
kern.geom.eli.debug sysctl to -1.

MFC after: 2 weeks

13 years agoIgnore errors from BIO_FLUSH. It might confuse users that provider wasn't
pjd [Sat, 25 Sep 2010 10:31:05 +0000 (10:31 +0000)]
Ignore errors from BIO_FLUSH. It might confuse users that provider wasn't
really killed. What we really care about are write errors only.

MFC after: 2 weeks

13 years agoOnly access unwind_disabled when _PTHREAD_FORCED_UNWIND is defined.
davidxu [Sat, 25 Sep 2010 09:43:24 +0000 (09:43 +0000)]
Only access unwind_disabled when _PTHREAD_FORCED_UNWIND is defined.

13 years agoLog the number of segments currently in the reassembly queue.
lstewart [Sat, 25 Sep 2010 09:16:46 +0000 (09:16 +0000)]
Log the number of segments currently in the reassembly queue.

Sponsored by: FreeBSD Foundation

13 years agoAdd missing field.
davidxu [Sat, 25 Sep 2010 08:36:46 +0000 (08:36 +0000)]
Add missing field.

13 years agoAdd Planex UE-200TX-G2 to list of supported devices.
sanpei [Sat, 25 Sep 2010 08:19:34 +0000 (08:19 +0000)]
Add Planex UE-200TX-G2 to list of supported devices.

MFC after: 1 day

13 years agoBecause old _pthread_cleanup_push/pop do not have frame address,
davidxu [Sat, 25 Sep 2010 06:27:09 +0000 (06:27 +0000)]
Because old _pthread_cleanup_push/pop do not have frame address,
it is incompatible with stack unwinding code, if they are invoked,
disable stack unwinding for current thread, and when thread is
exiting, print a warning message.

13 years agoInternalise reassembly queue related functionality and variables which should
lstewart [Sat, 25 Sep 2010 04:58:46 +0000 (04:58 +0000)]
Internalise reassembly queue related functionality and variables which should
not be used outside of the reassembly queue implementation. Provide a new
function to flush all segments from a reassembly queue and call it from the
appropriate places instead of manipulating the queue directly.

Sponsored by: FreeBSD Foundation
Reviewed by: andre, gnn, rpaulo
MFC after: 2 weeks

13 years agoRemove clauses 3 and 4, per changes to NetBSD versions of these files.
imp [Sat, 25 Sep 2010 04:41:42 +0000 (04:41 +0000)]
Remove clauses 3 and 4, per changes to NetBSD versions of these files.

13 years agoo) Send mbufs to BPF listeners from within cvm_oct_xmit().
jmallett [Sat, 25 Sep 2010 04:39:12 +0000 (04:39 +0000)]
o) Send mbufs to BPF listeners from within cvm_oct_xmit().
o) Pin receive threads when they're running since we do access some core-local
   resources.

13 years agoAdd test cases for stack unwinding.
davidxu [Sat, 25 Sep 2010 04:26:40 +0000 (04:26 +0000)]
Add test cases for stack unwinding.

13 years agoSimplify code, and in while loop, fix operator to match the unwinding
davidxu [Sat, 25 Sep 2010 04:21:31 +0000 (04:21 +0000)]
Simplify code, and in while loop, fix operator to match the unwinding
direction.

13 years agoTo support stack unwinding for cancellation points, add -fexceptions flag
davidxu [Sat, 25 Sep 2010 01:57:47 +0000 (01:57 +0000)]
To support stack unwinding for cancellation points, add -fexceptions flag
for them, two functions _pthread_cancel_enter and _pthread_cancel_leave
are added to let thread enter and leave a cancellation point, it also
makes it possible that other functions can be cancellation points in
libraries without having to be rewritten in libthr.

13 years agoHandle link updates in a task.
jmallett [Sat, 25 Sep 2010 01:18:01 +0000 (01:18 +0000)]
Handle link updates in a task.

13 years agoTake mpt_req_on_{free,pending}_list() out from under INVARIANTS as these
marius [Fri, 24 Sep 2010 23:54:03 +0000 (23:54 +0000)]
Take mpt_req_on_{free,pending}_list() out from under INVARIANTS as these
are generally useful and not just for debugging.

13 years agoMake the vast majority of Simple Executive files standard. Perhaps some of
jmallett [Fri, 24 Sep 2010 21:23:23 +0000 (21:23 +0000)]
Make the vast majority of Simple Executive files standard.  Perhaps some of
these could be made dependent on either of the octusb or octe options, but
making them standard fixes a number of option combinations that were previously
broken.

13 years agoAdd gptboot script that is responsible for:
pjd [Fri, 24 Sep 2010 19:53:55 +0000 (19:53 +0000)]
Add gptboot script that is responsible for:
- looking for partition with 'bootonce' attribute alone (without 'bootme'
  attribute), removing it and logging that we successfully booted from this
  partition.
- looking for partitions with 'bootfailed' attribute, removing it and
  logging that we failed to boot from this partition.

Reviewed by: arch (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>)
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
MFC after: 2 weeks

13 years ago- Split code shared by almost any boot loader into separate files and
pjd [Fri, 24 Sep 2010 19:49:12 +0000 (19:49 +0000)]
- Split code shared by almost any boot loader into separate files and
  clean up most layering violations:

sys/boot/i386/common/rbx.h:

RBX_* defines
OPT_SET()
OPT_CHECK()

sys/boot/common/util.[ch]:

memcpy()
memset()
memcmp()
bcpy()
bzero()
bcmp()
strcmp()
strncmp() [new]
strcpy()
strcat()
strchr()
strlen()
printf()

sys/boot/i386/common/cons.[ch]:

ioctrl
putc()
xputc()
putchar()
getc()
xgetc()
keyhit() [now takes number of seconds as an argument]
getstr()

sys/boot/i386/common/drv.[ch]:

struct dsk
drvread()
drvwrite() [new]
drvsize() [new]

sys/boot/common/crc32.[ch] [new]

sys/boot/common/gpt.[ch] [new]

- Teach gptboot and gptzfsboot about new files. I haven't touched the
  rest, but there is still a lot of code duplication to be removed.

- Implement full GPT support. Currently we just read primary header and
  partition table and don't care about checksums, etc. After this change we
  verify checksums of primary header and primary partition table and if
  there is a problem we fall back to backup header and backup partition
  table.

- Clean up most messages to use prefix of boot program, so in case of an
  error we know where the error comes from, eg.:

gptboot: unable to read primary GPT header

- If we can't boot, print boot prompt only once and not every five
  seconds.

- Honour newly added GPT attributes:

bootme - this is bootable partition
bootonce - try to boot from this partition only once
bootfailed - we failed to boot from this partition

- Change boot order of gptboot to the following:

1. Try to boot from all the partitions that have both 'bootme'
   and 'bootonce' attributes one by one.
2. Try to boot from all the partitions that have only 'bootme'
   attribute one by one.
3. If there are no partitions with 'bootme' attribute, boot from
   the first UFS partition.

- The 'bootonce' functionality is implemented in the following way:

1. Walk through all the partitions and when 'bootonce'
   attribute is found without 'bootme' attribute, remove
   'bootonce' attribute and set 'bootfailed' attribute.
   'bootonce' attribute alone means that we tried to boot from
   this partition, but boot failed after leaving gptboot and
   machine was restarted.
2. Find partition with both 'bootme' and 'bootonce' attributes.
3. Remove 'bootme' attribute.
4. Try to execute /boot/loader or /boot/kernel/kernel from that
   partition. If succeeded we stop here.
5. If execution failed, remove 'bootonce' and set 'bootfailed'.
6. Go to 2.

   If whole boot succeeded there is new /etc/rc.d/gptboot script coming
   that will log all partitions that we failed to boot from (the ones with
   'bootfailed' attribute) and will remove this attribute. It will also
   find partition with 'bootonce' attribute - this is the partition we
   booted from successfully. The script will log success and remove the
   attribute.

   All the GPT updates we do here goes to both primary and backup GPT if
   they are valid. We don't touch headers or partition tables when
   checksum doesn't match.

Reviewed by: arch (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>)
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
MFC after: 2 weeks

13 years agoAllow to configure GPT attributes. It shouldn't be allowed to set bootfailed
pjd [Fri, 24 Sep 2010 19:33:47 +0000 (19:33 +0000)]
Allow to configure GPT attributes. It shouldn't be allowed to set bootfailed
attribute (it should be allowed only to unset it), but for test purposes it
might be useful, so the current code allows it.

Reviewed by: arch@ (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>)
MFC after: 2 weeks

13 years agoAdd three GPT attributes:
pjd [Fri, 24 Sep 2010 19:31:08 +0000 (19:31 +0000)]
Add three GPT attributes:

GPT_ENT_ATTR_BOOTME - this is bootable partition

GPT_ENT_ATTR_BOOTONCE - try to boot only once from this partition

GPT_ENT_ATTR_BOOTFAILED - set this flag if we cannot boot from partition
containing GPT_ENT_ATTR_BOOTONCE flag; note that if we cannot
boot from partition that contains only GPT_ENT_ATTR_BOOTME flag,
the GPT_ENT_ATTR_BOOTFAILED flag won't be set

According to wikipedia Microsoft TechNet says that attributes are divided into
two halves: the lower 4 bytes representing partition independent attributes,
and the upper 4 bytes are partition type dependent. Microsoft is already using
bits 60 (read-only), 62 (hidden) and 63 (do not automount) and I'd like to not
collide with those, so we are using bit 59 (bootme), 58 (bootonce) and 57
(bootfailed).

Reviewed by: arch (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>)
MFC after: 2 weeks

13 years agoReported problem:
mckusick [Fri, 24 Sep 2010 19:08:56 +0000 (19:08 +0000)]
Reported problem:
Large (60GB) filesystems created using "newfs -U -O 1 -b 65536 -f 8192"
show incorrect results from "df" for free and used space when mounted
immediately after creation. fsck on the new filesystem (before ever
mounting it once) gives a "SUMMARY INFORMATION BAD" error in phase 5.

This error hasn't occurred in any runs of fsck immediately after
"newfs -U -b 65536 -f 8192" (leaving out the "-O 1" option).

Solution:
The default UFS1 superblock is located at offset 8K in the filesystem
partition; the default UFS2 superblock is located at offset 64K in
the filesystem partition. For UFS1 filesystems with a blocksize of
64K, the first alternate superblock resides at 64K which is the the
location used for the default UFS2 superblock. By default, the
system first checks for a valid superblock at the default location
for a UFS2 filoesystem. For a UFS1 filesystem with a blocksize of
64K, there is a valid UFS1 superblock at this location.  Thus, even
though it is expected to be a backup superblock, the system will
use it as its default superblock. So, we have to ensure that all the
statistcs on usage are correct in this first alternate superblock
as it is the superblock that will actually be used.

While tracking down this problem, another limitation of UFS1 became
evident. For UFS1, the number of inodes per cylinder group is stored
in an int16_t. Thus the maximum number of inodes per cylinder group
is limited to 2^15 - 1. This limit can easily be exceeded for block
sizes of 32K and above. Thus when building UFS1 filesystems, newfs
must limit the number of inodes per cylinder group to 2^15 - 1.

Reported by: Guy Helmer<ghelmer@palisadesys.com>
Followup by: Bruce Cran <brucec@freebsd.org>
PR:          107692
MFC after:   4 weeks

13 years agoImprove r56796; the reply handler actually may remove the request from
marius [Fri, 24 Sep 2010 16:40:46 +0000 (16:40 +0000)]
Improve r56796; the reply handler actually may remove the request from
the chain in which case it shouldn't be removed twice.
Reported by: Staale Kristoffersen

MFC after: 1 week

13 years agominor simplifications and cosmetics
marius [Fri, 24 Sep 2010 15:12:18 +0000 (15:12 +0000)]
minor simplifications and cosmetics

13 years agoMake the RPC specific __rpc_inet_ntop() and __rpc_inet_pton() general
attilio [Fri, 24 Sep 2010 15:01:45 +0000 (15:01 +0000)]
Make the RPC specific __rpc_inet_ntop() and __rpc_inet_pton() general
in the kernel (just as inet_ntoa() and inet_aton()) are and sync their
prototype accordingly with already mentioned functions.

Sponsored by: Sandvine Incorporated
Reviewed by: emaste, rstone
Approved by: dfr
MFC after: 2 weeks

13 years agoRemove the duplicate logging of failed read requests, whose error message
marius [Fri, 24 Sep 2010 14:44:04 +0000 (14:44 +0000)]
Remove the duplicate logging of failed read requests, whose error message
also was inappropriate as it triggered for every EACCESS and ENOTFOUND, not
just the case the -n option is intended to deal with and thus really spammed
us with ~20 messages in the default configuration when booting a diskless
FreeBSD client, introduced with r207608 again.

MFC after: 1 week

13 years agoIP_BINDANY is not correctly handled in getsockopt() case.
attilio [Fri, 24 Sep 2010 14:38:54 +0000 (14:38 +0000)]
IP_BINDANY is not correctly handled in getsockopt() case.
Fix it by specifying the correct bits.

Sponsored by: Sandvine Incorporated
Reviewed by: bz, emaste, rstone
Obtained from: Sandvine Incorporated
MFC after: 10 days

13 years agoinline testcancel() into thr_cancel_leave(), because cancel_pending is
davidxu [Fri, 24 Sep 2010 13:01:01 +0000 (13:01 +0000)]
inline testcancel() into thr_cancel_leave(), because cancel_pending is
almost false, this makes a slight better branch predicting.

13 years agoMake WARNS=6 clean.
marius [Fri, 24 Sep 2010 10:40:17 +0000 (10:40 +0000)]
Make WARNS=6 clean.

MFC after: 1 week

13 years agoNow userland POSIX semaphore is based on umtx. The kernel module
davidxu [Fri, 24 Sep 2010 09:04:16 +0000 (09:04 +0000)]
Now userland POSIX semaphore is based on umtx. The kernel module
is only used to support binary compatible, if want to run old
binary, you need to kldload the module.

13 years agoImplement "force" (-F) option for gpart destroy verb.
ae [Fri, 24 Sep 2010 08:40:43 +0000 (08:40 +0000)]
Implement "force" (-F) option for gpart destroy verb.
This option doesn't passed to kernel and handled in user-space.
With -F option gpart creates new "delete" request for each
partition in table. Each request has flags="X" that disables
auto-commit feature. Last request is the original "destroy" request.
It has own flags and can have disabled or enabled auto-commit feature.
If error is occurred when deleting partitions, then new "undo" request
is created and all changes will be rolled back.

Approved by: kib (mentor)

13 years agoIn most cases, cancel_point and cancel_async needn't be checked again,
davidxu [Fri, 24 Sep 2010 07:52:07 +0000 (07:52 +0000)]
In most cases, cancel_point and cancel_async needn't be checked again,
because cancellation is almostly checked at cancellation points.

13 years agoAdd missing le32toh(), same as recently done in ata-siliconimage.c.
mav [Fri, 24 Sep 2010 07:14:14 +0000 (07:14 +0000)]
Add missing le32toh(), same as recently done in ata-siliconimage.c.

13 years ago- Do not place variables to memory allocated by busdma. pre/post ops
gonzo [Fri, 24 Sep 2010 04:46:46 +0000 (04:46 +0000)]
- Do not place variables to memory allocated by busdma. pre/post ops
    might invalidate cache and hence effectively void validity of values

13 years agoo) Add bus_teardown_intr for pci and ciu. This allows the Promise SATA
jmallett [Fri, 24 Sep 2010 02:41:52 +0000 (02:41 +0000)]
o) Add bus_teardown_intr for pci and ciu.  This allows the Promise SATA
   driver to try to switch interrupt handlers at setup.  It's not a very
   good implementation of bus_teardown_intr, though.
o) Set cache line size and latency timers for PCI devices per Linux.

13 years agoFlesh out PCI bus support some:
jmallett [Fri, 24 Sep 2010 00:14:24 +0000 (00:14 +0000)]
Flesh out PCI bus support some:
o) Reset and configure the bus from scratch rather than expecting U-Boot to
   do it for us.  Values and configuration from Linux, U-Boot and comments
   in the Cavium Simple Executive sources.
o) Do a resource assignment and bus numbering pass in the absence of a PCI
   BIOS or firmware that will do it for us.
   XXX This has to be the third or fourth instance of this in FreeBSD and
       it would be nice to have it become part of the PCI bus driver itself,
       like it is on Linux.
o) Fix interrupt mapping for and adjust bus configuration for the Lanner
   MR-955, based on information provided by Lanner.

13 years agoAlways show asic/chip revision in device attach phase. There are
yongari [Thu, 23 Sep 2010 18:55:54 +0000 (18:55 +0000)]
Always show asic/chip revision in device attach phase. There are
too many bge(4) controllers there and model name does not
necessarily match asic/chip revision. Relying on VPD string made
it hard to identify exact asic/chip revision so the first step to
debug bge(4) was getting exact asic/chip information with verbose
boot which may not be available on production server.

13 years agoRemove unnecessary weak reference that was apparently copied from the
emaste [Thu, 23 Sep 2010 17:47:46 +0000 (17:47 +0000)]
Remove unnecessary weak reference that was apparently copied from the
version of this function in lib/libc/inet/inet_pton.c

MFC after:     1 week

13 years agoClean up stray line in 213077
imp [Thu, 23 Sep 2010 17:29:59 +0000 (17:29 +0000)]
Clean up stray line in 213077

13 years agoSimplify how we find the kernel source. Rather than depending on sys,
imp [Thu, 23 Sep 2010 17:12:47 +0000 (17:12 +0000)]
Simplify how we find the kernel source.  Rather than depending on sys,
or some variation in the path, the new version assumes that $0 is
newvers.sh path, and that dirname $0/.. is the same as $S aka $SYSDIR.
It also removes knowledge of ${MACHINE} and ${MACHINE_ARCH}, which is
also good.

# I've had this in my tree for about 6 months now, which is why I
# didn't notice that I broke it in r209510 and that was fixed in
# r212954.  This should finally resolve the issues people had with
# r204824 as well as address the issues that motivated r204824.

13 years agoTry to adhere to style.Makefile(5).
marius [Thu, 23 Sep 2010 14:06:15 +0000 (14:06 +0000)]
Try to adhere to style.Makefile(5).

MFC after: 3 days

13 years ago- Simplify code by using g_*() API.
pjd [Thu, 23 Sep 2010 12:04:12 +0000 (12:04 +0000)]
- Simplify code by using g_*() API.
- Don't use u_char and u_int in userland.
- Change 'unsigned' to 'unsigned int'.
- Update copyright years.

MFC after: 1 week

13 years agoUpdate copyright years.
pjd [Thu, 23 Sep 2010 12:02:42 +0000 (12:02 +0000)]
Update copyright years.

MFC after: 1 week

13 years agoUpdate copyright years.
pjd [Thu, 23 Sep 2010 12:02:08 +0000 (12:02 +0000)]
Update copyright years.

MFC after: 1 week

13 years agoDocument AES-XTS.
pjd [Thu, 23 Sep 2010 12:00:40 +0000 (12:00 +0000)]
Document AES-XTS.

MFC after: 1 week

13 years agoAdd support for AES-XTS. This will be the default now.
pjd [Thu, 23 Sep 2010 11:58:36 +0000 (11:58 +0000)]
Add support for AES-XTS. This will be the default now.

MFC after: 1 week

13 years agoAdd support for CRYPTO_AES_XTS.
pjd [Thu, 23 Sep 2010 11:57:25 +0000 (11:57 +0000)]
Add support for CRYPTO_AES_XTS.

MFC after: 1 week

13 years agoAdd support for AES-XTS.
pjd [Thu, 23 Sep 2010 11:52:32 +0000 (11:52 +0000)]
Add support for AES-XTS.

Obtained from: OpenBSD
MFC after: 1 week

13 years agoImplement switching of data encryption key every 2^20 blocks.
pjd [Thu, 23 Sep 2010 11:49:47 +0000 (11:49 +0000)]
Implement switching of data encryption key every 2^20 blocks.
This ensures the same encryption key won't be used for more than
2^20 blocks (sectors). This will be the default now.

MFC after: 1 week

13 years agoAdd support for CRD_F_KEY_EXPLICIT flag.
pjd [Thu, 23 Sep 2010 11:46:53 +0000 (11:46 +0000)]
Add support for CRD_F_KEY_EXPLICIT flag.

MFC after: 1 week

13 years agoRemove redundant space.
pjd [Thu, 23 Sep 2010 11:33:29 +0000 (11:33 +0000)]
Remove redundant space.

MFC after: 1 week

13 years agoSimplify code a bit.
pjd [Thu, 23 Sep 2010 11:26:38 +0000 (11:26 +0000)]
Simplify code a bit.

MFC after: 1 week

13 years agoMake the code similar to the code in g_eli_integrity.c.
pjd [Thu, 23 Sep 2010 11:23:10 +0000 (11:23 +0000)]
Make the code similar to the code in g_eli_integrity.c.

MFC after: 1 week

13 years agoDefine default overwrite count, so that userland can use it.
pjd [Thu, 23 Sep 2010 11:19:48 +0000 (11:19 +0000)]
Define default overwrite count, so that userland can use it.

MFC after: 1 week

13 years agoVarious changes from various sources:
gavin [Thu, 23 Sep 2010 11:19:03 +0000 (11:19 +0000)]
Various changes from various sources:

- Add "children" [1]
- Add "acknowledgement", "acknowledgment", "Austria" and "haunted" [2]
- Add "near", "antidisestablishmentarianism" and "Persephone" [2]
- "Transvaal" should be capitalized [2]
- Correct spelling of "structurelessness" and "Athena" [2]
- Add missing atomic elements [3]
- Add various words from "word of the day" lists [3]

PR: conf/149756 [1]
Submitted by: Nick Johnson <freebsd spatula.net> [1]
Obtained from: NetBSD [2], OpenBSD [3]
MFC after: 1 week

13 years ago- When trashing metadata, repeat overwrite kern.geom.eli.overwrites times.
pjd [Thu, 23 Sep 2010 11:18:02 +0000 (11:18 +0000)]
- When trashing metadata, repeat overwrite kern.geom.eli.overwrites times.
- Flush write cache after each write.

MFC after: 1 week

13 years ago- Use g_*() API when doing backups.
pjd [Thu, 23 Sep 2010 11:04:50 +0000 (11:04 +0000)]
- Use g_*() API when doing backups.
- fsync() created filed.

MFC after: 1 week

13 years agoBecause we first write metadata into new place and then trash old place we
pjd [Thu, 23 Sep 2010 10:58:13 +0000 (10:58 +0000)]
Because we first write metadata into new place and then trash old place we
don't want situation where old size is equal to new size, as we will trash
newly written metadata.

MFC after: 1 week

13 years ago- Make use of g_*() API.
pjd [Thu, 23 Sep 2010 10:55:45 +0000 (10:55 +0000)]
- Make use of g_*() API.
- Flush cache after writing metadata.

MFC after: 1 week

13 years agoSimplify code a bit by using g_*() API from libgeom.
pjd [Thu, 23 Sep 2010 10:50:17 +0000 (10:50 +0000)]
Simplify code a bit by using g_*() API from libgeom.

MFC after: 1 week

13 years agoWhen trashing metadata, flush after each write.
pjd [Thu, 23 Sep 2010 10:43:37 +0000 (10:43 +0000)]
When trashing metadata, flush after each write.

MFC after: 1 week

13 years agoRemove an explicit assignment of the CFLAGS variable intended for
marius [Thu, 23 Sep 2010 10:03:03 +0000 (10:03 +0000)]
Remove an explicit assignment of the CFLAGS variable intended for
debugging purposes only.

MFC after: 3 days

13 years agoAdd MIPS platform, this will make bsdlabel(8) work on MIPS (when invoked
jchandra [Thu, 23 Sep 2010 05:24:50 +0000 (05:24 +0000)]
Add MIPS platform, this will make bsdlabel(8) work on MIPS (when invoked
without a -m option. -m mips is still not supported)

13 years agoAdd missing byteswap, works on big endian systems now (tested on Netlogic
jchandra [Thu, 23 Sep 2010 05:17:36 +0000 (05:17 +0000)]
Add missing byteswap, works on big endian systems now (tested on Netlogic
XLS MIPS processor).

Submitted by: Sreekanth M. S. <kanthms at netlogicmicro dot com>
Reviewed by: mav

13 years agoIn the past gunzip(1) write()'s after each inflate return. This is
delphij [Thu, 23 Sep 2010 01:24:33 +0000 (01:24 +0000)]
In the past gunzip(1) write()'s after each inflate return.  This is
not optimal from a performance standpoint since the write buffer is
not necessarily be filled up when the inflate rountine reached the
end of input buffer and it's not the end of file.

This problem gets uncovered by trying to pipe gunzip -c output to
a GEOM device directly, which enforces the writes be multiple of
sector size.

Sponsored by: iXsystems, Inc.
Reported by: jpaetzel
MFC after: 2 weeks

13 years agoAdd the following Linux BlueZ compatibility macros: htobs(), htobl(),
emax [Wed, 22 Sep 2010 23:41:02 +0000 (23:41 +0000)]
Add the following Linux BlueZ compatibility macros: htobs(), htobl(),
btohs() and btohl()

PR: kern/136386
Submitted by: Monty Hall < kungfu_disciple at sbcglobal dot net >
MFC after: 1 week

13 years agoAnd now the 2nd part of the patch: Also fix the year.
edwin [Wed, 22 Sep 2010 21:14:18 +0000 (21:14 +0000)]
And now the 2nd part of the patch: Also fix the year.

PR: 150504
Submitted by: Douglas Berry <bitnix@bitnix.ca>

13 years agoFix location of the Battle of the Plains of Abraham
edwin [Wed, 22 Sep 2010 21:10:45 +0000 (21:10 +0000)]
Fix location of the Battle of the Plains of Abraham

PR: 150504
Submitted by: Douglas Berry <bitnix@bitnix.ca>
MFC after: 1 week

13 years ago- Expand scope of tun/tap softc locks to cover more softc fields and
jhb [Wed, 22 Sep 2010 21:02:43 +0000 (21:02 +0000)]
- Expand scope of tun/tap softc locks to cover more softc fields and
  driver-maintained ifnet fields (such as if_drv_flags).
- Use soft locks as the mutex that protects each interface's knote list
  rather than using the global knote list lock.  Also, use the softc
  for kn_hook instead of the cdev.
- Use mtx_sleep() instead of tsleep() when blocking in the read routines.
  This fixes a lost wakeup race.
- Remove D_NEEDGIANT now that the cdevsw routines use the softc lock
  where locking is needed.
- Lock IFQ when calculating the result for FIONREAD in tap(4).  tun(4)
  already did this.
- Remove remaining spl calls.

Submitted by: Marcin Cieslak  saper of saper|info (3)
MFC after: 2 weeks

13 years agoMove test for zero bufp or size before rseq and wseq calculation. This
emaste [Wed, 22 Sep 2010 19:41:01 +0000 (19:41 +0000)]
Move test for zero bufp or size before rseq and wseq calculation.  This
avoids spinning in an infinite loop for some (possibly corrupt?) core
files at work.

13 years agoCorrect sort order.
emaste [Wed, 22 Sep 2010 19:26:41 +0000 (19:26 +0000)]
Correct sort order.

13 years agoSwitch to sigprocmask(2) API also in the main process and secondary process.
pjd [Wed, 22 Sep 2010 19:08:11 +0000 (19:08 +0000)]
Switch to sigprocmask(2) API also in the main process and secondary process.
This way the primary process inherits signal mask from the main process,
which fixes a race where signal is delivered to the primary process before
configuring signal mask.

Reported by: Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 3 days

13 years agoAssert that descriptor numbers are sane.
pjd [Wed, 22 Sep 2010 19:05:54 +0000 (19:05 +0000)]
Assert that descriptor numbers are sane.

MFC after: 3 days

13 years agoFix possible deadlock where worker process sends an event to the main process
pjd [Wed, 22 Sep 2010 19:03:11 +0000 (19:03 +0000)]
Fix possible deadlock where worker process sends an event to the main process
while the main process sends control message to the worker process, but worker
process hasn't started control thread yet, because it waits for reply from the
main process.

The fix is to start the control thread before sending any events.

Reported and fix suggested by: Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 3 days

13 years agoFix descriptor leaks: when child exits, we have to close control and event
pjd [Wed, 22 Sep 2010 18:57:06 +0000 (18:57 +0000)]
Fix descriptor leaks: when child exits, we have to close control and event
socket pairs. We did that only in one case out of three.

MFC after: 3 days

13 years agoEliminate the --disable-ipv6 string which while technically correct in
dougb [Wed, 22 Sep 2010 18:46:17 +0000 (18:46 +0000)]
Eliminate the --disable-ipv6 string which while technically correct in
terms of the arguments that configure was called with is misleading because
if IPv6 support is present on the system it will be present in BIND.

13 years agoIf we are unable to receive control message is most likely because the main
pjd [Wed, 22 Sep 2010 18:39:43 +0000 (18:39 +0000)]
If we are unable to receive control message is most likely because the main
process died. Instead of entering infinite loop, terminate.

MFC after: 3 days

13 years agoSort includes.
pjd [Wed, 22 Sep 2010 18:38:02 +0000 (18:38 +0000)]
Sort includes.

MFC after: 3 days

13 years agoAdd myself as a ports committer
sunpoet [Wed, 22 Sep 2010 16:54:22 +0000 (16:54 +0000)]
Add myself as a ports committer

Approved by: pgollucci (mentor)

13 years agoFix build breakage introduced in r212972.
yongari [Wed, 22 Sep 2010 16:48:24 +0000 (16:48 +0000)]
Fix build breakage introduced in r212972.

13 years agoCopy td_rqindex during fork instead of zero'ing it to match the comments.
jhb [Wed, 22 Sep 2010 15:10:03 +0000 (15:10 +0000)]
Copy td_rqindex during fork instead of zero'ing it to match the comments.
I do not believe there is any functional change.

13 years agoFor sparc64 relocations that directly put bits of the symbol value into
kib [Wed, 22 Sep 2010 12:52:12 +0000 (12:52 +0000)]
For sparc64 relocations that directly put bits of the symbol value into
the location, apply elf_relocaddr to the symbol value to have right
values for the symbols from dpcpu segment.

PR: kern/147769
Discussed with: avg
Tested by: marius
MFC after: 2 weeks

13 years agoQuick fix for unmotivated C2 state usage during boot, introduced at r212541.
mav [Wed, 22 Sep 2010 11:32:22 +0000 (11:32 +0000)]
Quick fix for unmotivated C2 state usage during boot, introduced at r212541.
That caused LAPIC timer failure and huge delays during boot on some systems.

13 years agokdb_backtrace: use stack_print_ddb instead of stack_print
avg [Wed, 22 Sep 2010 06:45:07 +0000 (06:45 +0000)]
kdb_backtrace: use stack_print_ddb instead of stack_print

This is a followup to r212964.
stack_print call chain obtains linker sx lock and thus potentially may
lead to a deadlock depending on a kind of a panic.
stack_print_ddb doesn't acquire any locks and it doesn't use any
facilities of ddb backend.
Using stack_print_ddb outside of DDB ifdef required taking a number of
helper functions from under it as well.

It is a good idea to rename linker_ddb_* and stack_*_ddb functions to
have 'unlocked' component in their name instead of 'ddb', because those
functions do not use any DDB services, but instead they provide unlocked
access to linker symbol information.  The latter was previously needed
only for DDB, hence the 'ddb' name component.

Alternative is to ditch unlocked versions altogether after implementing
proper panic handling:
1. stop other cpus upon a panic
2. make all non-spinlock lock operations (mutex, sx, rwlock) be a no-op
   when panicstr != NULL

Suggested by: mdf
Discussed with: attilio
MFC after: 2 weeks

13 years agoacpi_attach: do not explicitly install default handlers for default
avg [Wed, 22 Sep 2010 06:10:22 +0000 (06:10 +0000)]
acpi_attach: do not explicitly install default handlers for default
address spaces

There has been no need to do that starting with ACPICA 20040427 as
AcpiEnableSubsystem() installs the handlers automatically.
Additionaly, explicitly calling AcpiInstallAddressSpaceHandler before
AcpiEnableSubsystem is not supported by ACPICA and leads to too early
execution of _REG methods in some DSDTs, which may result in problems.

Big thanks to Robert Moore of ACPICA/Intel for explaining the above.

Reported by: Daniel Bilik <daniel.bilik@neosystem.cz>
Tested by: Daniel Bilik <daniel.bilik@neosystem.cz>
Reviewed by: jkim
Suggested by: "Moore, Robert" <robert.moore@intel.com>
MFC after: 1 week

13 years agoIf kernel built with DEVICE_POLLING, keep one CPU always in active state
mav [Wed, 22 Sep 2010 05:32:37 +0000 (05:32 +0000)]
If kernel built with DEVICE_POLLING, keep one CPU always in active state
to handle it.

13 years agoDecrease poll interval from 1000 to 100us. This significantly reduces
mav [Wed, 22 Sep 2010 05:17:18 +0000 (05:17 +0000)]
Decrease poll interval from 1000 to 100us. This significantly reduces
kernel dump time, especially with minidump.

13 years agoMake the labels match the device name that's mounted, not just the
imp [Wed, 22 Sep 2010 04:48:39 +0000 (04:48 +0000)]
Make the labels match the device name that's mounted, not just the
slice they are on.  When NANO_LABEL is not defined, the fstab
generates entries that specify /dev/ad0s1a.  When NANO_LABEL is
defined, it generates /dev/usb/${NANO_LABEL}s1a.  The prior code
created the file system with a label of ${NANO_LABEL}s1, leading to
problems on boot.

Pointy hat to: imp@

13 years agoEnforce that 'pmap_kenter()' is only used to establish cacheable mappings.
neel [Wed, 22 Sep 2010 02:26:07 +0000 (02:26 +0000)]
Enforce that 'pmap_kenter()' is only used to establish cacheable mappings.

Mappings with other cacheability attributes can be established, if needed,
by using 'pmap_kenter_attr()'.

Suggested by: jchandra, imp

13 years agoAdd new device ids.
sanpei [Tue, 21 Sep 2010 22:42:14 +0000 (22:42 +0000)]
Add new device ids.
 Buffalo (Melco Inc.) LUA3-U2-AGT
 Logitec LAN-GTJ/U2A(usb/119981)

PR: usb/119981 and me
Submitted by: "Y.Okabe" <be_works_us at yahoo.com>, hiroo at oikumene.gcd.org
Reviewed by: thompsa
MFC after: 3 days

13 years agoWhen building world with clang, for gnu/lib/libobjc, sys/boot/i386/boot2
dim [Tue, 21 Sep 2010 21:41:45 +0000 (21:41 +0000)]
When building world with clang, for gnu/lib/libobjc, sys/boot/i386/boot2
and sys/boot/pc98/boot2, do not simply assign 'gcc' to CC, since compile
flags are sometimes passed via this variable, for example during the
build32 stage on amd64.  This caused the 32-bit libobjc build on amd64
to fail.

Instead, only replace the first instance of clang (if any, including
optional path) with gcc, and leave the arguments alone.

Approved-by: rpaulo (mentor)

13 years agoMinor grammar fixes.
brueffer [Tue, 21 Sep 2010 21:07:46 +0000 (21:07 +0000)]
Minor grammar fixes.

13 years agoWorkaround LLVM bug #4434:
rpaulo [Tue, 21 Sep 2010 20:23:19 +0000 (20:23 +0000)]
Workaround LLVM bug #4434:

Reorder inline assembly arguments temp2, temp, value and texp to follow
the st(0), st(1), etc. style.
Also mark the temp2 variable as volatile to workaround another clang
bug.
This allows clang to buildworld FreeBSD/i386.

Submitted by: dim

13 years agoComment nit, set TDF_NEEDRESCHED after the comment describing why it is
jhb [Tue, 21 Sep 2010 19:12:22 +0000 (19:12 +0000)]
Comment nit, set TDF_NEEDRESCHED after the comment describing why it is
done rather than before.

MFC after: 1 week