From a9edadbf790d72adf6ebed476cb5caf7743e7e4a Mon Sep 17 00:00:00 2001 From: Mark Lord Date: Fri, 28 Mar 2008 19:05:25 -0400 Subject: fix uevent action-string regression Mark Lord wrote: > > On boot, syslog is flooded with "uevent: unsupported action-string;" messages. .. > Mar 28 14:43:29 shrimp kernel: tty ptyqd: uevent: unsupported > action-string; this will be ignored in a future kernel version > Mar 28 14:43:29 shrimp kernel: tty ptyqe: uevent: unsupported > action-string; this will be ignored in a future kernel version > Mar 28 14:43:29 shrimp kernel: tty ptyqf: uevent: unsupported > action-string; this will be ignored in a future kernel version > Mar 28 14:43:29 shrimp kernel: tty ptyr0: uevent: unsupported > action-string; this will be ignored in a future kernel version .. These messages are a regression compared with 2.6.24, which did not flood the syslog with them. The actual underlying problem was introduced in 2.6.23, when somebody made the string parsing no longer accept nul-terminated strings as a valid input to store_uevent(). Eg. "add\0" was valid prior to 2.6.23, where the code regressed to require "add" without the '\0'. This patch fixes the 2.6.23 / 2.6.24 regressions, by having the code once again tolerate the trailing '\0', if present. According to GregKH, this mainly affects older Ubuntu systems, such as the one I have here that requires this fix. Signed-off-by: Mark Lord Signed-off-by: Linus Torvalds --- lib/kobject_uevent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 5a402e2982a..5b6d7f6956b 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -55,7 +55,7 @@ int kobject_action_type(const char *buf, size_t count, enum kobject_action action; int ret = -EINVAL; - if (count && buf[count-1] == '\n') + if (count && (buf[count-1] == '\n' || buf[count-1] == '\0')) count--; if (!count) -- cgit v1.2.3 From 61407f80f72970d52d4339f81c6c3cd03f4ca0f0 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Thu, 3 Apr 2008 14:07:02 -0700 Subject: [NET]: srandom32 fixes for networking v2 - Let it update the state of all CPUs. The network stack goes into pains to feed the current IP addresses in, but it is not very effective if that is only done for some random CPU instead of all. So change it to feed bits into all CPUs. I decided to do that lockless because well somewhat random results are ok. v2: Drop rename so that this patch doesn't depend on x86 maintainers Signed-off-by: Andi Kleen Signed-off-by: David S. Miller --- lib/random32.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/random32.c b/lib/random32.c index ec7f81d3fb1..ca87d86992b 100644 --- a/lib/random32.c +++ b/lib/random32.c @@ -97,13 +97,18 @@ EXPORT_SYMBOL(random32); * @seed: seed value * * Add some additional seeding to the random32() pool. - * Note: this pool is per cpu so it only affects current CPU. */ void srandom32(u32 entropy) { - struct rnd_state *state = &get_cpu_var(net_rand_state); - __set_random32(state, state->s1 ^ entropy); - put_cpu_var(state); + int i; + /* + * No locking on the CPUs, but then somewhat random results are, well, + * expected. + */ + for_each_possible_cpu (i) { + struct rnd_state *state = &per_cpu(net_rand_state, i); + __set_random32(state, state->s1 ^ entropy); + } } EXPORT_SYMBOL(srandom32); -- cgit v1.2.3 From a1e58bbdc969c3fe60addca7f2729779d22a83c1 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Thu, 10 Apr 2008 13:38:23 -0700 Subject: lzo: fix typo in decompressor Shift of a LE value seems strange, probably meant to shift the cpu-order variable as in the prvious section of the switch statement. Signed-off-by: Harvey Harrison Acked-by: Richard Purdie Signed-off-by: Linus Torvalds --- lib/lzo/lzo1x_decompress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/lzo/lzo1x_decompress.c b/lib/lzo/lzo1x_decompress.c index 9dc7056e552..77f0f9b775a 100644 --- a/lib/lzo/lzo1x_decompress.c +++ b/lib/lzo/lzo1x_decompress.c @@ -158,7 +158,7 @@ match: t += 7 + *ip++; } m_pos -= le16_to_cpu(get_unaligned( - (const unsigned short *)ip) >> 2); + (const unsigned short *)ip)) >> 2; ip += 2; if (m_pos == op) goto eof_found; -- cgit v1.2.3