Magellan Linux

Contents of /trunk/kernel-magellan/patches-3.2/0112-3.2.13-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1713 - (show annotations) (download)
Mon Mar 26 09:50:16 2012 UTC (12 years, 1 month ago) by niro
File size: 15508 byte(s)
-3.2.13-magellan-r1
1 diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
2 index 9b6a820..3394254 100644
3 --- a/arch/powerpc/platforms/powermac/smp.c
4 +++ b/arch/powerpc/platforms/powermac/smp.c
5 @@ -414,7 +414,7 @@ static struct irqaction psurge_irqaction = {
6
7 static void __init smp_psurge_setup_cpu(int cpu_nr)
8 {
9 - if (cpu_nr != 0)
10 + if (cpu_nr != 0 || !psurge_start)
11 return;
12
13 /* reset the entry point so if we get another intr we won't
14 diff --git a/drivers/net/wireless/iwlegacy/iwl-3945.c b/drivers/net/wireless/iwlegacy/iwl-3945.c
15 index f7c0a74..7d1aa7c 100644
16 --- a/drivers/net/wireless/iwlegacy/iwl-3945.c
17 +++ b/drivers/net/wireless/iwlegacy/iwl-3945.c
18 @@ -1870,11 +1870,12 @@ static void iwl3945_bg_reg_txpower_periodic(struct work_struct *work)
19 struct iwl_priv *priv = container_of(work, struct iwl_priv,
20 _3945.thermal_periodic.work);
21
22 - if (test_bit(STATUS_EXIT_PENDING, &priv->status))
23 - return;
24 -
25 mutex_lock(&priv->mutex);
26 + if (test_bit(STATUS_EXIT_PENDING, &priv->status) || priv->txq == NULL)
27 + goto out;
28 +
29 iwl3945_reg_txpower_periodic(priv);
30 +out:
31 mutex_unlock(&priv->mutex);
32 }
33
34 diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c
35 index 05f2ad1..b3d9f3f 100644
36 --- a/drivers/net/wireless/iwlegacy/iwl3945-base.c
37 +++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c
38 @@ -2513,7 +2513,7 @@ static void iwl3945_bg_alive_start(struct work_struct *data)
39 container_of(data, struct iwl_priv, alive_start.work);
40
41 mutex_lock(&priv->mutex);
42 - if (test_bit(STATUS_EXIT_PENDING, &priv->status))
43 + if (test_bit(STATUS_EXIT_PENDING, &priv->status) || priv->txq == NULL)
44 goto out;
45
46 iwl3945_alive_start(priv);
47 diff --git a/fs/afs/internal.h b/fs/afs/internal.h
48 index d2b0888..a306bb6 100644
49 --- a/fs/afs/internal.h
50 +++ b/fs/afs/internal.h
51 @@ -109,7 +109,7 @@ struct afs_call {
52 unsigned reply_size; /* current size of reply */
53 unsigned first_offset; /* offset into mapping[first] */
54 unsigned last_to; /* amount of mapping[last] */
55 - unsigned short offset; /* offset into received data store */
56 + unsigned offset; /* offset into received data store */
57 unsigned char unmarshall; /* unmarshalling phase */
58 bool incoming; /* T if incoming call */
59 bool send_pages; /* T if data from mapping should be sent */
60 diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
61 index e45a323..8ad8c2a 100644
62 --- a/fs/afs/rxrpc.c
63 +++ b/fs/afs/rxrpc.c
64 @@ -314,6 +314,7 @@ int afs_make_call(struct in_addr *addr, struct afs_call *call, gfp_t gfp,
65 struct msghdr msg;
66 struct kvec iov[1];
67 int ret;
68 + struct sk_buff *skb;
69
70 _enter("%x,{%d},", addr->s_addr, ntohs(call->port));
71
72 @@ -380,6 +381,8 @@ int afs_make_call(struct in_addr *addr, struct afs_call *call, gfp_t gfp,
73
74 error_do_abort:
75 rxrpc_kernel_abort_call(rxcall, RX_USER_ABORT);
76 + while ((skb = skb_dequeue(&call->rx_queue)))
77 + afs_free_skb(skb);
78 rxrpc_kernel_end_call(rxcall);
79 call->rxcall = NULL;
80 error_kill_call:
81 diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c
82 index d327140..35a8970 100644
83 --- a/fs/nilfs2/the_nilfs.c
84 +++ b/fs/nilfs2/the_nilfs.c
85 @@ -515,6 +515,7 @@ static int nilfs_load_super_block(struct the_nilfs *nilfs,
86 brelse(sbh[1]);
87 sbh[1] = NULL;
88 sbp[1] = NULL;
89 + valid[1] = 0;
90 swp = 0;
91 }
92 if (!valid[swp]) {
93 diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
94 index 90f6544..769c0e9 100644
95 --- a/net/ipv4/syncookies.c
96 +++ b/net/ipv4/syncookies.c
97 @@ -278,6 +278,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
98 struct rtable *rt;
99 __u8 rcv_wscale;
100 bool ecn_ok = false;
101 + struct flowi4 fl4;
102
103 if (!sysctl_tcp_syncookies || !th->ack || th->rst)
104 goto out;
105 @@ -346,20 +347,16 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
106 * hasn't changed since we received the original syn, but I see
107 * no easy way to do this.
108 */
109 - {
110 - struct flowi4 fl4;
111 -
112 - flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk),
113 - RT_SCOPE_UNIVERSE, IPPROTO_TCP,
114 - inet_sk_flowi_flags(sk),
115 - (opt && opt->srr) ? opt->faddr : ireq->rmt_addr,
116 - ireq->loc_addr, th->source, th->dest);
117 - security_req_classify_flow(req, flowi4_to_flowi(&fl4));
118 - rt = ip_route_output_key(sock_net(sk), &fl4);
119 - if (IS_ERR(rt)) {
120 - reqsk_free(req);
121 - goto out;
122 - }
123 + flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk),
124 + RT_SCOPE_UNIVERSE, IPPROTO_TCP,
125 + inet_sk_flowi_flags(sk),
126 + (opt && opt->srr) ? opt->faddr : ireq->rmt_addr,
127 + ireq->loc_addr, th->source, th->dest);
128 + security_req_classify_flow(req, flowi4_to_flowi(&fl4));
129 + rt = ip_route_output_key(sock_net(sk), &fl4);
130 + if (IS_ERR(rt)) {
131 + reqsk_free(req);
132 + goto out;
133 }
134
135 /* Try to redo what tcp_v4_send_synack did. */
136 @@ -373,5 +370,10 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
137 ireq->rcv_wscale = rcv_wscale;
138
139 ret = get_cookie_sock(sk, skb, req, &rt->dst);
140 + /* ip_queue_xmit() depends on our flow being setup
141 + * Normal sockets get it right from inet_csk_route_child_sock()
142 + */
143 + if (ret)
144 + inet_sk(ret)->cork.fl.u.ip4 = fl4;
145 out: return ret;
146 }
147 diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
148 index eb90aa8..de69cec 100644
149 --- a/net/ipv4/tcp_ipv4.c
150 +++ b/net/ipv4/tcp_ipv4.c
151 @@ -1465,9 +1465,13 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
152 inet_csk(newsk)->icsk_ext_hdr_len = inet_opt->opt.optlen;
153 newinet->inet_id = newtp->write_seq ^ jiffies;
154
155 - if (!dst && (dst = inet_csk_route_child_sock(sk, newsk, req)) == NULL)
156 - goto put_and_exit;
157 -
158 + if (!dst) {
159 + dst = inet_csk_route_child_sock(sk, newsk, req);
160 + if (!dst)
161 + goto put_and_exit;
162 + } else {
163 + /* syncookie case : see end of cookie_v4_check() */
164 + }
165 sk_setup_caps(newsk, dst);
166
167 tcp_mtup_init(newsk);
168 diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
169 index ee7839f..2257366 100644
170 --- a/net/ipv6/mcast.c
171 +++ b/net/ipv6/mcast.c
172 @@ -257,7 +257,6 @@ static struct inet6_dev *ip6_mc_find_dev_rcu(struct net *net,
173
174 if (rt) {
175 dev = rt->rt6i_dev;
176 - dev_hold(dev);
177 dst_release(&rt->dst);
178 }
179 } else
180 diff --git a/tools/perf/arch/powerpc/util/header.c b/tools/perf/arch/powerpc/util/header.c
181 index eba80c2..2f7073d 100644
182 --- a/tools/perf/arch/powerpc/util/header.c
183 +++ b/tools/perf/arch/powerpc/util/header.c
184 @@ -25,7 +25,7 @@ get_cpuid(char *buffer, size_t sz)
185
186 pvr = mfspr(SPRN_PVR);
187
188 - nb = snprintf(buffer, sz, "%lu,%lu$", PVR_VER(pvr), PVR_REV(pvr));
189 + nb = scnprintf(buffer, sz, "%lu,%lu$", PVR_VER(pvr), PVR_REV(pvr));
190
191 /* look for end marker to ensure the entire data fit */
192 if (strchr(buffer, '$')) {
193 diff --git a/tools/perf/arch/x86/util/header.c b/tools/perf/arch/x86/util/header.c
194 index f940060..146d12a 100644
195 --- a/tools/perf/arch/x86/util/header.c
196 +++ b/tools/perf/arch/x86/util/header.c
197 @@ -48,7 +48,7 @@ get_cpuid(char *buffer, size_t sz)
198 if (family >= 0x6)
199 model += ((a >> 16) & 0xf) << 4;
200 }
201 - nb = snprintf(buffer, sz, "%s,%u,%u,%u$", vendor, family, model, step);
202 + nb = scnprintf(buffer, sz, "%s,%u,%u,%u$", vendor, family, model, step);
203
204 /* look for end marker to ensure the entire data fit */
205 if (strchr(buffer, '$')) {
206 diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c
207 index 521c38a..11e46da1 100644
208 --- a/tools/perf/util/color.c
209 +++ b/tools/perf/util/color.c
210 @@ -1,3 +1,4 @@
211 +#include <linux/kernel.h>
212 #include "cache.h"
213 #include "color.h"
214
215 @@ -182,12 +183,12 @@ static int __color_vsnprintf(char *bf, size_t size, const char *color,
216 }
217
218 if (perf_use_color_default && *color)
219 - r += snprintf(bf, size, "%s", color);
220 - r += vsnprintf(bf + r, size - r, fmt, args);
221 + r += scnprintf(bf, size, "%s", color);
222 + r += vscnprintf(bf + r, size - r, fmt, args);
223 if (perf_use_color_default && *color)
224 - r += snprintf(bf + r, size - r, "%s", PERF_COLOR_RESET);
225 + r += scnprintf(bf + r, size - r, "%s", PERF_COLOR_RESET);
226 if (trail)
227 - r += snprintf(bf + r, size - r, "%s", trail);
228 + r += scnprintf(bf + r, size - r, "%s", trail);
229 return r;
230 }
231
232 diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
233 index 33c17a2..2cd88c1 100644
234 --- a/tools/perf/util/header.c
235 +++ b/tools/perf/util/header.c
236 @@ -1227,7 +1227,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
237 if (realname == NULL || filename == NULL || linkname == NULL)
238 goto out_free;
239
240 - len = snprintf(filename, size, "%s%s%s",
241 + len = scnprintf(filename, size, "%s%s%s",
242 debugdir, is_kallsyms ? "/" : "", realname);
243 if (mkdir_p(filename, 0755))
244 goto out_free;
245 @@ -1242,7 +1242,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
246 goto out_free;
247 }
248
249 - len = snprintf(linkname, size, "%s/.build-id/%.2s",
250 + len = scnprintf(linkname, size, "%s/.build-id/%.2s",
251 debugdir, sbuild_id);
252
253 if (access(linkname, X_OK) && mkdir_p(linkname, 0755))
254 diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
255 index abef270..216e33a 100644
256 --- a/tools/perf/util/hist.c
257 +++ b/tools/perf/util/hist.c
258 @@ -767,7 +767,7 @@ static int hist_entry__pcnt_snprintf(struct hist_entry *self, char *s,
259 sep ? "%.2f" : " %6.2f%%",
260 (period * 100.0) / total);
261 else
262 - ret = snprintf(s, size, sep ? "%.2f" : " %6.2f%%",
263 + ret = scnprintf(s, size, sep ? "%.2f" : " %6.2f%%",
264 (period * 100.0) / total);
265 if (symbol_conf.show_cpu_utilization) {
266 ret += percent_color_snprintf(s + ret, size - ret,
267 @@ -790,20 +790,20 @@ static int hist_entry__pcnt_snprintf(struct hist_entry *self, char *s,
268 }
269 }
270 } else
271 - ret = snprintf(s, size, sep ? "%" PRIu64 : "%12" PRIu64 " ", period);
272 + ret = scnprintf(s, size, sep ? "%" PRIu64 : "%12" PRIu64 " ", period);
273
274 if (symbol_conf.show_nr_samples) {
275 if (sep)
276 - ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, nr_events);
277 + ret += scnprintf(s + ret, size - ret, "%c%" PRIu64, *sep, nr_events);
278 else
279 - ret += snprintf(s + ret, size - ret, "%11" PRIu64, nr_events);
280 + ret += scnprintf(s + ret, size - ret, "%11" PRIu64, nr_events);
281 }
282
283 if (symbol_conf.show_total_period) {
284 if (sep)
285 - ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, period);
286 + ret += scnprintf(s + ret, size - ret, "%c%" PRIu64, *sep, period);
287 else
288 - ret += snprintf(s + ret, size - ret, " %12" PRIu64, period);
289 + ret += scnprintf(s + ret, size - ret, " %12" PRIu64, period);
290 }
291
292 if (pair_hists) {
293 @@ -818,25 +818,25 @@ static int hist_entry__pcnt_snprintf(struct hist_entry *self, char *s,
294 diff = new_percent - old_percent;
295
296 if (fabs(diff) >= 0.01)
297 - snprintf(bf, sizeof(bf), "%+4.2F%%", diff);
298 + ret += scnprintf(bf, sizeof(bf), "%+4.2F%%", diff);
299 else
300 - snprintf(bf, sizeof(bf), " ");
301 + ret += scnprintf(bf, sizeof(bf), " ");
302
303 if (sep)
304 - ret += snprintf(s + ret, size - ret, "%c%s", *sep, bf);
305 + ret += scnprintf(s + ret, size - ret, "%c%s", *sep, bf);
306 else
307 - ret += snprintf(s + ret, size - ret, "%11.11s", bf);
308 + ret += scnprintf(s + ret, size - ret, "%11.11s", bf);
309
310 if (show_displacement) {
311 if (displacement)
312 - snprintf(bf, sizeof(bf), "%+4ld", displacement);
313 + ret += scnprintf(bf, sizeof(bf), "%+4ld", displacement);
314 else
315 - snprintf(bf, sizeof(bf), " ");
316 + ret += scnprintf(bf, sizeof(bf), " ");
317
318 if (sep)
319 - ret += snprintf(s + ret, size - ret, "%c%s", *sep, bf);
320 + ret += scnprintf(s + ret, size - ret, "%c%s", *sep, bf);
321 else
322 - ret += snprintf(s + ret, size - ret, "%6.6s", bf);
323 + ret += scnprintf(s + ret, size - ret, "%6.6s", bf);
324 }
325 }
326
327 @@ -854,7 +854,7 @@ int hist_entry__snprintf(struct hist_entry *he, char *s, size_t size,
328 if (se->elide)
329 continue;
330
331 - ret += snprintf(s + ret, size - ret, "%s", sep ?: " ");
332 + ret += scnprintf(s + ret, size - ret, "%s", sep ?: " ");
333 ret += se->se_snprintf(he, s + ret, size - ret,
334 hists__col_len(hists, se->se_width_idx));
335 }
336 diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
337 index 16da30d..076c9d4 100644
338 --- a/tools/perf/util/sort.c
339 +++ b/tools/perf/util/sort.c
340 @@ -33,6 +33,9 @@ static int repsep_snprintf(char *bf, size_t size, const char *fmt, ...)
341 }
342 }
343 va_end(ap);
344 +
345 + if (n >= (int)size)
346 + return size - 1;
347 return n;
348 }
349
350 diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
351 index 92e0685..2eeb51b 100644
352 --- a/tools/perf/util/strbuf.c
353 +++ b/tools/perf/util/strbuf.c
354 @@ -1,4 +1,5 @@
355 #include "cache.h"
356 +#include <linux/kernel.h>
357
358 int prefixcmp(const char *str, const char *prefix)
359 {
360 @@ -89,14 +90,14 @@ void strbuf_addf(struct strbuf *sb, const char *fmt, ...)
361 if (!strbuf_avail(sb))
362 strbuf_grow(sb, 64);
363 va_start(ap, fmt);
364 - len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
365 + len = vscnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
366 va_end(ap);
367 if (len < 0)
368 - die("your vsnprintf is broken");
369 + die("your vscnprintf is broken");
370 if (len > strbuf_avail(sb)) {
371 strbuf_grow(sb, len);
372 va_start(ap, fmt);
373 - len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
374 + len = vscnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
375 va_end(ap);
376 if (len > strbuf_avail(sb)) {
377 die("this should not happen, your snprintf is broken");
378 diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
379 index d0c94b4..81c9fa5 100644
380 --- a/tools/perf/util/ui/browsers/hists.c
381 +++ b/tools/perf/util/ui/browsers/hists.c
382 @@ -839,15 +839,15 @@ static int hists__browser_title(struct hists *self, char *bf, size_t size,
383 unsigned long nr_events = self->stats.nr_events[PERF_RECORD_SAMPLE];
384
385 nr_events = convert_unit(nr_events, &unit);
386 - printed = snprintf(bf, size, "Events: %lu%c %s", nr_events, unit, ev_name);
387 + printed = scnprintf(bf, size, "Events: %lu%c %s", nr_events, unit, ev_name);
388
389 if (thread)
390 - printed += snprintf(bf + printed, size - printed,
391 + printed += scnprintf(bf + printed, size - printed,
392 ", Thread: %s(%d)",
393 (thread->comm_set ? thread->comm : ""),
394 thread->pid);
395 if (dso)
396 - printed += snprintf(bf + printed, size - printed,
397 + printed += scnprintf(bf + printed, size - printed,
398 ", DSO: %s", dso->short_name);
399 return printed;
400 }
401 @@ -1097,7 +1097,7 @@ static void perf_evsel_menu__write(struct ui_browser *browser,
402 HE_COLORSET_NORMAL);
403
404 nr_events = convert_unit(nr_events, &unit);
405 - printed = snprintf(bf, sizeof(bf), "%lu%c%s%s", nr_events,
406 + printed = scnprintf(bf, sizeof(bf), "%lu%c%s%s", nr_events,
407 unit, unit == ' ' ? "" : " ", ev_name);
408 slsmg_printf("%s", bf);
409
410 @@ -1107,8 +1107,8 @@ static void perf_evsel_menu__write(struct ui_browser *browser,
411 if (!current_entry)
412 ui_browser__set_color(browser, HE_COLORSET_TOP);
413 nr_events = convert_unit(nr_events, &unit);
414 - snprintf(bf, sizeof(bf), ": %ld%c%schunks LOST!", nr_events,
415 - unit, unit == ' ' ? "" : " ");
416 + printed += scnprintf(bf, sizeof(bf), ": %ld%c%schunks LOST!",
417 + nr_events, unit, unit == ' ' ? "" : " ");
418 warn = bf;
419 }
420
421 diff --git a/tools/perf/util/ui/helpline.c b/tools/perf/util/ui/helpline.c
422 index 6ef3c56..f50f81c 100644
423 --- a/tools/perf/util/ui/helpline.c
424 +++ b/tools/perf/util/ui/helpline.c
425 @@ -65,7 +65,7 @@ int ui_helpline__show_help(const char *format, va_list ap)
426 static int backlog;
427
428 pthread_mutex_lock(&ui__lock);
429 - ret = vsnprintf(ui_helpline__last_msg + backlog,
430 + ret = vscnprintf(ui_helpline__last_msg + backlog,
431 sizeof(ui_helpline__last_msg) - backlog, format, ap);
432 backlog += ret;
433