Andrew Morton [Wed, 22 Oct 2003 01:23:01 +0000 (18:23 -0700)]
[PATCH] Fix oops with CONFIG_MCA=y
With CONFIG_MCA=y and no MCA bus present, drivers go oops deep in the kobject
code when calling mca_register_driver(). Because there is no MCA subsystem
registered against the driver.
Andrew Morton [Wed, 22 Oct 2003 01:22:36 +0000 (18:22 -0700)]
[PATCH] kcapi.c CONFIG_MODULES=n build fix
With CONFIG_MODULES=n this file does not compile because the type of
module->owner is not known.
Gven that card->owner is probably a null pointer when this driver is
statically linked, best thing to do is to just not poke around inside
card->owner at all.
Andrew Morton [Wed, 22 Oct 2003 01:22:11 +0000 (18:22 -0700)]
[PATCH] fix for register_cpu()
From: jbarnes@sgi.com (Jesse Barnes)
The patch adds a symlink from /sys/devices/system/node/nodeM/cpuN to the
/sys/devices/cpu/cpuN directory so that a userspace program can determine
which CPUs belong to which nodes easily. Non-NUMA systems can simply pass
NULL in for the root arg and everything will work like it used to.
Andrew Morton [Wed, 22 Oct 2003 01:22:02 +0000 (18:22 -0700)]
[PATCH] fix low-memory BUG in slab
cache_grow() will call kmem_freepages() if the call to alloc_slabmgmt()
fails. But the pages have not been marked PageSlab at this stage, so
kmem_freepages() goes BUG.
It is more symmetrical to mark the pages as PageSlab in kmem_getpages().
The patch also prunes a bunch of incorrect comments.
(PageSlab doesn't actually do anything: its only value is as a debug check.
I think the LKCD patch uses it).
In fs/binfmt_elf.c:load_elf_binary() (both 2.6 and 2.4), there is some
minimal checking whether the interpreter it's about to load/run is a valid
ELF file, but it fails to check whether the interpreter is of the correct
arch. We ran into this when a borked powerpc64-linux toolchain set the
interpreter on our 64-bit app to our 32-bit ld.so. Executing the app
caused the kernel to really chew up memory. I'm assuming x86_64 and
sparc64 might possibly see the same behavior.
Note I'm not sure of the history behind INTERPRETER_AOUT, so I added the
test for INTERPRETER_ELF so as not to change it's behavior in case someone
still relies on it.
As an aside, it seems the elf_check_arch() macros should really be checking
for more than a valid e_machine value. I'd think checking one or more of
the e_ident[EI_CLASS], e_ident[EI_DATA] and e_ident[EI_OSABI] values would
be required as well, no?
Andrew Morton [Wed, 22 Oct 2003 01:21:14 +0000 (18:21 -0700)]
[PATCH] digi_acceleport.c has bogus "address of" operator
From: "Kurtis D. Rader" <kdrader@us.ibm.com>
http://bugme.osdl.org/show_bug.cgi?id=1365
The digi_acceleport.c USB serial driver has a bogus "address of" operator
that results in BUGs.
The problem is that digi_wakeup_write_lock() takes a pointer to a struct
usb_serial_port. However, what gets passed is a pointer to a pointer to a
struct usb_serial_port.
Andrew Morton [Wed, 22 Oct 2003 01:20:48 +0000 (18:20 -0700)]
[PATCH] Quota deadlock fix
From: Jan Kara <jack@ucw.cz>
attached patch should fix a quota locking problem causing deadlock (when
inode was being released from icache and it caused newly created quota
structure to be written).
Andrew Morton [Wed, 22 Oct 2003 01:20:33 +0000 (18:20 -0700)]
[PATCH] tmpfs 6/7 write i_size_write
From: Hugh Dickins <hugh@veritas.com>
mm/shmem.c was converted to i_size_read in -test1, and the remaining
references to a file's naked i_size are safely protected by i_sem;
but surely shmem_file_write must use i_size_write to update i_size.
Andrew Morton [Wed, 22 Oct 2003 01:20:23 +0000 (18:20 -0700)]
[PATCH] tmpfs 5/7 writepage/truncate race fix
From: Hugh Dickins <hugh@veritas.com>
If it's possible for a tmpfs page beyond i_size to remain in cache until
shmem_truncate repeats truncate_inode_pages, then shmem_writepage's
BUG_ON(index >= info->next_index) cannot be completely safe. But it's a
useful check in a fragile area, so retain it when not in shmem_truncate.
Andrew Morton [Wed, 22 Oct 2003 01:20:16 +0000 (18:20 -0700)]
[PATCH] tmpfs 4/7 getpage/truncate race fix
From: Hugh Dickins <hugh@veritas.com>
Extend use of that SHMEM_PAGEIN flag to where shmem_getpage adds a page
to the cache. It couldn't have caused a BUG_ON(inode->i_blocks), but if
i_size is reduced (from another cpu) the instant after shmem_swp_alloc
checks it, shmem_getpage could insert a page into the cache just after
truncate_inode_pages has passed through cleaning it, leaving stale data
(which may mysteriously reappear if the file is later extended).
Easily fixed for tmpfs, using the mechanism just added for swapoff; and
probably more important there, since its read from swap can insert non-0
data. But is there not a similar issue, a tiny window, in filemap.c?
if truncate_inode_pages comes in between checking i_size and adding new
page to cache. Not worth getting excited, but something to beware of.
Andrew Morton [Wed, 22 Oct 2003 01:20:07 +0000 (18:20 -0700)]
[PATCH] tmpfs 3/7 swapoff/truncate race fix
From: Hugh Dickins <hugh@veritas.com>
On 23 July, Sergey S. Kostyliov <rathamahata@php4.ru> reported a tmpfs
BUG_ON(inode->i_blocks) during swapoff: my last version of the fix to
swapoff/truncate race was inadequate, since I_FREEING might get set or
i_size be reduced (from another cpu) the instant after it's tested here.
So revert to the previous version of the fix, shmem_truncate calling
truncate_inode_pages again, if pages still left in cache; but avoid the
recall in usual cases of partial truncation, by having a "pagein" flag
to indicate when recall might be necessary. (Since those flags already
use VM_ACCOUNT and VM_LOCKED, must redefine another VM_flag for this.)
Sergey and 2.4-aa have run fine with this for a couple of months.
Andrew Morton [Wed, 22 Oct 2003 01:19:49 +0000 (18:19 -0700)]
[PATCH] tmpfs 1/7 LTP ENAMETOOLONG fix
From: Hugh Dickins <hugh@veritas.com>
LTP tests the filesystem on /tmp: there are many failures when using tmpfs
because simple_lookup forgot to reject filenames longer than the NAME_MAX
tmpfs declares in its statfs. This also fixes ramfs and hugetlbfs.
Andrew Morton [Wed, 22 Oct 2003 01:19:41 +0000 (18:19 -0700)]
[PATCH] atp870u oops fix
This driver is taking uinitialised stack gunk from the pdev[] array and
feeding it into pci_read_config_byte() and crashing when modprobed with no
hardware present.
Fix it to not index past the initialised members of pdev[].
Andrew Morton [Wed, 22 Oct 2003 01:19:33 +0000 (18:19 -0700)]
[PATCH] Time precision, adjtime(x) vs. gettimeofday
From: Stephen Hemminger <shemminger@osdl.org>
The following will prevent adjtime from causing time regression. It delays
starting the adjtime mechanism for one tick, and keeps gettimeofday inside
the window.
Only fixes i386, but changes to other arch would be similar.
Running a simple clock test program and playing with adjtime demonstrates
that this fixes the problem (and 2.6.0-test6 is broken). But given the
fragile nature of the timer code, it should go through some more testing
before inclusion.
The mem= fixes from Red Hat's tree had a small bug:
if mem= was not actually used with the additional features, but
int plain old way, is used the value as the size of memory it
wants, not the upper limit. The problem with this is that there
is a small difference due to memory holes.
I had one report of a person using mem= to reduce memory size for
a broken i386 chipset thaty only supports 64MB cached and the rest
as mtd/slram device for swap. I got broken as the boundaries changed.
Andrew Morton [Wed, 22 Oct 2003 01:19:08 +0000 (18:19 -0700)]
[PATCH] scsi: handle zero-length requests
From: Jens Axboe <axboe@suse.de>
The command 'eject /dev/scd0' sends a START_STOP command to the device with
the data direction set to SCSI_DATA_WRITE but a transfer length of zero.
This causes a problem for some code paths.
Andrew Morton [Wed, 22 Oct 2003 01:18:59 +0000 (18:18 -0700)]
[PATCH] fix split_vma vs. invalidate_mmap_range_list race
From: "V. Rajesh" <vrajesh@eecs.umich.edu>
If a vma is already present in an i_mmap list of a mapping,
then it is racy to update the vm_start, vm_end, and vm_pgoff
members of the vma without holding the mapping's i_shared_sem.
This is because the updates can race with invalidate_mmap_range_list.
I audited all the places that assign vm_start, vm_end, and vm_pgoff.
AFAIK, the following is the list of questionable places:
1) This patch fixes the racy split_vma. Kernel 2.4 does the
right thing, but the following changesets introduced a race.
James Cleverdon [Tue, 21 Oct 2003 14:27:58 +0000 (07:27 -0700)]
[PATCH] Allow more APIC irq sources
The "irq_vector[]" array is indexed by the sum of all RTEs in all I/O
APICs, and is not necessarily limited by the x86 CPU irq vector inputs.
In fact, the irq vector index would overflow on big machines with lots
of IO APIC's, causing the boot to fail.
So grow the array for the big SMP boxes, keeping the default the same as
before (and shrink the vector entry size down to a 8-bit value, since
that's the size of the actual CPU vector entry).
Jeff Garzik [Tue, 21 Oct 2003 15:25:04 +0000 (11:25 -0400)]
[libata] Merge Serial ATA core, and drivers for:
Intel ICH5 (production)
ServerWorks / Apple K2 (beta)
VIA (beta)
Silicon Image 3112 (broken!)
Various Promise (alpha/beta)
Michael Hunold [Tue, 21 Oct 2003 00:55:40 +0000 (17:55 -0700)]
[PATCH] Fix bugs in various DVB drivers
- DVB networking uses big endian crc32, so change all occurences of
crc32_le to crc32_be
- fix usage of firmware location Kconfig option in tda1004x frontend
driver
- add missing VBI line decoding initialization to saa7113 code for
av7110 driver
- make av7110 firmware static and *not* __initdata, so recover_arm()
can work in case the driver is compiled in statically
Alexander Viro [Mon, 20 Oct 2003 14:34:10 +0000 (07:34 -0700)]
[PATCH] Fix initrd with devfs enabled
This fixes initrd with devfs. With that combination the late-boot code
does temporary mount of devfs over rootfs /dev, which made /dev/initrd
inaccessible. For setups without devfs that didn't happen.
The fix is trivial - put the file in question outside of /dev; IOW,
we simply replace "/dev/initrd" with "/initrd.image" in init/*.
Neil Brown [Mon, 20 Oct 2003 09:55:32 +0000 (02:55 -0700)]
[PATCH] md - Use sector rather than block numbers when splitting raid0 requests.
When raid0 needs to split a request, it uses 'block' (1K) addresses
rather than sector (512b) addresses, which causes problems if the sector
address is odd. This patch fixes the problem.
[PATCH] fix drivers/ide/pci/siimage.c for PROC_FS=n
From: "Noah J. Misch" <noah@caltech.edu>
The Silicon Image driver is not building properly when CONFIG_PROC_FS is unset.
This patch corrects that problem. It appears as though several utility
functions at the top of drivers/ide/pci/siimage.c that the driver always needs
accidentally fell within an #ifdef CONFIG_PROC_FS. I also removed an excess
include while I noticed it.
Arun Sharma [Mon, 20 Oct 2003 09:20:38 +0000 (02:20 -0700)]
[PATCH] ia64: make strace of ia32 processes work again
Newer versions of strace manipulate the syscall arguments and to make this
work for ia32 processes, we need to reload the syscall args after
doing the syscall-trace callback.
Jesse Barnes [Mon, 20 Oct 2003 09:05:49 +0000 (02:05 -0700)]
[PATCH] ia64: zero out topology related sysfs nodes
Tony pointed out (thanks Tony) that in -test8 kobject_set_name() will
try to free a kobject's k_name field if it's non-NULL, so we need to
zero it out in case kmalloc() gave us recycled memory or we'll try to
kfree a bogus area.
There's a hole at 0xa0000-0xc0000, so we should ignore all the WB memory
in that granule. With 16MB granules, the existing code trims like this
(note the 4K page at 0x0 should have been ignored, but wasn't).
They were added by Torben to workaround ServerWorks driver problems
(fixed by previous patch), but depending on BIOS can be dangerous on
other chipsets and it is always better to fix specific driver.
If PIO mode should be auto-tuned xferspeed argument for svwks_tune_chipset()
is equal to 255 (0xFF). It is then passed to ide_rate_filter() which matches
desired mode with chipset capabilities. Since 255 is greater than any of the
values used for transfer modes, ide_rate_filter() will always return the
highest mode supported by both device/chipset (which sometimes should not be
used ie. when host is a simplex one) and the wrong mode will be set.
Thanks to Torben Mathiasen and Tomas Szepe for testing it.
George G. Davis [Thu, 16 Oct 2003 21:32:23 +0000 (22:32 +0100)]
[ARM PATCH] 1684/1: Add uImage build target rule
Patch from George G. Davis
This adds an `make uImage` build target rule to create boot images for targets which use u-Boot firmware. This build target already exists for the PPC architecture.
Stéphane Eranian [Thu, 16 Oct 2003 08:13:18 +0000 (01:13 -0700)]
[PATCH] ia64: perfmon-2 fixes
- remove PFM_FL_UNSECURE support because broken
- remove instrumentation code for syswide ctx update (5% speedup)
- integrated cleanups from John Levon
- remove references to pmu_conf.ovfl_val from loops, use local variable
- updated pfm_bad_permissions()
- support reset values for non-counting pmds
- serialization of PFM_RESTART
- added support for restart_active in per-task mode
- remove potential deadlock caused by calling pfm_overflow_handler() from pfm_load_regs()
- fix invalid check in perfmon_mckinley() for PMC13
Tony Luck [Thu, 16 Oct 2003 08:11:43 +0000 (01:11 -0700)]
[PATCH] ia64: MCA min_state area must be uncacheable
Software Developer's Manual page 2:270, section 11.3.2.3
says that the processor min-state save area must be in an
uncacheable region ... but current MCA recovery code
allocates the min-state area "ia64_mca_min_state_save_info"
in regular kernel data/bss.
This patch re-uses the same min-state area that the PAL/SAL
used to report the error to Linux ... which mostly requires
deleting code and declarations (some of which were wrong,
MIN_STATE_AREA_SIZE ought to have been 58). The real "work"
is copying the pointer to the min-state area from the
sal_to_os handoff structure into the os_to_sal structure.