Andi Kleen [Thu, 19 Jun 2003 18:09:54 +0000 (14:09 -0400)]
[PATCH] Remove copied inet_aton code in bond_main.c
According to a report the my_inet_aton code in bond_main.c is copied
from 4.4BSD, but it doesn't carry a BSD copyright license. In addition
it is somewhat redundant with the standard in_aton. Convert it
to use the linux function.
Error handling is a bit worse than before, but not much.
Patch for 2.5 bonding. The 2.4 version has the same problem, but afaik
it is scheduled to be replaced by the 2.5 codebase anyways.
David Mosberger [Thu, 19 Jun 2003 06:35:01 +0000 (23:35 -0700)]
[PATCH] init_thread_union really needed by modules?
init_thread_union doesn't need to be exported to modules.
We haven't exported the symbol on ia64 for ages, and we should be able
to make the init_thread_union local to arch/ARCH/kernel/init_task.c and
that in turn would let us remove its declaration from
include/linux/sched.h altogether (i.e., no more ugly #ifdefs).
Kay Sievers tried with his ~500kB firmware image and kmalloc was not
capable of getting that much memory. He suggested using vmalloc which
sound reasonable.
Art Haas [Thu, 19 Jun 2003 01:58:08 +0000 (18:58 -0700)]
[PATCH] C99 initializers for asm-alpha/include/xor.h
This patch converts the file to C99 initializers. The patch is against
the current BK. The patch is untested as I don't have access to an Alpha
machine.
Ivan Kokshaysky [Thu, 19 Jun 2003 01:57:29 +0000 (18:57 -0700)]
[PATCH] alpha oprofile fix
The oprofile_arch_exit() in discarded .exit.text section is being
called from oprofile_init() in retained .init.text section.
This causes final link failure with oprofile compiled in.
Adam Belay [Wed, 18 Jun 2003 22:38:55 +0000 (22:38 +0000)]
[PNP] Important Resource Parsing Fixes
In some cases, we're reading the wrong bits for large tags. This patch corrects
the issue by setting the affected bits forward by an offset of 2 (skipping over
the size portion of the tag).
Adam Belay [Wed, 18 Jun 2003 22:31:55 +0000 (22:31 +0000)]
[PNP] PnPBIOS resource setting fix
If a device is disabled when initially read, its blank resource data will not
be cleared and the pnp layer will assume incorrectly that the device has
already been configured. This patch resolves the issue by initializing the
resource table if the device is found to be disabled.
This patch resolves the compiler warning caused by the depreciated check_region
function. It may not be the best solution but check_region really is what is
needed here because we never actually have to call "request_region". If prefered,
I could alternatively request and release but doing so would be less efficient.
Adam Belay [Wed, 18 Jun 2003 22:23:14 +0000 (22:23 +0000)]
[PNP] Resource Management Cleanups and Updates
This patch does the following...
1.) changes struct pnp_resources to pnp_option for clarity
2.) greatly cleans up resource option registration
3.) removes some of the current conflict prevention code in
order to increase flexibility, (users will have more control)
4.) various manager cleanups, resulting code is more efficient
5.) fixes the locking bugs many have reported (now uses a mutex)
6.) removes the conflict displaying interface
- it is better to handle such things in user space
7.) also many misc. cleanups
David Mosberger [Wed, 18 Jun 2003 15:46:57 +0000 (08:46 -0700)]
[PATCH] re-enable the building of 8250_hcdp and 8250_acpi
This adds a separate SERIAL_8250_ACPI config option and makes the
8250_acpi.c code dependent on ACPI_BUS (since acpi_bus_register_driver()
is a prerequisite).
I don't understand what was on the mind of Procom programmers,
why do all this inverted logic? Its plain confusing, revert it.
Thanks to DaveM for asking if the logic was inverted, I should
have killed this weird stuff a long time ago :-\
o net: make sk_{add,del}_node functions take care of sock refcounting
With this we make it easier to write correct network families as less
details need to be taken into account, as well in the current state we
make the non-refcounting protocols (the ones still keeping deliver_to_old_ones
in the tree) suck less. 8)
Left a WARN_ON in sk_del_node_init for a while, so that we can catch cases
where we're using __sock_put on a struct sock that has refcnt == 1, which
is not the case for all the ones I tested.
Russell King [Thu, 19 Jun 2003 01:14:04 +0000 (02:14 +0100)]
[ARM] Tighten virt_addr_valid(), add comments for __pa and friends.
Ensure virt_addr_valid(x) works correctly for pointers.
Add comments indicating that drivers should not use virt_to_phys
and/or __pa to obtain an address for DMA.
Russell King [Thu, 19 Jun 2003 00:01:26 +0000 (01:01 +0100)]
[ARM] Separate ICS525 VCO calculation code.
The ICS525 clock chip is used in several different parts of the
Integrator platform. Rather than duplicate the code, separate it
out so everyone can use it.
Andrew Morton [Wed, 18 Jun 2003 01:33:17 +0000 (18:33 -0700)]
[PATCH] ext3: disable O_DIRECT in journalled-data mode
We cannot sensibly support O_DIRECT reads or writes when all writes are
journalled.
This is because the VFS explicitly avoids syncing the file metadata during
O_DIRECT reads and writes. ext3 with journalled data will leave pending
changes in memory and they will overwrite the results of O_DIRECT writes, and
O_DIRECT reads will not return the latest data.
Setting the a_op to null will cause opens and fcntl(F_SETFL) to return
-EINVAL if O_DIRECT is requested.
Andrew Morton [Wed, 18 Jun 2003 01:33:10 +0000 (18:33 -0700)]
[PATCH] JBD: hold onto j_state_lock after
Minro tweak: once log_wait_for_space() has created sufficient space in the
journal to start the new handle, hang onto the spinlock as
start_this_handle() loops around to reevaluate the journal's state.
It prevents anyone else from zooming in and stealing the space we just made.
Andrew Morton [Wed, 18 Jun 2003 01:33:04 +0000 (18:33 -0700)]
[PATCH] JBD: fix locking around log_start_commit()
There are various places in which JBD is starting a commit against a
transaction without sufficient locking in place to ensure that that
transaction is still alive.
Change it so that log_start_commit() takes a transaction ID instead. Make
the caller take a copy of that ID inside the appropriate locks.
Andrew Morton [Wed, 18 Jun 2003 01:32:57 +0000 (18:32 -0700)]
[PATCH] JBD: log_do_checkpoint() locking fixes
log_do_checkpoint is playing around with a transaction pointer without enough
locking to ensure that it is valid. Fix that up by revalidating the
transaction after acquiring the right locks.
Andrew Morton [Wed, 18 Jun 2003 01:32:47 +0000 (18:32 -0700)]
[PATCH] ext3: explicitly free truncated pages
With data=ordered it is often the case that a quick write-and-truncate will
leave large numbers of pages on the page LRU with no ->mapping, and attached
buffers. Because ext3 was not ready to let the pages go at the time of
truncation.
These pages are trivially reclaimable, but their seeming absence makes the VM
overcommit accounting confused (they don't count as "free", nor as
pagecache). And they make the /proc/meminfo stats look odd.
So what we do here is to try to strip the buffers from these pages as the
buffers exit the journal commit.
Andrew Morton [Wed, 18 Jun 2003 01:32:40 +0000 (18:32 -0700)]
[PATCH] JBD: remove j_commit_timer_active
This was a flag which said "the transaction's time is active".
timer_pending() could have told us that, but in fact there is no need to
query it at all.
ext3 no longer keeps the filesystem-wide free blocks counter and free inodes
counter up to date all the time in the superblock. Because that requires
fs-wide locking. These counters are only needed at runtime for the Orlov
allocator heuristics, and we are now using a fuzzy per-cpu coutner for that.
These counters are rather unnecessary: the same info is present in the file
allocation maps and inode tables, the group descriptor blocks and the
bitmaps.
e2fsck will be changed to downgrade the seriousness of this inconsistency.
The filesystem _will_ write these numbers out in the superblock on a clean
unmount, based on the sum of the free block and inode counts in the group
descriptors.
Andrew Morton [Wed, 18 Jun 2003 01:31:29 +0000 (18:31 -0700)]
[PATCH] ext3: fix data=journal mode
ext3's fully data-journalled mode has been broken for a year. This patch
fixes it up.
The prepare_write/commit_write/writepage implementations have been split up.
Instead of having each function handle all three journalling mode we now have
three separate sets of address_space_operations.
The problematic part of data=journal is MAP_SHARED writepage traffic: pages
which don't have buffers. In 2.4 these were cheatingly treated as
data-ordered buffers and that caused several nasty problems.
Here we do it properly: writepage traffic is fully journalled. This means
that the various workarounds for the 2.4 scheme can be removed, when I
remember where they all are.
The PG_checked flag has been borrowed: it it set in the atomic set_page_dirty
a_op to tell the subsequent writepage() that this page needs to have buffers
attached, dirtied and journalled.
This rather defines PG_checked as "fs-private info in page->flags" and it
should be renamed sometime.
Andrew Morton [Wed, 18 Jun 2003 01:31:22 +0000 (18:31 -0700)]
[PATCH] JBD: do_get_write_access() speedup
Avoid holding the journal's j_list_lock while copying the buffer_head's data.
We hold jbd_lock_bh_state() during the copy, which is all that is needed.
Andrew Morton [Wed, 18 Jun 2003 01:31:15 +0000 (18:31 -0700)]
[PATCH] JBD: fix log_start_commit race
In start_this_handle() the caller does not have a handle ref pinning the
transaction open, and so the call to log_start_commit() is racy because some
other CPU could take the transaction into commit state independently.
Fix that by holding j_state_lock (which pins j_running_transaction) across
the log_start_commit() call.
Andrew Morton [Wed, 18 Jun 2003 01:30:45 +0000 (18:30 -0700)]
[PATCH] ext3: ext3_writepage race fix
After ext3_writepage() has called block_write_full_page() it will walk the
page's buffer ring dropping the buffer_head refcounts.
It does this wrong - on the final loop it will dereference the buffer_head
which it just dropped the refcount on. Poisoned oopses have been seen
against bh->b_this_page.
Change it to take a local copy of b_this_page prior to dropping the bh's
refcount.