Commit Graph

155505 Commits

Author SHA1 Message Date
delphij
67cfc8aca6 Simplify the logic when determining whether to zero out a db file to after
open().  The previous logic only initializes the database when O_CREAT is
set, but as long as we can open and write the database, and the database
is empty, we should initialize it anyway.

Obtained from:	OpenBSD
2009-03-28 07:09:51 +00:00
delphij
643b09b140 - If (keysize+datasize)%(bsize=14)==0, insertion of a `big key' would cause
an invariant (actually, an ugly hack) to fail, and all Hell would break
   loose.

   When deleting a big key, the offset of an empty page should be bsize, not
   bsize-1; otherwise an insertion into the empty page will cause the new key to
   be elongated by 1 byte.

   Make the packing more dense in a couple of cases.

 - fix NULL dereference exposed on big bsize values;

Obtained from:	NetBSD via OpenBSD
2009-03-28 06:47:05 +00:00
delphij
e486185356 Avoid NULL deference which causes DEBUG1 to crash, not to print useful
information.

Obtained from:	OpenBSD
2009-03-28 06:40:48 +00:00
delphij
8d5f207dd1 - Avoid overwriting the cursor page when the cursor page becomes the
LRU page.
 - Fix for sequential retrieval failure when using large key/data pairs.

Obtained from:	OpenBSD
2009-03-28 06:38:31 +00:00
delphij
be23f69f40 Fix a crash when iterating over a hash and removing its elements.
Obtained from:	OpenBSD
2009-03-28 06:30:43 +00:00
delphij
7a713ce8b4 Only squeeze a short key/value pair onto a page with other complete key/value
pairs, not onto a page containing the end of a big pair.

Obtained from:	NetBSD via OpenBSD
2009-03-28 06:25:33 +00:00
delphij
1f25699513 Diff reduce against OpenBSD, no functional change. 2009-03-28 06:23:10 +00:00
imp
364bd8e1bf When reading via memory, read in (amount + 1) / 2 (to properly round
up) rather than amount + 1 / 2, which is the same as amount, or 2x too
many words which leads to data corruption.

# This fixes the sbdrop panics I was seeing with the Toshiba LANCT00A.
2009-03-28 06:22:11 +00:00
delphij
b0050a5c17 Return meaningful errno in overflow case; print error message to stderr
in one more case.

Obtained from:	NetBSD via OpenBSD
2009-03-28 06:12:39 +00:00
delphij
f7cf5b5c6b Use pread(2) and pwrite(2) instead of lseek(2) + read(2) / write(2).
Obtained from:	NetBSD via OpenBSD
2009-03-28 06:05:53 +00:00
delphij
13f44a2a24 db/btree/bt_open.c: check return value of snprintf() and return value
if the result is truncated.

db/hash/hash_page.c: use the same way to create temporary file as
bt_open.c; check snprintf() return value.

Obtained from:	OpenBSD
2009-03-28 05:57:27 +00:00
delphij
21b00fc42b Several signed/unsigned warning fixes. 2009-03-28 05:45:29 +00:00
imp
6485024301 It turns out that the Toshiba LANCT00A PC Card is really like the
Toshiba PCETC ISA card, and even has the same board type code in the
card ID (0x14).  So, for this card, call ed_probe_WD80x3_generic after
setting things up apropriately.  This makes the card attach and kinda
work (I'm seeing panics in sbdrop).  Since history has shown that the
WD80x3 probe routine is dangerous, only do it for this card.  Also,
disable the memory range check to make sure it is an valid ISA memory.
I think that it is bogus, but I'm not 100% sure, for these cards.

I removed probing for the WD80x3 in 2005 when I added support for the
AX88x90 and DL100xx cards since none of my cards had ever matched it
and PAO3 removed it and none of the cards in their database died.

It is possible there are other quirks about this card too, since no
other open source OS supports it, or even claims to support it.  But
it was a fun half hour hack...
2009-03-28 04:56:56 +00:00
delphij
38e77f4482 When allocating memory, zero out them if we don't intend to overwrite them
all; before freeing memory, zero out them before we release it as free
heap.  This will eliminate some potential information leak issue.

While there, remove the PURIFY option.  There is a slight difference between
the new behavior and the old -DPURIFY behavior, with the latter initializes
memory with 0xff's.  The difference between old and new approach does not
generate observable difference.

Obtained from:	OpenBSD (partly).
2009-03-28 04:00:46 +00:00
trasz
2f83429b40 Add new V* constants, neccessary for granular permission checks
in NFSv4 ACLs.  While here, get rid of VALLPERM; it wasn't used anyway.

Approved by:	rwatson (mentor)
2009-03-27 21:47:56 +00:00
ru
3c7ac9d092 Add explicit test so that non-existence of /usr/games/fortune
doesn't affect command exit status.
2009-03-27 21:13:14 +00:00
imp
8ef6e46753 Sort NECINFORTIA correctly. 2009-03-27 20:40:17 +00:00
imp
c45a05b263 Add bromax axnet based cards to the mix. This was harvested from the linux
driver.  Not sure who sold it/rebadged it.

Add stub entries for Mitsubishi B8895 and Toshiba LANCT00A to the
driver with a comment that they don't work /* NG */.[*] These are
DP83902A based cards, which should work, but don't seem to.  Likely
they are from the days before the ne2000 roamed the earth and use a
non-standard hookup (see if_ed_isa or if_ed_cbus for some examples).
Unless I happen to stumble into the right one, these may never work,
but I'm tired of omitting them from commits.

[*] The Japanese adopted OK from English, but also use NG for its
opposite.
2009-03-27 19:15:28 +00:00
ed
66aaf53891 Don't strip TTY device name to the last '/'.
We've seen this bug in other applications before: we have some
applications that use strrchr(tty, '/') on the TTY device name. This
isn't valid when using pts(4), because the device name will be stripped
to "0" instead of "pts/0".

This fixes issues with login(1) ignoring /etc/ttys and missing utmp
records.

Reported by:	Barney Cordoba <barney_cordoba yahoo com>
Reviewed by:	rwatson
2009-03-27 19:13:36 +00:00
imp
ebbff345ac Harvest a previously unknown Bromax design based on the AX88x90 from
the Linux axnet driver.
2009-03-27 19:08:15 +00:00
ambrisko
b6f7b6df88 Revert 190445 change to this file restoring:
typedef l_long          l_off_t;
Change l_mmap_argv's to l_ulong for pgoff.  This restores prior behaviour
to consumers of l_off_t but allows mmap to mmap a 32bit position which a
Linux application requires to access SMBIOS data via /dev/mem.

Reviewed by:	dchagin
Prompted by:	rdivacky
2009-03-27 17:00:49 +00:00
thompsa
92faf03fe9 The buffer start and end phys addresses should be 0x0 for an OHCI zero length
packet, this fixes LS/FS devices on the Gateworks 2348 XScale board.

Reviewed by:	HPS
2009-03-27 16:56:01 +00:00
kib
642970135f Correct typo.
Noted by:	kensmith
2009-03-27 15:46:02 +00:00
jamie
5a5a677581 Whitespace/spelling fixes in advance of upcoming functional changes.
Approved by:	bz (mentor)
2009-03-27 13:13:59 +00:00
dds
f8bd382c24 Document missing requests. 2009-03-27 11:03:02 +00:00
marcel
1525b2b738 Sharpen the saw:
o  BSD uses 32-bit block numbers. Limit the scheme to 2^32-1
   blocks when the media is larger.
2009-03-27 05:48:42 +00:00
jmallett
0d55e76419 Put the "%d retries" debug message in the transmit path behind WPI_DEBUG_TX
rather than behind a seemingly accidental constant likely left over from one of
the related drivers which uses log levels rather than per-facility debugging
flags.  This should get rid of contextless messages on the console for people
who have not set (or cleared the default) debugging flags.
2009-03-27 05:44:53 +00:00
marcel
a0c7aba2c2 Sharpen the saw:
o  Don't create an APM scheme underneath another scheme when
   the probe doesn't allow it.
o  APM uses 32-bit block numbers. Limit the scheme to 2^32-1
   blocks when the media is larger.
2009-03-27 05:35:12 +00:00
thompsa
8caa2c2d5c Skip the allocation of the root hold token if the mount already happened. 2009-03-27 03:52:08 +00:00
nyan
ba46cd63d8 MFi386: r190447
Convert gdt_segs and ldt_segs initialization to C99 style.
2009-03-27 03:45:42 +00:00
jmallett
fc9e668b4b o) Check that no overrun or CRC errors were encountered in receiving a
packet.  Linux, OpenBSD and our iwn(4) all do this.  It also results in
   a huge performance improvement (and the rejection of a fair number of
   apparently-bad packets on receive) on my hardware.
o) Like the wpi(4) driver in OpenBSD, and like our iwn(4), also drop runt
   packets.
o) Don't bother doing IFQ_POLL and then IFQ_DRV_DEQUEUE, just do
   IFQ_DRV_DEQUEUE outright.  This is more similar to how OpenBSD and our
   iwn(4) work.

Reviewed by:	sam
2009-03-27 03:17:25 +00:00
sam
49554374b0 add superg+tdma include files for protocol defs needed to do ie parsing 2009-03-26 21:29:38 +00:00
sam
37e13d2174 o move tdma+superg protocol defs out of public view
o add #ifdef _KERNEL to superg+tdma include files so they can be used
  by user code to get the protocol defs
2009-03-26 21:29:03 +00:00
jhb
f369da4f05 Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe() and
into acpi_cpu_startup() which is where all the other code to update this
global variable lives.  This fixes a bug where cpu_cx_count was not updated
correctly if acpi_cpu_generic_cx_probe() returned early.

PR:		kern/108581
Debugged by:	Bruce Cran
Reviewed by:	avg, njl, sepotvin
MFC after:	3 days
2009-03-26 21:10:35 +00:00
ambrisko
c42156f938 Sigh, not my day. Check-in the update version that didn't have
the linux_compat mistakes.
2009-03-26 20:23:21 +00:00
ambrisko
38e96b78a5 Add in forgotten module ipmi_linux.
Found by:	mlaier
2009-03-26 19:15:31 +00:00
sam
382385b98b Fix enough bits so that fast frames work again:
o include ath ie in beacon frames
o fix probe response check for including ath ie
o add ieee80211_add_athcap shorthand for ap-side ie additions
2009-03-26 19:13:11 +00:00
sam
9ca2b364da dynamic turbo mode is only implemented in sta mode; don't enable it
for other operating modes based on the capability
2009-03-26 19:07:56 +00:00
sam
bea67b16d2 need to adjust htinfo offset when csa is inserted 2009-03-26 19:06:00 +00:00
sam
3eec009b3e adjust tdma ie offset when beacon frame contents changes 2009-03-26 19:04:11 +00:00
kib
a7383c9a55 Convert gdt_segs and ldt_segs initialization to C99 style.
Reviewed by:	jhb
2009-03-26 18:07:13 +00:00
imp
fbddcbbc7a Allow the attach routine to fail gracefully and not panic the system. 2009-03-26 17:36:19 +00:00
ambrisko
ac334eb30e Add stuff to support upcoming BMC/IPMI flashing of newer Dell machine
via the Linux tool.
     -  Add Linux shim to ipmi(4)
     -  Create a partitions file to linprocfs to make Linux fdisk see
        disks.  This file is dynamic so we can see disks come and go.
     -  Convert msdosfs to vfat in mtab since Linux uses that for
        msdosfs.
     -  In the Linux mount path convert vfat passed in to msdosfs
        so Linux mount works on FreeBSD.  Note that tasting works
        so that if da0 is a msdos file system
                /compat/linux/bin/mount /dev/da0 /mnt
        works.
     -  fix a 64it bug for l_off_t.
Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to
/compat/linux/etc/mtab and then some careful unpacking of the Linux bmc
update tool and hacking makes it work on newer Dell boxes.  Note, probably
if you can't figure out how to do this, then you probably shouldn't be
doing it :-)
2009-03-26 17:14:22 +00:00
marcel
6164bdbd68 Change the priority from high to normal. This makes sure that
the BSD or GPT schemes can take precedence as appropriate.
2009-03-26 16:42:24 +00:00
luigi
001377e4de there is no dev_mkdb anymore 2009-03-26 10:22:40 +00:00
weongyo
1c15273d2d bump date.
Pointed by:	yongari
2009-03-26 06:12:04 +00:00
weongyo
7162ef3e3e adds malo(4). 2009-03-26 04:17:35 +00:00
weongyo
bab6f48e31 bwi(4) and mwl(4) doesn't exist at CURRENT. 2009-03-26 04:16:40 +00:00
weongyo
419b0186d1 The malo(4) device driver first appeared in FreeBSD 7.1 not 8.0.
Reported by:	John <lists_at_reiteration.net>
MFC after:	3 days
2009-03-26 02:59:10 +00:00
rnoland
71edadf45e Fix up waiting on vblank again... This reverts a last minute change that
I made on the last patch, it seems to upset suspend/resume and shutdown.

MFC after:	3 days
2009-03-26 02:10:18 +00:00