Dave Jones [Tue, 7 Sep 2004 06:24:36 +0000 (23:24 -0700)]
[PACKET]: Fix deref before NULL check in packet_release()
Using the automated source checker at coverity.com, they picked up
on some code in packet_release() where a NULL check was done
after dereferencing. Patch below.
Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 7 Sep 2004 04:03:16 +0000 (21:03 -0700)]
[TCP]: Make sure SKB tso factor is setup early enough.
It needs to be set so that congestion window
calculations have a valid value to work with.
This means that doing it at write queue running
time is too late.
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 7 Sep 2004 02:20:50 +0000 (19:20 -0700)]
[TCP]: Make TSO play nice with congestion window.
Previously TSO would not abide by the congestion
window properly. Essentially, each TSO packet would
be trated just like 1 normal packet, even though a TSO
packet generates more than 1 normal packet. This
violates congestion window rules entirely.
So now we record the TSO factor, a count of how many
real packets a TSO packet will generate, and include
this in all the packet counting routines.
This initial version has a bug in that skb_entail() is
not the correct time to figure out the TSO factor for
the SKB, and tp->mss_tso_factor is not necessarily the
right value for a given SKB. Will fix this up next.
Signed-off-by: David S. Miller <davem@davemloft.net>
Herbert Xu [Fri, 3 Sep 2004 02:01:02 +0000 (19:01 -0700)]
[NET]: Add reference counting to neigh_parms.
I've added a refcnt on neigh_parms as well as a dead flag. The latter
is checked under the tbl_lock before adding a neigh entry to the hash
table.
The non-trivial bit of the patch is the first chunk of net/core/neighbour.c.
I removed that line because not doing so would mean that I have to drop
the reference to the parms right there. That would've lead to race
conditions since many places dereference neigh->parms without holding
locks. It's also unnecessary to reset n->parms since we're no longer
in a hurry to see it go due to the new ref counting.
You'll also notice that I've put all dereferences of dev->*_ptr under
the rcu_read_lock(). Without this we may get a neigh_parms that's
already been released.
Incidentally a lot of these places were racy even before the RCU change.
For example, in the IPv6 case neigh->parms may be set to a value that's
just been released.
Finally in order to make sure that all stale entries are purged as
quickly as possible I've added neigh_ifdown/arp_ifdown calls after
every neigh_parms_release call. In many cases we now have multiple
calls to neigh_ifdown in the shutdown path. I didn't remove the
earlier calls because there may be hidden dependencies for them to
be there. Once the respective maintainers have looked at them we
can probably remove most of them.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
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>
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>