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.
Linus Torvalds [Sat, 1 Nov 2003 08:26:06 +0000 (00:26 -0800)]
Forward-port PIRQ table updates from 2.4.x
This separates out the PIRQ table parsing to vendor-specific
code, which allows us to handle specific vendor quirks. In
particular, SiS has a really funky notion of what PCI device
ID's are meant to be.
Some hardware designers seem to be hitting the recreational
drugs a bit too heavily. Tssk, tssk.
The Sis96x irq routing update is confirmed to fix at least
one laptop.
Linus Torvalds [Thu, 30 Oct 2003 03:03:38 +0000 (19:03 -0800)]
Stop SIS 96x chips from lying about themselves.
Some machines with the SIS 96x southbridge have it set up
to claim it is a SIS 503 chip. That breaks irq routing logic
among other things. Fix it properly by making everybody aware
of the duplicity.
Dave Kleikamp [Thu, 30 Oct 2003 03:31:36 +0000 (21:31 -0600)]
JFS: Fix race between link() and unlink()
JFS isn't happy it thinks a file has been removed, and link() increases
its nlink count back from zero. In 2.4, i_zombie prevented this race
condition.
Dave Kleikamp [Wed, 29 Oct 2003 10:05:37 +0000 (04:05 -0600)]
JFS: remove racy, redundant call to block_invalidatepage
__invalidate_metapages references mp->page after after releasing the
meta_lock spinlock, without increasing the use count. This is racy and
unnecessary since setting the META_discard flag is sufficient.
block_invalidatepage() will be called when the metapage is released.
Rusty Russell [Wed, 29 Oct 2003 09:35:41 +0000 (01:35 -0800)]
[PATCH] Fix for module initialization failure
Bug reported by Paul Mackerras: if a module parameter fails, we didn't
call module_arch_cleanup().
On x86 this was harmless (module_arch_cleanup() is a no-op), but on
other architectures like PPC this causes inconsistent data structures
and subsequent oopses.
Ivan Kokshaysky [Wed, 29 Oct 2003 07:20:38 +0000 (23:20 -0800)]
[PATCH] PCI: fix bug in pci_setup_bridge()
This bug prevents Alphas with older firmware from booting if there
is a card with PCI-PCI bridge that supports 32-bit IO.
This has happened on AS2100 with a quad-tulip card, for example:
- initially, the I/O window of 21152 bridge was 0x10000-0x10fff,
as set up by firmware;
- pci_setup_bridge() is going to change this, say, to 0xa000-0xafff:
first, it updates PCI_IO_BASE_UPPER16 and PCI_IO_LIMIT_UPPER16
registers, so that IO window temporarily is at 0x0000-0x0fff,
which effectively blocks up all legacy IO ports in the lower
4K range, such as serial, floppy, RTC an so on;
does debugging printk - machine dies here with recursive
machine checks as the serial console has gone.
Moving (or disabling) the debugging printk is not a solution -
there is possibility that timer interrupt (which might access RTC
ports) occurs between writes to lower and upper parts of the
base/limit registers.
The patch temporarily disables the IO window of the bridge by
setting PCI_IO_BASE_UPPER16 > PCI_IO_LIMIT_UPPER16 before doing
an update. It's safe, as we don't have any active IO behind
the bridge at this point. Also, it's a NOP for bridges with
16-bit-only IO.
Similar (but simpler, as we always clear upper 32 bits) fix
for 64-bit prefetchable MMIO range.
Arjan van de Ven [Wed, 29 Oct 2003 10:40:20 +0000 (05:40 -0500)]
[PATCH] fix starfire 64-bit b0rkage
(x >> 32) is undefined on a 32 bit integral variable in C; In contrast
(x >>16 >> 16) is fine (and gets optimized out to 0, while (x >> 32)
gets optimized out to a nop).
Andrew Morton [Wed, 29 Oct 2003 09:28:49 +0000 (04:28 -0500)]
[PATCH] initcall ordering fix for PNP NICs
From: "M.H.VanLeeuwen" <vanl@megsinet.net>
The level of isapnp_init was moved to after apci sometime ago. Since it is
now after net_dev_init, ISA PNP NICs fail to initialized at boot. This is
particularily problematic for NFS root filesystems like mine, or none
modular systems.
This fix allows ISA PNP NIC cards to work during net_dev_init, and still
leaves isapnp_init after apci_init.