... but a better solution should probably be found, that's saved_auxv
in struct mm_struct is ... hrm... disgusting at least ;)
So the problem is that we currently do
unsigned long saved_auxv[40];
That is we assume that all archs will have an AUXV entry of no more than
2 unsigned longs and we'll have no more than 20 entries in the table.
Unfortunately, this is wrong.
PPC/PPC64 adds 5 platform entries. then we add 14 in the common code,
and then we have
if (k_platform) {
NEW_AUX_ENT(AT_PLATFORM, (elf_addr_t)(unsigned long)u_platform);
}
if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) {
NEW_AUX_ENT(AT_EXECFD, (elf_addr_t) bprm->interp_data);
}
which may add a 20th entry... which means we are already out of room for
the terminating AT_NULL entry... bad bad bad.
Now I'm adding AT_SYSINFO_EHDR to ppc/ppc64 and it breaks all the time.
The quick fix is to bump the number of entries in struct mm_struct to 42,
though that's worth a big BOLD comment in binfmt_elf in case anybody adds
a new entry in there. (Patch below). I wonder if we shouldn't add a
ARCH_MAX_AUXV_ENTRIES macro to the asm-arch/elf.h though to get the max
amount of entry the arch may add to the normal count, and have the mm
struct array use that plus the number of "normal" entries...
This patch increase the max amount of auxv entries in struct mm_struct to
42 so that ppc & ppc64 don't get a chance to blow the array up.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton [Fri, 3 Sep 2004 03:21:45 +0000 (20:21 -0700)]
[PATCH] ipr.c build fix
drivers/scsi/ipr.c: In function `ipr_worker_thread':
drivers/scsi/ipr.c:1825: wrong type argument to unary exclamation mark
drivers/scsi/ipr.c: In function `ipr_read_dump':
drivers/scsi/ipr.c:2426: wrong type argument to unary exclamation mark
Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Brian King <brking@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
John Stultz [Fri, 3 Sep 2004 03:21:33 +0000 (20:21 -0700)]
[PATCH] fix target_cpus() for summit subarch
I've been hunting down a bug affecting IBM x440/x445 systems where the
floppy driver would get spurious interrupts and would not initialize
properly.
After digging James Cleverdon and Bill Irwin pointed out that target_cpus()
is routing the interrupts to the clustered apic broadcast mask using
destFixed deliver mode. This was causing multiple interrupts to show up,
breaking the floppy init code.
This fix simply changes the delivery mode to dest_LowestPrio and initially
routes interrupts to the first cpu to resolve this issue.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Fix do_each_task_pid() loop with 'continue' inside
Dmitry Torokhov triggered a problem in the new pidhash macros: These
do_each_task_pid()/while_each_task_pid() do loop forever if you use a
'continue' inside them.
The end of the loop has to be inside the "while()" statement, so as to
not make "continue" jump over it.
The lock in the nat-helper is unneccessary because the expectation
is never changed and is protected by ip_conntrack_lock.
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Thu, 2 Sep 2004 16:58:05 +0000 (09:58 -0700)]
[NETFILTER]: Fix confusing naming in NAT-helpers
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
- Now that the VFS no longer uses it, we don't need to cache the symlink
string length.
- Make ->readlink() take page offset+length arguments
- Fix up page under/overflow checking on the readlink XDR code so that
it matches read/write.
This patch fixes strange and obscure pid implementation in current kernels:
- it removes calling of put_task_struct() from detach_pid()
under tasklist_lock. This allows to use blocking calls
in security_task_free() hooks (in __put_task_struct()).
- it saves some space = 5*5 ints = 100 bytes in task_struct
- it's smaller and tidy, more straigthforward and doesn't use
any knowledge about pids using and assignment.
- it removes pid_links and pid_struct doesn't hold reference counters
on task_struct. instead, new pid_structs and linked altogether and
only one of them is inserted in hash_list.
Chris Wedgwood [Thu, 2 Sep 2004 07:39:41 +0000 (00:39 -0700)]
[PATCH] i386 reduce spurious interrupt noise
i386 hardware can (and does) see spurious interrupts from time to
tome. Ideally I would like the printk removed completely but this is
probably good enough for now.
Signed-off-by: Chris Wedgwood <cw@f00f.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Dave Jones [Thu, 2 Sep 2004 07:37:17 +0000 (00:37 -0700)]
[PATCH] Clean up failure path in DAC960
1. If the ScatterGatherPool allocation fails, its pointless
trying to allocate a RequestSensePool.
2. Free up the ScatterGatherPool if the RequestSensePool allocation fails.
Spotted with the source checker from Coverity.com.
Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Patrick McHardy [Thu, 2 Sep 2004 07:26:24 +0000 (00:26 -0700)]
[IPV4/IPV6]: Fix suboptimal fragment sizing for last fragment
Yoshifuji's recent fragment patch prevents unnecessary fragmentation
when the data can be kept in a single packet, but only for the first
packet. When fragmenting, all fragments are still truncated to
multiples of 8 and we might end up creating an unnecessary fragment.
This patch always builds mtu sized fragments and truncates the previous
fragment to a multiple of 8 bytes when allocating a new one. With the
patch the dump looks like this:
Herbert Xu [Wed, 1 Sep 2004 15:07:46 +0000 (08:07 -0700)]
[IPV4/IPV6]: Fixup checksums properly when fragmenting.
If we end up with a fraggap, when we copy the data
over to the next frag being built we must compute
a checksum for the bit we copy over for the new
fragment and subtract that checksum from the place
we are copying it from.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Maximilian Attems <janitor@sternwelten.at> Signed-off-by: David S. Miller <davem@davemloft.net>
Use "ifdef" rather than "if" to test for __KERNEL__
Both work, but the latter can cause warnings in user space
from compilers that don't like using undefined identifiers
in preprocessor expressions (quite reasonable).
David S. Miller [Wed, 1 Sep 2004 08:20:12 +0000 (01:20 -0700)]
[SPARC64]: Zap pci_controller_lock.
It is only taken during boot time bus probe, thus
protects nothing at run time and causes bogus bug
messages when PREEMPT is enabled. When we support
PCI controller hot plug we will add a suitable locking
mechanism.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Maximilian Attems <janitor@sternwelten.at> Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Rini [Wed, 1 Sep 2004 05:26:04 +0000 (22:26 -0700)]
[PATCH] ppc32: fix the 'checkbin' target
The checkbin target on PPC32 isn't quite right.
First, one of the tests (to ensure that some instructions are known to
gas) is never actually invoked because 'checkbin' doesn't know about
stuff set in .config, so we always have the 'else' case run. This
changes to always running the test and telling the user to upgrade to at
least binutils 2.12.1.
The next problem is that we were doing $(AS) -o /dev/null ... in both
that test, as well as another. The problem here is that the checkbin
target is run on the install targets, meaning that /dev/null will get
unlinked when the test passes. To get around this we use .tmp_gas_check
as the output file instead.
Acked by Sam.
Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alexander Viro [Wed, 1 Sep 2004 05:18:31 +0000 (22:18 -0700)]
[PATCH] nfs ->follow_link() switched to new scheme
NFS takes some thought to switch to the new symlink scheme, because we
can't rely on the pagecache lookup to find the symlink page when freeing
it - the cache might have been invalidated in the meantime.
So we hide the page information in the symlink data area itself,
by stealing the last pointer in the page used for the cache. That
way nfs_put_link() can just look up the page directly.
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alexander Viro [Tue, 31 Aug 2004 14:46:25 +0000 (07:46 -0700)]
[PATCH] reduce stack use in altroot handling
Massaged altroot handling to avoid on-stack struct nameidata instance (and
got it faster, actually). We are in the middle of do_follow_link() recursion
here, so the stack footprint is critical.
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>