[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.
- 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>
Alexander Viro [Tue, 31 Aug 2004 09:41:25 +0000 (02:41 -0700)]
[PATCH] usx2y cleanups and fixes
Sigh...
a) mixing of userland and kernel pointers is bad
b) so's not checking result of kmalloc()
c) so's not checking result of copy_from_user()
d) use of do { .... break; ... break; ... } while(0); is *highly*
unidiomatic. Do not confuse kernel with IOCCC, please. And if you have
religious aversion to multiple return statements in a function, at least
learn the reasons why it is frowned upon in many situations. Hint: they
all apply to use of break in that manner.
e) 0 instead of NULL
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alexander Viro [Tue, 31 Aug 2004 09:41:13 +0000 (02:41 -0700)]
[PATCH] alpha warning fixes
pci_dma_sync_single_for_device() had wrong prototype [who TF had come up
with that name, anyway?]
->cpu in thread_info was long; it should be unsigned int.
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
zfcp host adapater changes:
- Add ability to enqueue other WKA ports besides the nameserver port.
- Document and cleanup sg_list functions.
- Add get_port_by_did/get_adapater_by_busid functions.
- Improve documentation of some functions and structures.
- Fix error handling for nameserver requests.
- Correct size check in zfcp_sg_list_copy_to_user.
- Correct parameter description for loglevel parameter.
- Remove unsused code, types and definitions.
- Add support for exchange_port_data command.
- Add infrastructure to set timers for ELS and SCSI commands.
- Avoid adapter shutdown after receiving FSF_SQ_ULP_PROGRAMMING_ERROR.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This adds support for the new compiler options -mkernel-backchain,
-mstack-size, -mstack-guard, -mwarn-dynamicstack and -mwarn-framesize.
The option -mkernel-backchain enables the use of modified layout for the
stack frames of kernel functions. This breaks the ABI, modules compiled
with the option won't work on a kernel compiled with the option and vice
versa. The positive effect of the option is a drastic reduction of kernel
stack use. The trick is that the new frame layout allows to overlap the 96
(31 bit)/160 (64 bit) byte bias areas of the functions on the call chain.
This lowers the minimal stack usage of a function from 96 bytes to 16 bytes
(31 bit) and 160 bytes to 24 bytes (64 bit). The kernel stack use is
decreased to a point where it is possible to use 4K (31 bit) / 8K (64 bit)
stacks. The split into process stack and interrupt stack is already in
place.
The options -mstack-size and -mstack-guard are used to detect kernel stack
overflows. The compiler adds code to the prolog of every function that
causes an illegal operation if the kernel stack is about to overflow.
The options -mwarn-dynamicstack and -mwarn-framesize cause the compiler to
emit warnings if a function uses dynamic stack allocation or if the
function frame size is bigger then a specified limit.
To play safe all the new options are configurable.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
s390 core changes:
- Fix a race condition between kernel thread creation and preemption.
- Fix idal_is_needed for the border case 0x7ffff000.
- Get rid of compiler warnings in compat_signal.c and profile.c.
- Regenerate default configuration.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jacek Poplawski [Tue, 31 Aug 2004 03:42:33 +0000 (20:42 -0700)]
[PATCH] stv0299 device naming fix
Name of device has been changed in 2.6.9-rc1 to "SkyStar2", but module stv0299
still compares name with "Technisat SkyStar2 driver", strings are different,
and result is that stv0299 detects invalid tuner type.
Cc: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Gerd Knorr [Tue, 31 Aug 2004 03:42:07 +0000 (20:42 -0700)]
[PATCH] v4l/bttv: add sanity check (bug #3309)
Missing sanity check, overlay is supported for packed pixel formats only.
Patch below. It's not API related btw, the bug can be triggered using the
v4l2 API as well.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>