Andrew Morton [Fri, 21 May 2004 06:23:55 +0000 (23:23 -0700)]
[PATCH] drop left-over #ifndef __ia64__
From: David Mosberger <davidm@napali.hpl.hp.com>
It used to be that loops_per_jiffy was a macro on ia64, hence it couldn't be
exported. That's no longer the case though, so there is no point in
inhibiting its export (not that it makes any _sense_ to export that value on
ia64).
Andrew Morton [Fri, 21 May 2004 06:23:44 +0000 (23:23 -0700)]
[PATCH] Fix i386/x86_64 cpuid/msr BUG() on impossible CPUs
From: Rusty Russell <rusty@rustcorp.com.au>
Matthieu Castet <castet.matthieu@free.fr> pointed out that testing
cpu_online(cpu) on a UP system goes BUG().
That's because you're never supposed to ask cpu_online() about a CPU which
is >= NR_CPUS. msr and cpuid devices use the minor to indicate the CPU
number. Oops.
Fix is to explicitly test cpu < NR_CPUS. Using cpu_online() is OK;
although the CPU might go down before you actually read the file, that will
simply cause junk to be returned.
Andrew Morton [Fri, 21 May 2004 06:22:29 +0000 (23:22 -0700)]
[PATCH] trivial: Make JFFS2 ready for Linux 2.7
From: Rusty Russell <rusty@rustcorp.com.au>
(OK from maintainer David Woodhouse <dwmw2@infradead.org>)
From: Sam Ravnborg <sam@ravnborg.org>
From: <l.s.r@web.de>
> since the code for Linux 2.4 compatibility in fs/jffs2 is gone, we can
> clean up the Makefile a bit. Following patch makes the Makefile
> compatible with Linux 2.7 instead . :) Please consider applying.
If we are going to clean up this I prefer we get rid of the
local variables.
See attached patch.
Pure cosmetic. Largest biovec slab is printed as biovec-BIO_MAX_PAGES in
/proc/slabinfo. It would be more informative to print actual number instead
of macro's name.
Andrew Morton [Fri, 21 May 2004 06:20:48 +0000 (23:20 -0700)]
[PATCH] Fix NFSD oops in readdir
From: Neil Brown <neilb@cse.unsw.edu.au>
If a single readdir entry needs to be split over two pages in the reply, we
first encode it into a new page, and then copy the bits into place. When
we do this relocation, we have to modify the "offset" pointer to be either
in the first or the second page, as appropriate.
If the pointer should be at the start of the second page, it is currently
put past the end of the first page.
Note that as the offset and whole response is known to be 4byte-aligned,
the offset pointer will never be split over two pages.
Andrew Morton [Fri, 21 May 2004 06:20:26 +0000 (23:20 -0700)]
[PATCH] getblk() BUG removal
We keep on getting BUG()s from isofs_read_super() because it passes an insane
blocksize to bread(). See http://bugme.osdl.org/show_bug.cgi?id=2735 for
example.
I don't know what's up with isofs, but going BUG in there seems a bit rude.
Change it to drop a bunch of diagnostics and a backtrace then return a null
bh*.
Most callers of getblk() don't expect it to fail, so they'll oops anyway. But
isofs does actually check for a NULL return. This way, the machine stays up
and we get better debug diagnostics.
Andrew Morton [Fri, 21 May 2004 06:20:14 +0000 (23:20 -0700)]
[PATCH] Debugging option to put data symbols in kallsyms
From: Rusty Russell <rusty@rustcorp.com.au>
kallsyms contains only function names, but some debuggers (eg. xmon on
PPC/PPC64) use it to lookup symbols: it'd be much nicer if it included data
symbols too.
Andrew Morton [Fri, 21 May 2004 06:19:40 +0000 (23:19 -0700)]
[PATCH] ramdisk: fix PageUptodate() handling
When a filesystem does getblk() to get a buffer_head against the ramdisk the
VFS will allocate a new not-uptodate pagecache page and will attach buffers to
it.
The filesystem will then bring certain buffer_heads uptodate. But not the
whole page.
Later, various ramdisk a_ops see the not-uptodate page and wipe the whole
thing out, including the parts to which the filesystem wrote!
Fix that up by only zapping those parts of the page which are covered by
non-uptodate buffers.
Andrew Morton [Fri, 21 May 2004 06:19:17 +0000 (23:19 -0700)]
[PATCH] ramdisk: lock blockdev pages during "IO".
There's a race: one CPU writes a 1k block into a ramdisk page which isn't in
the blockdev pagecache yet. It memsets the locked page to zeroes.
While this is happening, another CPU comes in and tries to write a different
1k block to the "disk". But it doesn't lock the page so it races with the
memset and can have its data scribbled over.
Fix this up by locking the page even if it already existed in pagecache.
Locking a pagecache page in a make_request_fn sounds deadlocky but it is not,
because:
a) ramdisk_writepage() does nothing but a set_bit(), and cannot recur onto
the same page.
b) Any higher-level code which holds a page lock is supposed to be
allocating its memory with GFP_NOFS, and in 2.6 kernels that's equivalent
to GFP_NOIO.
(The distinction between GFP_NOIO and GFP_NOFS basically disappeared
with the buffer_head LRU, although it was reused for writes to swap).
Andrew Morton [Fri, 21 May 2004 06:18:44 +0000 (23:18 -0700)]
[PATCH] ppc64: make enter_rtas() take unsigned long arg
From: Paul Mackerras <paulus@samba.org>
We declare enter_rtas with a struct rtas_args * argument, though it is
supposed to be a physical address, and then every time we call it we cast the
unsigned long result from __pa() to a void *. This patch changes the
declaration of enter_rtas to make it take an unsigned long argument, and
removes the cast from all the callers. The actual enter_rtas() routine is in
assembler and doesn't need to be changed.
Andrew Morton [Fri, 21 May 2004 06:18:21 +0000 (23:18 -0700)]
[PATCH] ppc64: update xmon debugger
From: Paul Mackerras <paulus@samba.org>
This patch fixes a whole pile of problems in the xmon kernel debugger for
ppc64. This basically makes xmon SMP-safe. Now, when we enter xmon it
sends an IPI to the other CPUs to get them into xmon too. It also changes
the way we do single-stepping and breakpoints so that we don't have to
remove a breakpoint to proceed from it (instead we either emulate the
instruction where the breakpoint was, or execute it out of place). With
this patch, if we get an exception inside xmon, it will just return to the
xmon command loop instead of hanging the system as at present.
The patch is quite large because it updates the disassembler to the latest
version from binutils (trimmed a bit), which is why I didn't cc lkml.
Andrew Morton [Fri, 21 May 2004 06:18:10 +0000 (23:18 -0700)]
[PATCH] ppc64: fix inline version of _raw_spin_trylock
From: Paul Mackerras <paulus@samba.org>
When I added the out-of-line spinlocks on PPC64, I inadvertently introduced
a bug in the inline version of _raw_spin_trylock, where it returns the
opposite of what it should return. The patch below fixes it.
Andrew Morton [Fri, 21 May 2004 06:17:59 +0000 (23:17 -0700)]
[PATCH] ppc64: Fix readq & writeq
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This fixes busted asm constraints for readq & writeq implementation on
ppc64 that resulted in garbage beeing generated for writeq (plus an obvious
mistake in the prototype).
Andrew Morton [Fri, 21 May 2004 06:17:47 +0000 (23:17 -0700)]
[PATCH] fix for stuck cpus at boot]
From: Anton Blanchard <anton@samba.org>
From: Rusty Russell <rusty@rustcorp.com.au>
When hotplug cpu isn't enabled, cpu_is_offline is always false. I had a stuck
cpu at boot that resulted in a lockup because we tried to start a migration
thread on it. Instead of cpu_is_offline we can use !cpu_online which should
cover both the hotplug cpu enabled and disabled cases.
Trond Myklebust [Thu, 20 May 2004 11:47:06 +0000 (07:47 -0400)]
Following a suggestion by Jamie Lokier
RPC: Make "major" timeouts be of fixed length "timeo<<retrans"
rather than counting the number of retransmissions. The
clock starts at the first attempt to send each request.
RPC: Ensure that we "slow start" the RTT estimation after a
major timeout has occurred.
Trond Myklebust [Thu, 20 May 2004 11:45:19 +0000 (07:45 -0400)]
NFS O_DIRECT: Change the NFS O_DIRECT path so that it
no longer calls the generic VFS read and write routines.
This allows all application read requests to pass through
to the server, instead of just the ones that appear to be
inside the file. this eliminates the requirement to use a
GETATTR operation before each read or write to determine
where the EOF is. This is a significant performance and
scalability win.
It also removes all requirements for holding the inode
semaphore during NFS direct reads and writes, as the read
and write logic no longer needs atomic access to the size
of the file. this also helps client CPU scalability by
reducing the serialization of writes against a single file.
Trond Myklebust [Thu, 20 May 2004 11:43:48 +0000 (07:43 -0400)]
NFS_O_DIRECT: there's a code path in nfs_direct_write_seg
where NFS_I(inode)->data_updates can get out of sync
with reality, which will lead to a BUG() in nfs_clear_inode
later on.
Dave Kleikamp [Thu, 20 May 2004 10:46:12 +0000 (05:46 -0500)]
JFS: [CHECKER] if txCommit fails, don't call d_instantiate
In several functions, d_instantiate is called before the transaction
is committed. Under the rare condition that txCommit fails, the new
inode is released, but the dentry continues to point to it. This
can lead to a seg fault. The fix is to call d_instantiate after
txCommit has run successfully.
When the kmem_bufctl_t typedef got added to include/asm-ppc64/types.h,
it got added outside the #ifndef __ASSEMBLY__ section, causing
assembler errors. This patch, from David Gibson, moves it inside the
#ifndef __ASSEMBLY__ region.
Andrew Morton [Wed, 19 May 2004 13:10:35 +0000 (06:10 -0700)]
[PATCH] raid locking fix.
From: Neil Brown <neilb@cse.unsw.edu.au>
Fix bug #2661
Raid currently calls ->unplug_fn under spin_lock_irqsave(), but unplug_fns
can sleep.
After a morning of scratching my head and trying to come up with some that
does less locking, the following is the best I can come up with. I'm not
proud of it but it should work.
If I move "nr_pending" out or rdev into the per-personality structures
(e.g. mirror_info), and if I had "atomic_inc_if_nonzero" I could do with
without locking so much, but random atomic* functions don't seem trivial
Andrew Morton [Wed, 19 May 2004 09:42:48 +0000 (02:42 -0700)]
[PATCH] sir_dev locking fix
From: Martin Diehl <lists@mdiehl.de>
There was a spin_unlock missing in the raw mode tx-completion path. Probably
it slipped through because the raw mode stuff is never reached with my Actisys
hardware.
Andrew Morton [Wed, 19 May 2004 09:42:37 +0000 (02:42 -0700)]
[PATCH] s390: network driver
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
Network driver changes:
- iucv: Make grab_param function SMP safe.
- lcs: Fix null-pointer dereference after unsuccessful set_online.
- qeth: Fix kmalloc flags in qeth_alloc_reply.
- qeth: Show broadcase capability also in route4/6 sysfs attributes.
- qeth: Remove debug code.
- qeth: Add option to qetharp user space interface to strip unused
fields from query arp records.
- qeth: Add shortcut in outbound path for HiperSockets.
- qeth: Add more info to qeth_perf_stats.
- qeth: Add support for direct SNMP interface to OSA express cards.
Andrew Morton [Wed, 19 May 2004 09:41:54 +0000 (02:41 -0700)]
[PATCH] use-before-uninitialized value in ext3(2)_find_ goal
From: Mingming Cao <cmm@us.ibm.com>
There is a uninitialized goal value being referenced in both ext3 and ext2
find goal block functions (ext3_find_goal() and ext2_find_goal()).
In the non-sequential write case, these functions check the goal value(non
zero) before calling ext3(2)_find_near() to find the goal block to
allocate.
Since the goal value is uninitialized(non zero), the ext3(2)_find_near() is
never being called in the non-sequential write, thus ext3(2)_find_goal()
failed to guide a goal block in the random write case.
ext3(2)_new_block() takes the junk goal value and will turn it to goal 0
since it's normally beyond the filesystem block number limit. The fix is
trivial.