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>
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>
Antonino Daplas [Tue, 31 Aug 2004 03:41:55 +0000 (20:41 -0700)]
[PATCH] fbdev: fix copy_to/from_user in fbmem.c:fb_read/write
This patch fixes a problem reported by David S. Miller <davem@redhat.com>
"I just noticed that fb_{read,write}() uses copy_*_user() with
the kernel buffer being the frame buffer. It needs to use
the proper device address accessor functions."
The patch will do an intermediate copy of the contents to a page-sized,
kmalloc'ed buffer.
Antonino Daplas [Tue, 31 Aug 2004 03:41:42 +0000 (20:41 -0700)]
[PATCH] fbdev: fix kernel panic from FBIO_CURSOR ioctl
1. This fixes a kernel oops when issuing an FBIO_CURSOR ioctl if struct
fb_cursor_user is filled with zero/NULLs. Reported by Yuval Kogman
<nothingmuch@woobling.org>.
2. This also fixes the cursor corruption in soft_cursor when
sprite.scan_align != 1.
It's already marked BROKEN_ON_SMP, but even a UP compile yields tons of
errors. While those aren't deeply complicated to fix having them for over
a year now is a pretty good indicator no one cares.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
attached patch changes the subfrequency carrier value in the adv7175
video output driver which is part of the zr36067 driver package. The
practical consequence is that the picture will be more stable on
non-passthrough video mode in NTSC. It does not affect PAL/SECAM. Patch
originally submitted by Douglas Fraser <ds-fraser@comcast.net> (8/21).
Signed-off-by: Ronald Bultje <rbultje@ronald.bitfreak.net> Signed-off-by: Douglas Fraser <ds-fraser@comcast.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ronald Bultje [Tue, 31 Aug 2004 03:40:19 +0000 (20:40 -0700)]
[PATCH] zr36067 driver - use msleep() instead of schedule_timeout()
attached patch makes the zr36067 driver use msleep() instead of
schedule_timeout() with uninterruptible state. Patch originally
submitted by Nishanth Aravamudan <nacc@us.ibm.com> (7/26).
Signed-off-by: Ronald Bultje <rbultje@ronald.bitfreak.net> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ronald Bultje [Tue, 31 Aug 2004 03:40:07 +0000 (20:40 -0700)]
[PATCH] zr36067 driver - correct i2c-algo-bit dependency in Kconfig
attached patch correctly makes the zr36067 driver depend on i2c-ago-bit in
the kernel config. Bug reported and patch sent to me by Adrian Bunk
<bunk@fs.tum.de> (6/21). It wasn't signed off.
Signed-off-by: Ronald Bultje <rbultje@ronald.bitfreak.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ryan S. Arnold [Tue, 31 Aug 2004 03:39:20 +0000 (20:39 -0700)]
[PATCH] interrupt driven hvc_console as vio device
This is an hvc_console patch which provides driver and ppc64 architecture
fixes to enable the hvc_console driver to register itself as a vio device
with the vio bus, provide hotplug add/remove for vty adapters, and act as
an interrupt driven driver on Power-5 hardware or remain as a polling
driver on Power-4 hardware.
- Changed hvc_get_chars() and hvc_put_chars() api to take vtermno rather
than index number.
- Added hvc_find_vtys() function which walks the bus looking for
vterm/vty devices to callback to the hvc_console driver. This provides
console output functionality prior to early console init (pre mem init
and pre device probe).
- Switch khvcd from kernel_threads to kthreads which got rid of
deprecated daemonize().
- Added module exit clause to be thorough (not terribly necessary with a
console driver of course)
- Added early discovery of vterm/vty adapters by doing a bus walk on
early console init which results in hvc_instantiate() callback and
addition of the vtermno into a static array of vtermnos supported as
console adapters (meaning the console api's work against these vtermnos
prior to full console initialization).
- This driver is now registered as a vio driver which means that vty
adapters are now managed via probe/remove. This means hvc_console
supports hotplug vty adapters.
- Driver now requests more device nodes than what was found on the
initial bus walk when registered as a tty driver to make room for hotplug
vty adapters. These secondary vty adapters provide a tty tunnel between
partitions.
- Removed static hvc_struct array and replaced with a linux list that has
elements (hvc_struct instances) added/removed on probe/remove AFTER early
console init. This is important because kmalloc can't be done at early
console init.
- Driver now either runs in interrupt driven mode or in polling mode on
older hardware. The khvcd is smart enough to not 'schedule()' when there
are no interrupts.
- kobjects are now used for ref counting on the hvc_struct instances.
- This driver puts the tty layer to sleep on hvc_close() if there are
pending data writes being blocked by firmware.
- Removed useless spinlocks in hvc_chars_in_buffer() and hvc_write_room.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Ryan S. Arnold <rsa@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Howells [Tue, 31 Aug 2004 03:38:57 +0000 (20:38 -0700)]
[PATCH] Fix a NULL pointer bug in do_generic_file_read()
The attached patch fixes a bug introduced into do_generic_mapping_read() by
which a file pointer becomes required. I'd arranged things so that the
file pointer was optional so that I could call the function directly on an
inode.
Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
H. Peter Anvin [Tue, 31 Aug 2004 03:38:44 +0000 (20:38 -0700)]
[PATCH] Make i386 signal delivery work with -mregparm
This patch allows i386 signal delivery to work correctly when userspace is
compiled with -mregparm. This is somewhat hacky: it passes the arguments
*both* on the stack and in registers, but it works because there are only
one or three (depending on SA_SIGINFO) official arguments. If you're
relying on the unofficial arguments then you're doing something nonportable
anyway and can put in the __attribute__((cdecl,regparm(0))) in the correct
place.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Moyer [Tue, 31 Aug 2004 03:38:32 +0000 (20:38 -0700)]
[PATCH] netpoll: fix up trapped logic
This patch contains the updates necessary to fix the hangs in netconsole.
This includes the changing of trapped to an atomic_t, and the addition of a
netpoll_poll_lock. It also turns dev->netpoll_rx into a bitfield which is
used to keep from running the networking code from the netpoll_poll call path.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Matt Mackall [Tue, 31 Aug 2004 03:37:55 +0000 (20:37 -0700)]
[PATCH] netpoll: revert queue stopped change
Here's the first of the broken out patch set. This puts the check for
netif_queue_stopped back into netpoll_send_skb. Network drivers are not
designed to have their hard_start_xmit routines called when the queue is
stopped.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>