Linus Torvalds [Tue, 11 Nov 2003 02:52:30 +0000 (18:52 -0800)]
Avoid racy optimization in signal sending.
The bug is probably impossible to trigger on x86, due to its
fairly strong coherency model (the SMP-safe bitops end up being
memory barriers etc), but other architectures - notably ppc64 -
can apparently trigger a race whereby the signal sender doesn't
wake up the target because it doesn't notice that it has gone to
sleep.
The optimization also optimizes only what appears to be the
uncommon case, where the signal happens for an already-running
process.
Since 2.6.x by default does not remap the disk partitions any more, it
would be a good idea to warn when we see EZD or DM signatures. That
informs the user to fix his setup (or pass in "hdx=remap" on the kernel
command line).
Andrew Morton [Sun, 9 Nov 2003 23:18:43 +0000 (15:18 -0800)]
[PATCH] compile fix for voyager with gcc-3.3
From: James Bottomley <James.Bottomley@SteelEye.com>
The cpu_callout_map differs from the prototype in asm-i386/smp.h by a
volatile. gcc-3.3 now treats this as an error, so voyager support will
only compile with older gcc's. The fix is to remove the spurious volatile.
Andrew Morton [Sun, 9 Nov 2003 23:18:35 +0000 (15:18 -0800)]
[PATCH] JBD: fix assertion failure
This fixes a JBD assertion failure (goes BUG) in __journal_remove_journal_head().
When the journal had aborted due to earlier internal consistency errors (or
I/O errors) it is possible that we free journal_heads which still have
attached copyout buffers. So just free them up.
Andrew Morton [Sun, 9 Nov 2003 23:18:26 +0000 (15:18 -0800)]
[PATCH] Fix RAID1 recovery
From: Mike Tran <mhtran@us.ibm.com>
This fixes the RAID1 recovery problems; it seems to be a simple thinko:
sync_request_write() is passing "ok=0" into md_done_sync(). Clearly, `ok'
should be true here.
Andrew Morton [Sun, 9 Nov 2003 23:18:01 +0000 (15:18 -0800)]
[PATCH] ext2 block allocation race fix
If this CPU decides that an ext2 block group has a free block it will then go
in and try to acquire it. No locks are held, so another CPU can come in and
steal the last block.
In this case we will bogusly report a corrupted filessytem.
Fix it by just restarting the scan - this will choose a different blockgroup
or will generate -ENOSPC.
Andrew Morton [Sun, 9 Nov 2003 23:17:43 +0000 (15:17 -0800)]
[PATCH] AS: handle non-block requests
From: Nick Piggin <piggin@cyberone.com.au>
as_completed_request() can be called for requests which were not generated by
the generic block layer. Handle these, to avoid a subsequent WARN_ON (at
least).
Also kill a separate WARN_ON which is bogusly triggering.
Paul Mackerras [Sun, 9 Nov 2003 12:03:30 +0000 (04:03 -0800)]
[PATCH] PPC32: Fix alignment problem with __ex_table and __bug_table.
The __start___ex_table and __start___bug_table symbols could end up
pointing a few bytes before the actual __ex_table and __bug_table
sections, if the preceding section had an odd length. This led to
oopses in some situations. Patch from Sam Ravnborg.
Russell King [Sun, 9 Nov 2003 23:03:30 +0000 (23:03 +0000)]
[ARM] Fix ARM signal handling.
If we are unable to deliver a signal to the process (eg, due to stack
pointer corruption) block the signal so other fatal signals can kill
off the process.
Andi Kleen [Sun, 9 Nov 2003 01:51:23 +0000 (17:51 -0800)]
[PATCH] Work around K8 errata on x86-64
K8 has an erratum (#100) that essentially causes some compat mode processes
to fault occassionally. The issue can be worked around in the OS. It only
applies to x86-64, in 32bit it is fine.
This adds a check to the page fault handler that checks for addresses >4GB
from compat mode. If they happen just return; the CPU will reexecute
the instruction and the condition that caused the problem is gone.
More details in Opteron/Athlon64 specification update on the AMD website.
Also I removed a left over debugging printk in the prefetch handling code.
Vojtech Pavlik [Sun, 9 Nov 2003 01:25:23 +0000 (17:25 -0800)]
[PATCH] input: Always reset PS/2 mouse resolution and update speed to
default values after probing
This sets the mouse to 100 samples/second, 200 dpi, 1:1 mapping, which
is a standard setting, as close to 2.4 XFree86 behavior as possible, and
a good performance setting, too.
It also in the case of 'psmouse_noext' doesn't probe and set anything
all, though it still issues the RESET command. This is as safe as one
can get.
The only real problem remaining is that the report rate and resolution
cannot be set from XFree86 config and only is available as a
kernel/module parameter. The fix is, howewer not 2.6.0 material.
Krishna Kumar [Sat, 8 Nov 2003 14:33:05 +0000 (06:33 -0800)]
[IPV6]: Fix hangs during interface down caused by ipv6_del_addr().
While using PRIVACY extensions, I sometimes get a hang when I remove the
interface. But I can reproduce this every time using the test script at
the end of the mail (hang depends on the order of address deletion).
The bug is in ipv6_del_addr() where if a temp address is being deleted, it
does an __in6_ifa_put() of the main address from which it was derived
(basically the autoconf prefix address). So if the main address was
deleted first, it's ifp ref count would be 1 and it would 'wait' to be
freed till it's temp address was freed first. When the temp address is
deleted, the __put() routine drops the main address's ifp ref count to 0,
but not free it. unregister_netdevice() hangs giving message that ref
count is 1. Fix tested overnight.
Also, the code at the top of the routine is unnecessary, the same is being
done when the address is found a little later in that routine.
Ingo Molnar [Sat, 8 Nov 2003 08:06:19 +0000 (00:06 -0800)]
[PATCH] SMP signal latency fix
The code that sends a signal needs to "kick" the target process if it
runs on another CPU and wasn't woken up by the signal to let it know
that it has a new event.
Otherwise it might take a long time until the target actually notices
and acts on the signal.
Ralf Bächle [Sat, 8 Nov 2003 07:24:10 +0000 (02:24 -0500)]
[netdrvr pcnet32] add missing pci_dma_sync_single
a patch for the pcnet32.c driver which adds a missing call to
pci_dma_sync_single. If a received packet is smaller than rx_copybreak
the pcnet driver will recycle the receive buffer which requires calling
pci_dma_sync_single. Patch is against 2.6 but I it's also needed in 2.4.
Without that call the processor might still have old stale data in
the data cache when the processor accesses the recycled buffer.
Andi Kleen [Sat, 8 Nov 2003 05:59:23 +0000 (21:59 -0800)]
[PATCH] Fix TSS limit on x86-64
The limit of the TSS segment was incorrectly set to a too big value
on x86-64. This lead to the CPU reading random memory behind the main
TSS when iopl was >0, but there was no ioperm bitmap set. This caused
random failures in port accesses in this state.
[PATCH] fix reference count bug with class devices
When a kobject is associated with a kset, the kset MUST be set before
the kobject is initialized (by either a call to kobject_register() or
kobject_init()). This patch fixes the class code which improperly set
the kset after the kobject was initialized, which would cause improper
reference counts on the kset.
Thanks to Mike Anderson for locating the source of this bug.
The new gcc optimizes the first store away because it doesn't know
that ip_fast_csum reads its input memory. This leads to occassionally
packets with wrong IP header checksum getting sent; this happens especially
with NFS. Fixing it in the constraints would have been ugly and probably
not future proof, so this patch just adds a memory clobber to ip_fast_csum.
For some reason the issue only hits in 2.6, we haven't seen it in 2.4.
Problem occurs on both i386 and x86-64.
David Brownell [Fri, 7 Nov 2003 02:19:35 +0000 (18:19 -0800)]
[PATCH] USB: usb ignores 64bit dma
The dma hooks whereby EHCI can pass 64bit DMA support
up the driver stack (to avoid buffer copies) turn out
to broken on most architectures(*). This patch just
disables them all, since it looks like those mechanisms
won't get fixed before 2.6.0-final. For now it'd only
matter on a few big Intel boxes anyway.
Please merge.
- Dave
(*) On x86, mips, and arm dma_supported() doesn't
even compare with the device's mask. On several
other architectures (reported on ppc, alpha,
and sparc64), asking that question for non-PCI
devices will just BUG() -- even though all info
needed to answer the question is right at hand.
Matthew Dharm [Fri, 7 Nov 2003 02:07:03 +0000 (18:07 -0800)]
[PATCH] USB: fix a thread-exit problem at module unload
This patch fixes a thread-exit problem when the usb-storage module is
unloaded with a preemptable kernel. Please refer to the comments in the
code for more detail.
Alexander Viro [Fri, 7 Nov 2003 01:53:45 +0000 (17:53 -0800)]
[PATCH] Fix cramfs metadata races
There's a few places that use incorrect exclusion for the cramfs raw
data access buffers. The proper lock is "read_mutex" (and BKL does
nothing).
- fix mount-time read and block number initialization without the mutex
held.
- cramfs_readdir() needs to copy the name and inode information into a
separate buffer since it can't hold the semaphore over the
(potentially blocking) user mode access
- cramfs_lookup() needs to hold the access lock over the whole
function, not just the read itself
- use generic_file_llseek on directories to get i_sem exclusion on
readdir/lseek
Jens Axboe [Thu, 6 Nov 2003 00:23:58 +0000 (16:23 -0800)]
[PATCH] fix segment accounting with bounced pages
There's a problem with bio segment accounting for pages that reside
above the bounce limit of a queue. When submitted, they may be
considered part of another segment. A condition that changes when the
page gets bounced. This can cause us to send bio's that have too many
segments to a driver.
The best fix is to always consider pages above q->bounce_pfn as seperate
segments. That's the conservative approach and the easy fix.
David S. Miller [Wed, 5 Nov 2003 04:52:55 +0000 (20:52 -0800)]
[IRDA]: Fix IRQ save/restore handling in seq file handlers.
IRDA was restoring IRQ flags in a different function from which they
were saved which explodes on certain platforms. It did not need to
use _irq{save,restore}() anyways since the seqfile layer always invokes
these routines from user context with interrupts enabled, so using
plain spin_{lock,unlock}_irq() works just fine.
Matthew Wilcox [Wed, 5 Nov 2003 00:29:58 +0000 (16:29 -0800)]
[PATCH] Fix panic-at-boot
This fixes a panic-at-boot when ACPI Hotplug PCI is compiled in, but
ACPI is disabled. It just makes sure that the list is properly
initialized statically instead of depending on runtime initialization
that may or may not happen.
Randy Dunlap [Tue, 4 Nov 2003 08:32:35 +0000 (00:32 -0800)]
[PATCH] Fix crash-on-boot in init_l440gx SMP
ioremap_nocache() doesn't need to check for physical address
wraps because __ioremap() has already done that;
fix calculation of npages to handle non-aligned phys_addr;
I've noticed that, in the 2.6 (test 9) kernel, the "cmd" field (of type int)
in struct request has been removed, and it looks like all of the code in
ide-tape has just had a find & replace run on it to replace any instance of
rq.cmd or rq->cmd with rq.flags or rq->flags.
The values being put into "cmd" in 2.4 (now "flags", in 2.6) by ide-tape are
8-bit numbers, like 90, 91, etc... and the actual flags that are being used
in "flags" cover the low 23 bits. So, not only do the flags get wiped out
when, say, ide-tape assigns, say, 90 to "flags", but also the 90 gets wiped
out when one of the flags is modified.
I noticed this, because ide-tape checks this value, and spews error codes
when it isn't correct--continuously--as soon as you load the module, because
ide-tape is calling ide_do_drive_cmd with an action of ide_preempt, which
causes ide_do_drive_cmd to set the REQ_PREEMPT flag, so "flags" isn't the
same when it gets back to idetape_do_request.
Alan Mayer [Mon, 3 Nov 2003 06:37:03 +0000 (22:37 -0800)]
[PATCH] ia64: fix bug in SN2 sn_pci_map_sg that causes MCA
If sg->dma_address is set, we try to do a __pa() on a dma_address,
then, later, create a dma_addresss from a munged dma_address. When
this bogus dma_address is used by the card, it results in MCAs.
Linus Torvalds [Mon, 3 Nov 2003 01:44:08 +0000 (17:44 -0800)]
Only truncate file types that can be truncated on minixfs.
Only regular files, directories and symbolic links can have any
blocks allocated to them - other types of files have different
metadata in their inodes and should not get to the truncation
paths. Enforce this in fs/minix/inode.c.
Without this, deleting a block or character device can cause
minix filesystem corruption. Noted by Konstantin Boldyshev.
Linus Torvalds [Sun, 2 Nov 2003 03:16:06 +0000 (19:16 -0800)]
Avoid user space access with interrupts disabled in vm86 support.
Getting a signal while in vm86 caused warnings because we still had
interrupts disabled - for no good reason. Enable interrupts before
accessing user space.