Neil Brown [Fri, 14 Mar 2003 10:09:26 +0000 (02:09 -0800)]
[PATCH] md: Add new superblock format for md
Superblock format '1' resolves a number of issues with
superblock format '0'.
It is more dense and can support many more sub-devices.
It does not contains un-needed redundancy.
It adds a few new useful fields
Neil Brown [Fri, 14 Mar 2003 10:09:20 +0000 (02:09 -0800)]
[PATCH] md: Allow md to select between superblock formats
The code to understand a specific superblock format is
already highly localised in md. This patch defines a
user-space interface for selecting which superblock format
to use, and obeys that selection.
Md currently has a concept of 3 version numbers:
A major version number
A minor version number
A patch version number
There historically seems to be some confusion about whether
these refer to a version of the superblock layout,
or a version of the software.
We will now define that:
the "major_version" defines the superblock handler.
'0' is the current superblock format. All new formats
will need new numbers.
the "minor_version" can specify minor variations in the
superblock, such as different location on the device
the "patch_version" will be used to indicate new extenstions
to the software.. patch_version=1 will mean multiple superblock
support.
A superblock version number is selected by specifing major_version
in SET_ARRAY_INFO ioctl.
This patch:
Updates Documentation/md.txt with details of new interface.
Generalises desc_nr handling and makes sure that an array never
has two devices with the same desc_nr.
makes sure mddev->major_version is always valid and is 0 by default.
uses mddev->major_version to select superblock handlers.
Modifies set_array_info to just record version number if raid_disks==0
Makes sure max_disks is always set correctly.
Determines device size when reading superblock, or a hot-add/add-new.
Neil Brown [Fri, 14 Mar 2003 10:09:13 +0000 (02:09 -0800)]
[PATCH] md: Allow components of MD raid array to have data start at offset from start of device.
Normally the data stored on a component of a RAID array is stored
from the start of the device. This patch allows a per-device
data_offset so the data can start elsewhere. This will allow
RAID arrays where the metadata is at the head of the device
rather than the tail.
Neil Brown [Fri, 14 Mar 2003 10:09:06 +0000 (02:09 -0800)]
[PATCH] md: Fix bad interaction between sync checkpointing and recovery
Md devices (raid1/raid5) can resync or recover.
There are similar but importantly different.
resync happens after an unclean shutdown
recovery happens when a failed drive is being replaced by a hot spare.
The sync-checkpoint code confused the two somewhat and this causes
problems.
This patch makes sure "recovery_cp" only relates to resync,
not recovery.
It also fixes a small problem with recording spares in
the superblock.
Neil Brown [Fri, 14 Mar 2003 10:09:01 +0000 (02:09 -0800)]
[PATCH] md: Fulltime delayed 'safe_mode' for md
From: Angus Sawyer <angus.sawyer@dsl.pipex.com>
If there are no writes for 20 milliseconds, write out superblock
to mark array as clean. Write out superblock with
dirty flag before allowing any further write to succeed.
If an md thread gets signaled with SIGKILL, reduce the
delay to 0.
Also tidy up some printk's and make sure writing the
superblock isn't noisy.
Neil Brown [Fri, 14 Mar 2003 10:08:54 +0000 (02:08 -0800)]
[PATCH] md: Remove md_recoveryd thread for md
The md_recoveryd thread is responsible for initiating and cleaning
up resync threads.
This job can be equally well done by the per-array threads
for those arrays which might need it.
So the mdrecoveryd thread is gone and the core code that
it ran is now run by raid5d, raid1d or multipathd.
We add an MD_RECOVERY_NEEDED flag so those daemon don't have
to bother trying to lock the md array unless it is likely
that something needs to be done.
Also modify the names of all threads to have the number of
md device.
Neil Brown [Fri, 14 Mar 2003 10:08:21 +0000 (02:08 -0800)]
[PATCH] md: Convert /proc/mdstat to use seq_file
From: Angus Sawyer <angus.sawyer@dsl.pipex.com>
Mainly straightforward convert of sprintf -> seq_printf. seq_start and
seq_next modelled on /proc/partitions. locking/ref counting as for
ITERATE_MDDEV.
Neil Brown [Fri, 14 Mar 2003 10:08:13 +0000 (02:08 -0800)]
[PATCH] md: Missing mddev_put in md resync code
Whenever a ITERATE_MDDEV loop is exitted abnormally
we need to mddev_put the current mddev. There was
one point in md_do_sync where we didn't so use counts
became wrong.
Gerd Knorr [Tue, 11 Mar 2003 23:25:48 +0000 (15:25 -0800)]
[PATCH] v4l: create include/media
This patch creates a new include directory include/media, populates
it with a few files header files and fixups the affected drivers to
compile with the new directory layout.
The directory is intented to be used for (kernel-internal) header files
of the media drivers (which are sitting below drivers/media). For now
the video-buf.h (mm helper), tuner.h (tv/radio tuner) and audiochip.h
(tv sound decoder drivers) header files are moved. Some more header
files from the dvb folks will likely follow.
Andrew Morton [Tue, 11 Mar 2003 11:13:16 +0000 (03:13 -0800)]
[PATCH] unplugging fix
Patch from Neil Brown <neilb@cse.unsw.edu.au>
Allow auto-unplugging to work for devices that do it themselves.
Auto-unplugging - and blk_unplug_work in particular - assumes that the device
uses "generic_unplug_device" for unplugging, but some devices don't. md
crashes.
Steven Cole [Tue, 11 Mar 2003 09:47:56 +0000 (01:47 -0800)]
[PATCH] Documentation spelling cleanup
This patch fixes spelling errors in the Documentation directory and was
extensively reviewed by the following people: Dan Kegel, David
Woodhouse, Joe Perches, Jared Daniel J. Smith, Michael Hayes, and
Steven Cole
Patrick Mochel [Tue, 11 Mar 2003 10:00:30 +0000 (04:00 -0600)]
driver model: add bus_rescan_devices()
From Ben Collins
Used as manual trigger for device/driver binding, so drivers can claim
devices that are present but failed to be bound. In case of ieee1394, this
can happen if two computers are attached to a device - the second one won't
be able to claim it until the first detaches.
Changed device_attach() to return 1 when a driver was bound to a device.
Makes it so bus_rescan_devices() can return the number of devices attached.
Tested this with ieee1394 over a bus reset and it worked as expected.
The old adap_lock and driver_lock could deadlock and there was a bunch
of stuff that was horribly racy. The new locking scheme is from
lm_sensors CVS but I had to fix quite a few bugs to make this work.
It's the _device_ filesystem, so regular files are grossly misplaced
here. Fortauntely only one driver actually tries to use it (microcode)
and it's works fine with a regular miscdevice as well.
[PATCH] fix kmem_cache_size() for new slab poisoning
The new slab poisoning code broke kmem_cache_size(), it now returns
a too large size as the poisoning area after the object is includes.
XFS's kmem_zone_zalloc thus overwrites exactly that area and triggers
the new checks everytime such an object is freed again.
I don't recommend using XFS on BK-current without this patch applied :)
Greg Ungerer [Tue, 11 Mar 2003 01:49:08 +0000 (17:49 -0800)]
[PATCH] move common timer and vector code for m68knommu/ColdFire/5206
This patch moves common ColdFire vector and timer procesing code from
the local per-processor config.c for the 5206 ColdFire sub-architecture.
All ColdFire CPU's have the same timer and basic vector setup, seems
crazy to repeat this code for each of 6 ColdFire CPU varients.
Greg Ungerer [Tue, 11 Mar 2003 01:48:58 +0000 (17:48 -0800)]
[PATCH] move common timer and vector code for m68knommu/ColdFire/5206e
This patch moves common ColdFire vector and timer procesing code from
the local per-processor config.c for the 5206e ColdFire sub-architecture.
All ColdFire CPU's have the same timer and basic vector setup, seems
crazy to repeat this code for each of 6 ColdFire CPU varients.
This patch also removes the reset button support, this is now moved to
a proper device driver, where it belongs.
Greg Ungerer [Tue, 11 Mar 2003 01:48:48 +0000 (17:48 -0800)]
[PATCH] move common timer and vector code for m68knommu/ColdFire/5249
This patch moves common ColdFire vector and timer procesing code from
the local per-processor config.c for the 5249 ColdFire sub-architecture.
All ColdFire CPU's have the same timer and basic vector setup, seems
crazy to repeat this code for each of 6 ColdFire CPU varients.
Greg Ungerer [Tue, 11 Mar 2003 01:48:38 +0000 (17:48 -0800)]
[PATCH] create common timer code for m68knommu/ColdFire processors
This patch creates common timer setup and handling code for the m68knommu
ColdFire CPU sub-architecture. All 6 ColdFire CPU varients contain the
same hardware timers. Currently each sub-arch has its own timer code.
This reduces a lot of code duplication.
Greg Ungerer [Tue, 11 Mar 2003 01:48:10 +0000 (17:48 -0800)]
[PATCH] move common timer and vector code for m68knommu/ColdFire/5407
This patch moves common ColdFire vector and timer procesing code from
the local per-processor config.c for the 5407 ColdFire sub-architecture.
All ColdFire CPU's have the same timer and basic vector setup, seems
crazy to repeat this code for each of 6 ColdFire CPU varients.
Greg Ungerer [Tue, 11 Mar 2003 01:48:02 +0000 (17:48 -0800)]
[PATCH] fix m68knommu COMEM-lite PCI header code
This patch fixes up the PCI bios header for the m68knommu COMEM-lite
PCI hardware support. Adds missing definitions, and a couple of trivial
inline functions here.
All of these return NULL for the non-MMU case. Doing the inline here
minimizes changes to assorted mm/ files. This patch was originally
from Christoph Hellwig.
Greg Ungerer [Tue, 11 Mar 2003 01:47:27 +0000 (17:47 -0800)]
[PATCH] move common timer and vector code for m68knommu/ColdFire/5307
This patch moves common ColdFire vector and timer procesing code from
the local per-processor config.c for the 5307 ColdFire sub-architecture.
All ColdFire CPU's have the same timer and basic vector setup, seems
crazy to repeat this code for each of 6 ColdFire CPU varients.
This patch also removes the reset button support, this is now moved to
a proper device driver, where it belongs.
Greg Ungerer [Tue, 11 Mar 2003 01:47:11 +0000 (17:47 -0800)]
[PATCH] fix m68knommu/68VZ328/ucdimm Makefile to compile local code files
This patch fixes the m68knomu/68VZ328/ucdimm Makefile to build all its
local code files. Previously it relied on Makefiles above it to do
this. It should be done here.
Greg Ungerer [Tue, 11 Mar 2003 01:47:00 +0000 (17:47 -0800)]
[PATCH] fix m68knommu/68VZ328/de2 Makefile to compile local code files
This patch fixes the m68knomu/68VZ328/de2 Makefile to build all its
local code files. Previously it relied on Makefiles above it to do
this. It should be done here.
Greg Ungerer [Tue, 11 Mar 2003 01:46:50 +0000 (17:46 -0800)]
[PATCH] move common timer and vector code for m68knommu/ColdFire/5272
This patch moves common ColdFire vector and timer procesing code from
the local per-processor config.c for the 5272 ColdFire sub-architecture.
All ColdFire CPU's have the same timer and basic vector setup, seems
crazy to repeat this code for each of 6 ColdFire CPU varients.
This patch also removes the reset button support, this is now moved to
a proper device driver, where it belongs.
Greg Ungerer [Tue, 11 Mar 2003 01:46:42 +0000 (17:46 -0800)]
[PATCH] fix m68knommu COMEM-lite PCI bios code
This patch fixes up a lot of problems in the m68knommu architecture
CO-MEMlite PCI interface code. The code was seriously out of date,
not implementing many of the requried PCI bios support functions.
Also fixes many wrong function return types and arguments.
Greg Ungerer [Tue, 11 Mar 2003 01:45:59 +0000 (17:45 -0800)]
[PATCH] fix spelling in m68knommu Kconfig help
This patch fixes a couple of spelling errors in the m68knommy Kconfig
help entries. Also makes CONFIG_HIGHPROFILE dependant on CONFIG_COLDFIRE,
since that feature is only implemented on ColdFIre based platforms.
Stephen Rothwell [Tue, 11 Mar 2003 01:34:01 +0000 (17:34 -0800)]
[PATCH] compat_sys_fcntl{,64} Generic part
This patch creates compat_sys_fcntl{,64}. The diffstat for the whole
patch set is below, but this is just the generic part, the architecture
specific parts will follow.
This patch also removes struct flock64 from all the 64 bit architectures
(except parisc).
Andrew Morton [Mon, 10 Mar 2003 15:42:47 +0000 (07:42 -0800)]
[PATCH] ext2: fix directory handling bug
Patch from Dave Miller. Fixes a very long-standing bug.
If a process has an fd open against a now-removed directory, lookups on that
fd will end up calling ext2_find_entry() against a zero-length directory.
When this happens ext2_find_entry() will, on the first pass through the loop,
set `kaddr' to page_address(page) - 20. Things get confused and the "zero
length directory entry" warning triggers.
This only happens on 64-bit machines, because ext2_last_byte() is returning
an unsigned (32-bit) value, and the arithmetic works out OK for 32-bit
machines.
So we change ext2_find_entry() to bale out immediately if the directory is
zero-length. All other directory-walking functions do this, but
ext2_find_entry() forgot to, due to the search-from-the-last-place
optimisation.
Andrew Morton [Mon, 10 Mar 2003 15:42:39 +0000 (07:42 -0800)]
[PATCH] ext3: error handling robustness
Fix a couple of ext3 error handling routines to not assume that the
superblock has valid journal and buffer_head pointers. These functions are
called during mount and unmount and that may not be true.
This should fix the oops which Zwane saw when mounting a corrupt filesystem.
Andrew Morton [Mon, 10 Mar 2003 15:42:31 +0000 (07:42 -0800)]
[PATCH] Force cache alignment of task_structs
I enabled the advanced use-after-free detector for large slab objects and the
kernel oopsed. This is because that debug code adds things at the head of
the slab objects, and the kernel will die if task_structs are not
well-aligned.
The way to tell the slab allocator that it is not allowed to misalign objects
from this slab is SLAB_MUST_HWCACHE_ALIGN.
Andrew Morton [Mon, 10 Mar 2003 15:42:09 +0000 (07:42 -0800)]
[PATCH] NCPFS memleak fix
Patch from Petr Vandrovec <vandrove@vc.cvut.cz>
Reported by Oleg Drokin.
In NCP_IOC_SETOBJECTNAME handler, we allocated space (newname pointer),
copy stuff from userspace to there and then assign userspace
pointer to our internal structure, whoops!
Andrew Morton [Mon, 10 Mar 2003 15:41:53 +0000 (07:41 -0800)]
[PATCH] fix console ordering default
The conversion of the console registration to an initcall-style thing has
broken lots of people's setups. It is now dependent upon linkage order and
if you have both CONFIG_VT_CONSOLE and CONFIG_SERIAL_CONSOLE, no boot
messages come out on the screen because the kernel is selecting the serial
console first.
It can be fixed by specifying console=tty0, but nobody is doing that.
We can fix it up by placing drivers/char/ in front of drivers/serial/ in
linkage order.
Andi Kleen [Mon, 10 Mar 2003 09:41:56 +0000 (01:41 -0800)]
[PATCH] x86-64 updates for 2.5.64-bk3
Make x86-64 boot again after the INITIAL_JIFFIES changes
and some bug fixes. Also some work for NPTL.
- Merge with i386/2.5.64-bk3
- Fix memory leak in copy_thread
- arch_prctl uses GDT for base if possible. Cleanup.
- clone supports bases >32bit for SETTLS etc. %fs hardcoded now.
- new ptrace support for 64bit TLS
- Disable (set|get)_thread_* for 64bit processes.
- Audit arch/x86_64 for jiffies wrap issues.
- Fix initial jiffies problem (that caused hanging kernels)
- FIx a few 32bit emulation bugs (sigaltstack, sigqueue)
- Some cleanup from Pavel
- Should compile again as UP
- Shrink size a bit by not putting exception tables into object files.
- Fix compilation with gcc 3.3 :- force inlining when needed
- Work around 2.5.64-bk3 console init bug.
- Fix some alignments in assembly code
Rationale: devfs_only does nothing but disabling {un,}register_blkdev
and {un,}register_chrdev. {un,}register_blkdev already do nothing but
adding it's name argument to a lookup table for the __bdevname and
/proc/device output so this use is already bogus. The disabling of
the character device per-major arrays can work in practice but is
useless as any driver relying on it can't be used on non-devfs systems.
Andrew Morton [Mon, 10 Mar 2003 09:36:27 +0000 (01:36 -0800)]
[PATCH] revert "noirqbalance still doesn't do anything"
This recent patch caused Nick Piggin's 2xPIII VIA686B chipset machine into an
interrupts-off lockup during IDE probing.
We don't really know why - it might be because an interrupt is delivered to a
secondary which doesn't expect it.
I have a second patch from Zwane which solves the same problem in a different
way, but until that's had some wider testing I suggest we just back off the
original.
Matthew Wilcox [Mon, 10 Mar 2003 09:32:14 +0000 (01:32 -0800)]
[PATCH] neaten fs/locks.c a little
- Fix my email address to one which reaches me ;-)
- Remove timer.h include as we don't use timers.
- Add module.h.
- Sort includes alphabetically.
- Move EXPORT_SYMBOL from ksyms.c to locks.c.
- Simplify locks_conflict().
Linus Torvalds [Mon, 10 Mar 2003 06:41:27 +0000 (22:41 -0800)]
Use a fixed per-cpu SYSENTER_MSR_ESP value by having the sysenter
entry routine load the real ESP0 off that per-cpu stack. Make this
even faster by putting the sysenter stack in the per-CPU TSS, so
that we can use the tss->esp0 value directly (which we have to
update on task switches anyway).
CAREFUL! This needs very subtle code for debug and NMI exceptions,
to make sure we don't run with the sysenter stack in any real kernel
code!
Dave Kleikamp [Mon, 10 Mar 2003 06:32:02 +0000 (00:32 -0600)]
JFS: Fix hang while flushing outstanding transactions under heavy load
During syncbarrier recovery, when JFS is waiting for all outstanding
transactions to complete before allowing new ones to start, there was a
window where a new transaction starts, but is not committed when JFS thought
it could stop flushing the journal to disk. This caused the log_SYNCBARRIER
flag to not be reset, and no new transactions are allowed to start.
This is fixed by using the log->active field to determine when to reset the
log_FLUSH flag.