]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.kernel.org/patch-2.6.27.17-18
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.kernel.org / patch-2.6.27.17-18
1 From: Greg Kroah-Hartman <gregkh@suse.de>
2 Subject: Linux 2.6.27.18
3
4 Upstream 2.6.27.18 release from kernel.org
5
6 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7
8 diff --git a/Makefile b/Makefile
9 index 104fb0f..9273a73 100644
10 --- a/Makefile
11 +++ b/Makefile
12 @@ -1,7 +1,7 @@
13 VERSION = 2
14 PATCHLEVEL = 6
15 SUBLEVEL = 27
16 -EXTRAVERSION = .17
17 +EXTRAVERSION = .18
18 NAME = Trembling Tortoise
19
20 # *DOCUMENTATION*
21 diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
22 index 3e80aa3..a6a4310 100644
23 --- a/arch/powerpc/kernel/signal_32.c
24 +++ b/arch/powerpc/kernel/signal_32.c
25 @@ -410,7 +410,7 @@ inline unsigned long copy_fpr_from_user(struct task_struct *task,
26 * altivec/spe instructions at some point.
27 */
28 static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
29 - int sigret)
30 + int sigret, int ctx_has_vsx_region)
31 {
32 unsigned long msr = regs->msr;
33
34 @@ -451,7 +451,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
35 * the saved MSR value to indicate that frame->mc_vregs
36 * contains valid data
37 */
38 - if (current->thread.used_vsr) {
39 + if (current->thread.used_vsr && ctx_has_vsx_region) {
40 __giveup_vsx(current);
41 if (copy_vsx_to_user(&frame->mc_vsregs, current))
42 return 1;
43 @@ -858,11 +858,11 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
44 frame = &rt_sf->uc.uc_mcontext;
45 addr = frame;
46 if (vdso32_rt_sigtramp && current->mm->context.vdso_base) {
47 - if (save_user_regs(regs, frame, 0))
48 + if (save_user_regs(regs, frame, 0, 1))
49 goto badframe;
50 regs->link = current->mm->context.vdso_base + vdso32_rt_sigtramp;
51 } else {
52 - if (save_user_regs(regs, frame, __NR_rt_sigreturn))
53 + if (save_user_regs(regs, frame, __NR_rt_sigreturn, 1))
54 goto badframe;
55 regs->link = (unsigned long) frame->tramp;
56 }
57 @@ -936,12 +936,13 @@ long sys_swapcontext(struct ucontext __user *old_ctx,
58 int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
59 {
60 unsigned char tmp;
61 + int ctx_has_vsx_region = 0;
62
63 #ifdef CONFIG_PPC64
64 unsigned long new_msr = 0;
65
66 if (new_ctx &&
67 - __get_user(new_msr, &new_ctx->uc_mcontext.mc_gregs[PT_MSR]))
68 + get_user(new_msr, &new_ctx->uc_mcontext.mc_gregs[PT_MSR]))
69 return -EFAULT;
70 /*
71 * Check that the context is not smaller than the original
72 @@ -956,16 +957,9 @@ long sys_swapcontext(struct ucontext __user *old_ctx,
73 if ((ctx_size < sizeof(struct ucontext)) &&
74 (new_msr & MSR_VSX))
75 return -EINVAL;
76 -#ifdef CONFIG_VSX
77 - /*
78 - * If userspace doesn't provide enough room for VSX data,
79 - * but current thread has used VSX, we don't have anywhere
80 - * to store the full context back into.
81 - */
82 - if ((ctx_size < sizeof(struct ucontext)) &&
83 - (current->thread.used_vsr && old_ctx))
84 - return -EINVAL;
85 -#endif
86 + /* Does the context have enough room to store VSX data? */
87 + if (ctx_size >= sizeof(struct ucontext))
88 + ctx_has_vsx_region = 1;
89 #else
90 /* Context size is for future use. Right now, we only make sure
91 * we are passed something we understand
92 @@ -985,17 +979,17 @@ long sys_swapcontext(struct ucontext __user *old_ctx,
93 */
94 mctx = (struct mcontext __user *)
95 ((unsigned long) &old_ctx->uc_mcontext & ~0xfUL);
96 - if (!access_ok(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
97 - || save_user_regs(regs, mctx, 0)
98 + if (!access_ok(VERIFY_WRITE, old_ctx, ctx_size)
99 + || save_user_regs(regs, mctx, 0, ctx_has_vsx_region)
100 || put_sigset_t(&old_ctx->uc_sigmask, &current->blocked)
101 || __put_user(to_user_ptr(mctx), &old_ctx->uc_regs))
102 return -EFAULT;
103 }
104 if (new_ctx == NULL)
105 return 0;
106 - if (!access_ok(VERIFY_READ, new_ctx, sizeof(*new_ctx))
107 + if (!access_ok(VERIFY_READ, new_ctx, ctx_size)
108 || __get_user(tmp, (u8 __user *) new_ctx)
109 - || __get_user(tmp, (u8 __user *) (new_ctx + 1) - 1))
110 + || __get_user(tmp, (u8 __user *) new_ctx + ctx_size - 1))
111 return -EFAULT;
112
113 /*
114 @@ -1196,11 +1190,11 @@ int handle_signal32(unsigned long sig, struct k_sigaction *ka,
115 goto badframe;
116
117 if (vdso32_sigtramp && current->mm->context.vdso_base) {
118 - if (save_user_regs(regs, &frame->mctx, 0))
119 + if (save_user_regs(regs, &frame->mctx, 0, 1))
120 goto badframe;
121 regs->link = current->mm->context.vdso_base + vdso32_sigtramp;
122 } else {
123 - if (save_user_regs(regs, &frame->mctx, __NR_sigreturn))
124 + if (save_user_regs(regs, &frame->mctx, __NR_sigreturn, 1))
125 goto badframe;
126 regs->link = (unsigned long) frame->mctx.tramp;
127 }
128 diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
129 index 65ad925..e4acdbd 100644
130 --- a/arch/powerpc/kernel/signal_64.c
131 +++ b/arch/powerpc/kernel/signal_64.c
132 @@ -74,7 +74,8 @@ static const char fmt64[] = KERN_INFO \
133 */
134
135 static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
136 - int signr, sigset_t *set, unsigned long handler)
137 + int signr, sigset_t *set, unsigned long handler,
138 + int ctx_has_vsx_region)
139 {
140 /* When CONFIG_ALTIVEC is set, we _always_ setup v_regs even if the
141 * process never used altivec yet (MSR_VEC is zero in pt_regs of
142 @@ -121,7 +122,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
143 * then out to userspace. Update v_regs to point after the
144 * VMX data.
145 */
146 - if (current->thread.used_vsr) {
147 + if (current->thread.used_vsr && ctx_has_vsx_region) {
148 __giveup_vsx(current);
149 v_regs += ELF_NVRREG;
150 err |= copy_vsx_to_user(v_regs, current);
151 @@ -284,9 +285,10 @@ int sys_swapcontext(struct ucontext __user *old_ctx,
152 unsigned char tmp;
153 sigset_t set;
154 unsigned long new_msr = 0;
155 + int ctx_has_vsx_region = 0;
156
157 if (new_ctx &&
158 - __get_user(new_msr, &new_ctx->uc_mcontext.gp_regs[PT_MSR]))
159 + get_user(new_msr, &new_ctx->uc_mcontext.gp_regs[PT_MSR]))
160 return -EFAULT;
161 /*
162 * Check that the context is not smaller than the original
163 @@ -301,28 +303,23 @@ int sys_swapcontext(struct ucontext __user *old_ctx,
164 if ((ctx_size < sizeof(struct ucontext)) &&
165 (new_msr & MSR_VSX))
166 return -EINVAL;
167 -#ifdef CONFIG_VSX
168 - /*
169 - * If userspace doesn't provide enough room for VSX data,
170 - * but current thread has used VSX, we don't have anywhere
171 - * to store the full context back into.
172 - */
173 - if ((ctx_size < sizeof(struct ucontext)) &&
174 - (current->thread.used_vsr && old_ctx))
175 - return -EINVAL;
176 -#endif
177 + /* Does the context have enough room to store VSX data? */
178 + if (ctx_size >= sizeof(struct ucontext))
179 + ctx_has_vsx_region = 1;
180 +
181 if (old_ctx != NULL) {
182 - if (!access_ok(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
183 - || setup_sigcontext(&old_ctx->uc_mcontext, regs, 0, NULL, 0)
184 + if (!access_ok(VERIFY_WRITE, old_ctx, ctx_size)
185 + || setup_sigcontext(&old_ctx->uc_mcontext, regs, 0, NULL, 0,
186 + ctx_has_vsx_region)
187 || __copy_to_user(&old_ctx->uc_sigmask,
188 &current->blocked, sizeof(sigset_t)))
189 return -EFAULT;
190 }
191 if (new_ctx == NULL)
192 return 0;
193 - if (!access_ok(VERIFY_READ, new_ctx, sizeof(*new_ctx))
194 + if (!access_ok(VERIFY_READ, new_ctx, ctx_size)
195 || __get_user(tmp, (u8 __user *) new_ctx)
196 - || __get_user(tmp, (u8 __user *) (new_ctx + 1) - 1))
197 + || __get_user(tmp, (u8 __user *) new_ctx + ctx_size - 1))
198 return -EFAULT;
199
200 /*
201 @@ -425,7 +422,7 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
202 &frame->uc.uc_stack.ss_flags);
203 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
204 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, signr, NULL,
205 - (unsigned long)ka->sa.sa_handler);
206 + (unsigned long)ka->sa.sa_handler, 1);
207 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
208 if (err)
209 goto badframe;
210 diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
211 index ce10e2b..131d729 100644
212 --- a/arch/powerpc/mm/fsl_booke_mmu.c
213 +++ b/arch/powerpc/mm/fsl_booke_mmu.c
214 @@ -80,7 +80,7 @@ extern unsigned int tlbcam_index;
215 /*
216 * Return PA for this VA if it is mapped by a CAM, or 0
217 */
218 -unsigned long v_mapped_by_tlbcam(unsigned long va)
219 +phys_addr_t v_mapped_by_tlbcam(unsigned long va)
220 {
221 int b;
222 for (b = 0; b < tlbcam_index; ++b)
223 @@ -92,7 +92,7 @@ unsigned long v_mapped_by_tlbcam(unsigned long va)
224 /*
225 * Return VA for a given PA or 0 if not mapped
226 */
227 -unsigned long p_mapped_by_tlbcam(unsigned long pa)
228 +unsigned long p_mapped_by_tlbcam(phys_addr_t pa)
229 {
230 int b;
231 for (b = 0; b < tlbcam_index; ++b)
232 diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
233 index 2001abd..05922b2 100644
234 --- a/arch/powerpc/mm/pgtable_32.c
235 +++ b/arch/powerpc/mm/pgtable_32.c
236 @@ -65,8 +65,8 @@ void setbat(int index, unsigned long virt, phys_addr_t phys,
237
238 #ifdef HAVE_TLBCAM
239 extern unsigned int tlbcam_index;
240 -extern unsigned long v_mapped_by_tlbcam(unsigned long va);
241 -extern unsigned long p_mapped_by_tlbcam(unsigned long pa);
242 +extern phys_addr_t v_mapped_by_tlbcam(unsigned long va);
243 +extern unsigned long p_mapped_by_tlbcam(phys_addr_t pa);
244 #else /* !HAVE_TLBCAM */
245 #define v_mapped_by_tlbcam(x) (0UL)
246 #define p_mapped_by_tlbcam(x) (0UL)
247 diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
248 index 36b4b7a..b376667 100644
249 --- a/arch/sparc64/Kconfig
250 +++ b/arch/sparc64/Kconfig
251 @@ -15,6 +15,7 @@ config SPARC64
252 select HAVE_FTRACE
253 select HAVE_IDE
254 select HAVE_LMB
255 + select HAVE_SYSCALL_WRAPPERS
256 select HAVE_ARCH_KGDB
257 select USE_GENERIC_SMP_HELPERS if SMP
258 select HAVE_ARCH_TRACEHOOK
259 diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
260 index 39749e3..73b287e 100644
261 --- a/arch/sparc64/kernel/sys_sparc.c
262 +++ b/arch/sparc64/kernel/sys_sparc.c
263 @@ -397,7 +397,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
264 }
265 }
266
267 -asmlinkage unsigned long sparc_brk(unsigned long brk)
268 +SYSCALL_DEFINE1(sparc_brk, unsigned long, brk)
269 {
270 /* People could try to be nasty and use ta 0x6d in 32bit programs */
271 if (test_thread_flag(TIF_32BIT) && brk >= STACK_TOP32)
272 @@ -413,7 +413,7 @@ asmlinkage unsigned long sparc_brk(unsigned long brk)
273 * sys_pipe() is the normal C calling standard for creating
274 * a pipe. It's not the way unix traditionally does this, though.
275 */
276 -asmlinkage long sparc_pipe(struct pt_regs *regs)
277 +SYSCALL_DEFINE1(sparc_pipe_real, struct pt_regs *, regs)
278 {
279 int fd[2];
280 int error;
281 @@ -433,8 +433,8 @@ out:
282 * This is really horribly ugly.
283 */
284
285 -asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
286 - unsigned long third, void __user *ptr, long fifth)
287 +SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second,
288 + unsigned long, third, void __user *, ptr, long, fifth)
289 {
290 long err;
291
292 @@ -517,7 +517,7 @@ out:
293 return err;
294 }
295
296 -asmlinkage long sparc64_newuname(struct new_utsname __user *name)
297 +SYSCALL_DEFINE1(sparc64_newuname, struct new_utsname __user *, name)
298 {
299 int ret = sys_newuname(name);
300
301 @@ -528,7 +528,7 @@ asmlinkage long sparc64_newuname(struct new_utsname __user *name)
302 return ret;
303 }
304
305 -asmlinkage long sparc64_personality(unsigned long personality)
306 +SYSCALL_DEFINE1(sparc64_personality, unsigned long, personality)
307 {
308 int ret;
309
310 @@ -562,9 +562,9 @@ int sparc_mmap_check(unsigned long addr, unsigned long len)
311 }
312
313 /* Linux version of mmap */
314 -asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
315 - unsigned long prot, unsigned long flags, unsigned long fd,
316 - unsigned long off)
317 +SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
318 + unsigned long, prot, unsigned long, flags, unsigned long, fd,
319 + unsigned long, off)
320 {
321 struct file * file = NULL;
322 unsigned long retval = -EBADF;
323 @@ -587,7 +587,7 @@ out:
324 return retval;
325 }
326
327 -asmlinkage long sys64_munmap(unsigned long addr, size_t len)
328 +SYSCALL_DEFINE2(64_munmap, unsigned long, addr, size_t, len)
329 {
330 long ret;
331
332 @@ -604,9 +604,9 @@ extern unsigned long do_mremap(unsigned long addr,
333 unsigned long old_len, unsigned long new_len,
334 unsigned long flags, unsigned long new_addr);
335
336 -asmlinkage unsigned long sys64_mremap(unsigned long addr,
337 - unsigned long old_len, unsigned long new_len,
338 - unsigned long flags, unsigned long new_addr)
339 +SYSCALL_DEFINE5(64_mremap, unsigned long, addr, unsigned long, old_len,
340 + unsigned long, new_len, unsigned long, flags,
341 + unsigned long, new_addr)
342 {
343 unsigned long ret = -EINVAL;
344
345 @@ -669,7 +669,7 @@ asmlinkage void sparc_breakpoint(struct pt_regs *regs)
346
347 extern void check_pending(int signum);
348
349 -asmlinkage long sys_getdomainname(char __user *name, int len)
350 +SYSCALL_DEFINE2(getdomainname, char __user *, name, int, len)
351 {
352 int nlen, err;
353
354 @@ -692,11 +692,10 @@ out:
355 return err;
356 }
357
358 -asmlinkage long sys_utrap_install(utrap_entry_t type,
359 - utrap_handler_t new_p,
360 - utrap_handler_t new_d,
361 - utrap_handler_t __user *old_p,
362 - utrap_handler_t __user *old_d)
363 +SYSCALL_DEFINE5(utrap_install, utrap_entry_t, type,
364 + utrap_handler_t, new_p, utrap_handler_t, new_d,
365 + utrap_handler_t __user *, old_p,
366 + utrap_handler_t __user *, old_d)
367 {
368 if (type < UT_INSTRUCTION_EXCEPTION || type > UT_TRAP_INSTRUCTION_31)
369 return -EINVAL;
370 @@ -762,11 +761,9 @@ asmlinkage long sparc_memory_ordering(unsigned long model,
371 return 0;
372 }
373
374 -asmlinkage long sys_rt_sigaction(int sig,
375 - const struct sigaction __user *act,
376 - struct sigaction __user *oact,
377 - void __user *restorer,
378 - size_t sigsetsize)
379 +SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
380 + struct sigaction __user *, oact, void __user *, restorer,
381 + size_t, sigsetsize)
382 {
383 struct k_sigaction new_ka, old_ka;
384 int ret;
385 @@ -806,7 +803,8 @@ asmlinkage void update_perfctrs(void)
386 reset_pic();
387 }
388
389 -asmlinkage long sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long arg2)
390 +SYSCALL_DEFINE4(perfctr, int, opcode, unsigned long, arg0,
391 + unsigned long, arg1, unsigned long, arg2)
392 {
393 int err = 0;
394
395 diff --git a/arch/sparc64/kernel/syscalls.S b/arch/sparc64/kernel/syscalls.S
396 index cd2d333..5a0b52e 100644
397 --- a/arch/sparc64/kernel/syscalls.S
398 +++ b/arch/sparc64/kernel/syscalls.S
399 @@ -21,7 +21,7 @@ execve_merge:
400
401 .align 32
402 sys_sparc_pipe:
403 - ba,pt %xcc, sparc_pipe
404 + ba,pt %xcc, sys_sparc_pipe_real
405 add %sp, PTREGS_OFF, %o0
406 sys_nis_syscall:
407 ba,pt %xcc, c_sys_nis_syscall
408 diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
409 index 26b39de..8fafe0b 100644
410 --- a/arch/sparc64/kernel/systbls.S
411 +++ b/arch/sparc64/kernel/systbls.S
412 @@ -21,7 +21,7 @@ sys_call_table32:
413 /*0*/ .word sys_restart_syscall, sys32_exit, sys_fork, sys_read, sys_write
414 /*5*/ .word sys32_open, sys_close, sys32_wait4, sys32_creat, sys_link
415 /*10*/ .word sys_unlink, sunos_execv, sys_chdir, sys_chown16, sys32_mknod
416 -/*15*/ .word sys_chmod, sys_lchown16, sparc_brk, sys32_perfctr, sys32_lseek
417 +/*15*/ .word sys_chmod, sys_lchown16, sys_sparc_brk, sys32_perfctr, sys32_lseek
418 /*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid16, sys_getuid16
419 /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys32_pause
420 /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice
421 @@ -55,8 +55,8 @@ sys_call_table32:
422 /*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents
423 .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr
424 /*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
425 - .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sparc64_newuname
426 -/*190*/ .word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl
427 + .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sys_sparc64_newuname
428 +/*190*/ .word sys32_init_module, sys_sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl
429 .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask
430 /*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir
431 .word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
432 @@ -95,7 +95,7 @@ sys_call_table:
433 /*0*/ .word sys_restart_syscall, sparc_exit, sys_fork, sys_read, sys_write
434 /*5*/ .word sys_open, sys_close, sys_wait4, sys_creat, sys_link
435 /*10*/ .word sys_unlink, sys_nis_syscall, sys_chdir, sys_chown, sys_mknod
436 -/*15*/ .word sys_chmod, sys_lchown, sparc_brk, sys_perfctr, sys_lseek
437 +/*15*/ .word sys_chmod, sys_lchown, sys_sparc_brk, sys_perfctr, sys_lseek
438 /*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid
439 /*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
440 /*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice
441 @@ -106,7 +106,7 @@ sys_call_table:
442 .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve
443 /*60*/ .word sys_umask, sys_chroot, sys_newfstat, sys_fstat64, sys_getpagesize
444 .word sys_msync, sys_vfork, sys_pread64, sys_pwrite64, sys_nis_syscall
445 -/*70*/ .word sys_nis_syscall, sys_mmap, sys_nis_syscall, sys64_munmap, sys_mprotect
446 +/*70*/ .word sys_nis_syscall, sys_mmap, sys_nis_syscall, sys_64_munmap, sys_mprotect
447 .word sys_madvise, sys_vhangup, sys_nis_syscall, sys_mincore, sys_getgroups
448 /*80*/ .word sys_setgroups, sys_getpgrp, sys_nis_syscall, sys_setitimer, sys_nis_syscall
449 .word sys_swapon, sys_getitimer, sys_nis_syscall, sys_sethostname, sys_nis_syscall
450 @@ -129,8 +129,8 @@ sys_call_table:
451 /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents
452 .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr
453 /*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall
454 - .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sparc64_newuname
455 -/*190*/ .word sys_init_module, sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
456 + .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_sparc64_newuname
457 +/*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
458 .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask
459 /*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall
460 .word sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64
461 @@ -142,7 +142,7 @@ sys_call_table:
462 .word sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall
463 /*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler
464 .word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep
465 -/*250*/ .word sys64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl
466 +/*250*/ .word sys_64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl
467 .word sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep
468 /*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun
469 .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy
470 diff --git a/arch/sparc64/kernel/systbls.h b/arch/sparc64/kernel/systbls.h
471 index bc9f5da..15c2d75 100644
472 --- a/arch/sparc64/kernel/systbls.h
473 +++ b/arch/sparc64/kernel/systbls.h
474 @@ -16,9 +16,6 @@ extern asmlinkage long sys_ipc(unsigned int call, int first,
475 void __user *ptr, long fifth);
476 extern asmlinkage long sparc64_newuname(struct new_utsname __user *name);
477 extern asmlinkage long sparc64_personality(unsigned long personality);
478 -extern asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
479 - unsigned long prot, unsigned long flags,
480 - unsigned long fd, unsigned long off);
481 extern asmlinkage long sys64_munmap(unsigned long addr, size_t len);
482 extern asmlinkage unsigned long sys64_mremap(unsigned long addr,
483 unsigned long old_len,
484 diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
485 index f370d38..c4e6cc9 100644
486 --- a/arch/x86/kernel/vmi_32.c
487 +++ b/arch/x86/kernel/vmi_32.c
488 @@ -430,6 +430,16 @@ static void vmi_release_pmd(u32 pfn)
489 }
490
491 /*
492 + * We use the pgd_free hook for releasing the pgd page:
493 + */
494 +static void vmi_pgd_free(struct mm_struct *mm, pgd_t *pgd)
495 +{
496 + unsigned long pfn = __pa(pgd) >> PAGE_SHIFT;
497 +
498 + vmi_ops.release_page(pfn, VMI_PAGE_L2);
499 +}
500 +
501 +/*
502 * Helper macros for MMU update flags. We can defer updates until a flush
503 * or page invalidation only if the update is to the current address space
504 * (otherwise, there is no flush). We must check against init_mm, since
505 @@ -881,6 +891,7 @@ static inline int __init activate_vmi(void)
506 if (vmi_ops.release_page) {
507 pv_mmu_ops.release_pte = vmi_release_pte;
508 pv_mmu_ops.release_pmd = vmi_release_pmd;
509 + pv_mmu_ops.pgd_free = vmi_pgd_free;
510 }
511
512 /* Set linear is needed in all cases */
513 diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
514 index 4bdaa59..315b071 100644
515 --- a/arch/x86/pci/fixup.c
516 +++ b/arch/x86/pci/fixup.c
517 @@ -496,18 +496,21 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SIEMENS, 0x0015,
518 pci_siemens_interrupt_controller);
519
520 /*
521 - * Regular PCI devices have 256 bytes, but AMD Family 10h Opteron ext config
522 - * have 4096 bytes. Even if the device is capable, that doesn't mean we can
523 - * access it. Maybe we don't have a way to generate extended config space
524 - * accesses. So check it
525 + * Regular PCI devices have 256 bytes, but AMD Family 10h/11h CPUs have
526 + * 4096 bytes configuration space for each function of their processor
527 + * configuration space.
528 */
529 -static void fam10h_pci_cfg_space_size(struct pci_dev *dev)
530 +static void amd_cpu_pci_cfg_space_size(struct pci_dev *dev)
531 {
532 dev->cfg_size = pci_cfg_space_size_ext(dev);
533 }
534 -
535 -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1200, fam10h_pci_cfg_space_size);
536 -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1201, fam10h_pci_cfg_space_size);
537 -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1202, fam10h_pci_cfg_space_size);
538 -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1203, fam10h_pci_cfg_space_size);
539 -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1204, fam10h_pci_cfg_space_size);
540 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1200, amd_cpu_pci_cfg_space_size);
541 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1201, amd_cpu_pci_cfg_space_size);
542 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1202, amd_cpu_pci_cfg_space_size);
543 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1203, amd_cpu_pci_cfg_space_size);
544 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1204, amd_cpu_pci_cfg_space_size);
545 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1300, amd_cpu_pci_cfg_space_size);
546 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1301, amd_cpu_pci_cfg_space_size);
547 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1302, amd_cpu_pci_cfg_space_size);
548 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1303, amd_cpu_pci_cfg_space_size);
549 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, 0x1304, amd_cpu_pci_cfg_space_size);
550 diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
551 index 2c4ccec..154e7d6 100644
552 --- a/drivers/ata/libata-eh.c
553 +++ b/drivers/ata/libata-eh.c
554 @@ -2694,12 +2694,13 @@ static int ata_eh_handle_dev_fail(struct ata_device *dev, int err)
555 /* give it just one more chance */
556 ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1);
557 case -EIO:
558 - if (ehc->tries[dev->devno] == 1 && dev->pio_mode > XFER_PIO_0) {
559 + if (ehc->tries[dev->devno] == 1) {
560 /* This is the last chance, better to slow
561 * down than lose it.
562 */
563 sata_down_spd_limit(dev->link);
564 - ata_down_xfermask_limit(dev, ATA_DNXFER_PIO);
565 + if (dev->pio_mode > XFER_PIO_0)
566 + ata_down_xfermask_limit(dev, ATA_DNXFER_PIO);
567 }
568 }
569
570 diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
571 index 1778e4a..814ffd9 100644
572 --- a/drivers/block/nbd.c
573 +++ b/drivers/block/nbd.c
574 @@ -547,6 +547,15 @@ static void do_nbd_request(struct request_queue * q)
575
576 BUG_ON(lo->magic != LO_MAGIC);
577
578 + if (unlikely(!lo->sock)) {
579 + printk(KERN_ERR "%s: Attempted send on closed socket\n",
580 + lo->disk->disk_name);
581 + req->errors++;
582 + nbd_end_request(req);
583 + spin_lock_irq(q->queue_lock);
584 + continue;
585 + }
586 +
587 spin_lock_irq(&lo->queue_lock);
588 list_add_tail(&req->queuelist, &lo->waiting_queue);
589 spin_unlock_irq(&lo->queue_lock);
590 diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
591 index e87956a..1371184 100644
592 --- a/drivers/hid/usbhid/hid-quirks.c
593 +++ b/drivers/hid/usbhid/hid-quirks.c
594 @@ -1130,24 +1130,16 @@ static void usbhid_fixup_button_consumer_descriptor(unsigned char *rdesc, int rs
595 }
596
597 /*
598 - * Microsoft Wireless Desktop Receiver (Model 1028) has several
599 + * Microsoft Wireless Desktop Receiver (Model 1028) has
600 * 'Usage Min/Max' where it ought to have 'Physical Min/Max'
601 */
602 static void usbhid_fixup_microsoft_descriptor(unsigned char *rdesc, int rsize)
603 {
604 - if (rsize == 571 && rdesc[284] == 0x19
605 - && rdesc[286] == 0x2a
606 - && rdesc[304] == 0x19
607 - && rdesc[306] == 0x29
608 - && rdesc[352] == 0x1a
609 - && rdesc[355] == 0x2a
610 - && rdesc[557] == 0x19
611 + if (rsize == 571 && rdesc[557] == 0x19
612 && rdesc[559] == 0x29) {
613 printk(KERN_INFO "Fixing up Microsoft Wireless Receiver Model 1028 report descriptor\n");
614 - rdesc[284] = rdesc[304] = rdesc[557] = 0x35;
615 - rdesc[352] = 0x36;
616 - rdesc[286] = rdesc[355] = 0x46;
617 - rdesc[306] = rdesc[559] = 0x45;
618 + rdesc[557] = 0x35;
619 + rdesc[559] = 0x45;
620 }
621 }
622
623 diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
624 index a2b092b..b7d829f 100644
625 --- a/drivers/net/skfp/skfddi.c
626 +++ b/drivers/net/skfp/skfddi.c
627 @@ -998,9 +998,9 @@ static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
628 break;
629 case SKFP_CLR_STATS: /* Zero out the driver statistics */
630 if (!capable(CAP_NET_ADMIN)) {
631 - memset(&lp->MacStat, 0, sizeof(lp->MacStat));
632 - } else {
633 status = -EPERM;
634 + } else {
635 + memset(&lp->MacStat, 0, sizeof(lp->MacStat));
636 }
637 break;
638 default:
639 diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
640 index b4be33a..b68bc39 100644
641 --- a/drivers/net/sky2.c
642 +++ b/drivers/net/sky2.c
643 @@ -1403,9 +1403,6 @@ static int sky2_up(struct net_device *dev)
644
645 }
646
647 - if (netif_msg_ifup(sky2))
648 - printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
649 -
650 netif_carrier_off(dev);
651
652 /* must be power of 2 */
653 @@ -1484,6 +1481,9 @@ static int sky2_up(struct net_device *dev)
654 sky2_write32(hw, B0_IMSK, imask);
655
656 sky2_set_multicast(dev);
657 +
658 + if (netif_msg_ifup(sky2))
659 + printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
660 return 0;
661
662 err_out:
663 diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
664 index 4291458..88f9fd5 100644
665 --- a/drivers/net/sungem.c
666 +++ b/drivers/net/sungem.c
667 @@ -2205,6 +2205,8 @@ static int gem_do_start(struct net_device *dev)
668
669 gp->running = 1;
670
671 + napi_enable(&gp->napi);
672 +
673 if (gp->lstate == link_up) {
674 netif_carrier_on(gp->dev);
675 gem_set_link_modes(gp);
676 @@ -2222,6 +2224,8 @@ static int gem_do_start(struct net_device *dev)
677 spin_lock_irqsave(&gp->lock, flags);
678 spin_lock(&gp->tx_lock);
679
680 + napi_disable(&gp->napi);
681 +
682 gp->running = 0;
683 gem_reset(gp);
684 gem_clean_rings(gp);
685 @@ -2322,8 +2326,6 @@ static int gem_open(struct net_device *dev)
686 if (!gp->asleep)
687 rc = gem_do_start(dev);
688 gp->opened = (rc == 0);
689 - if (gp->opened)
690 - napi_enable(&gp->napi);
691
692 mutex_unlock(&gp->pm_mutex);
693
694 @@ -2460,8 +2462,6 @@ static int gem_resume(struct pci_dev *pdev)
695
696 /* Re-attach net device */
697 netif_device_attach(dev);
698 -
699 - napi_enable(&gp->napi);
700 }
701
702 spin_lock_irqsave(&gp->lock, flags);
703 diff --git a/drivers/net/tun.c b/drivers/net/tun.c
704 index 6daea0c..f00fcb5 100644
705 --- a/drivers/net/tun.c
706 +++ b/drivers/net/tun.c
707 @@ -157,10 +157,16 @@ static int update_filter(struct tap_filter *filter, void __user *arg)
708
709 nexact = n;
710
711 - /* The rest is hashed */
712 + /* Remaining multicast addresses are hashed,
713 + * unicast will leave the filter disabled. */
714 memset(filter->mask, 0, sizeof(filter->mask));
715 - for (; n < uf.count; n++)
716 + for (; n < uf.count; n++) {
717 + if (!is_multicast_ether_addr(addr[n].u)) {
718 + err = 0; /* no filter */
719 + goto done;
720 + }
721 addr_hash_set(filter->mask, addr[n].u);
722 + }
723
724 /* For ALLMULTI just set the mask to all ones.
725 * This overrides the mask populated above. */
726 diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
727 index 0196a0d..ce743ec 100644
728 --- a/drivers/net/virtio_net.c
729 +++ b/drivers/net/virtio_net.c
730 @@ -24,6 +24,7 @@
731 #include <linux/virtio.h>
732 #include <linux/virtio_net.h>
733 #include <linux/scatterlist.h>
734 +#include <linux/if_vlan.h>
735
736 static int napi_weight = 128;
737 module_param(napi_weight, int, 0444);
738 @@ -33,7 +34,7 @@ module_param(csum, bool, 0444);
739 module_param(gso, bool, 0444);
740
741 /* FIXME: MTU in config. */
742 -#define MAX_PACKET_LEN (ETH_HLEN+ETH_DATA_LEN)
743 +#define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN)
744
745 struct virtnet_info
746 {
747 diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
748 index 3a90a67..87d020c 100644
749 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c
750 +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
751 @@ -704,7 +704,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
752 u16 cmd_len;
753 enum ieee80211_band band;
754 u8 n_probes = 2;
755 - u8 rx_chain = 0x7; /* bitmap: ABC chains */
756 + u8 rx_chain = priv->hw_params.valid_rx_ant;
757
758 conf = ieee80211_get_hw_conf(priv->hw);
759
760 diff --git a/drivers/net/wireless/zd1211rw/zd_rf.c b/drivers/net/wireless/zd1211rw/zd_rf.c
761 index ec41293..ead3073 100644
762 --- a/drivers/net/wireless/zd1211rw/zd_rf.c
763 +++ b/drivers/net/wireless/zd1211rw/zd_rf.c
764 @@ -86,6 +86,7 @@ int zd_rf_init_hw(struct zd_rf *rf, u8 type)
765 case AL7230B_RF:
766 r = zd_rf_init_al7230b(rf);
767 break;
768 + case MAXIM_NEW_RF:
769 case UW2453_RF:
770 r = zd_rf_init_uw2453(rf);
771 break;
772 diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
773 index a3ccd8c..5d740b5 100644
774 --- a/drivers/net/wireless/zd1211rw/zd_usb.c
775 +++ b/drivers/net/wireless/zd1211rw/zd_usb.c
776 @@ -37,6 +37,7 @@
777 static struct usb_device_id usb_ids[] = {
778 /* ZD1211 */
779 { USB_DEVICE(0x0ace, 0x1211), .driver_info = DEVICE_ZD1211 },
780 + { USB_DEVICE(0x0ace, 0xa211), .driver_info = DEVICE_ZD1211 },
781 { USB_DEVICE(0x07b8, 0x6001), .driver_info = DEVICE_ZD1211 },
782 { USB_DEVICE(0x126f, 0xa006), .driver_info = DEVICE_ZD1211 },
783 { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 },
784 diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
785 index 101ed49..032db81 100644
786 --- a/drivers/parport/parport_serial.c
787 +++ b/drivers/parport/parport_serial.c
788 @@ -64,6 +64,11 @@ struct parport_pc_pci {
789
790 static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *card, int autoirq, int autodma)
791 {
792 + /* the rule described below doesn't hold for this device */
793 + if (dev->device == PCI_DEVICE_ID_NETMOS_9835 &&
794 + dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
795 + dev->subsystem_device == 0x0299)
796 + return -ENODEV;
797 /*
798 * Netmos uses the subdevice ID to indicate the number of parallel
799 * and serial ports. The form is 0x00PS, where <P> is the number of
800 diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
801 index fb28aca..521a2db 100644
802 --- a/drivers/w1/slaves/w1_therm.c
803 +++ b/drivers/w1/slaves/w1_therm.c
804 @@ -113,7 +113,7 @@ static struct w1_therm_family_converter w1_therm_families[] = {
805
806 static inline int w1_DS18B20_convert_temp(u8 rom[9])
807 {
808 - s16 t = (rom[1] << 8) | rom[0];
809 + int t = ((s16)rom[1] << 8) | rom[0];
810 t = t*1000/16;
811 return t;
812 }
813 diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
814 index 5235c67..c8f8d59 100644
815 --- a/fs/compat_ioctl.c
816 +++ b/fs/compat_ioctl.c
817 @@ -538,6 +538,7 @@ static int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg)
818 * cannot be fixed without breaking all existing apps.
819 */
820 case TUNSETIFF:
821 + case TUNGETIFF:
822 case SIOCGIFFLAGS:
823 case SIOCGIFMETRIC:
824 case SIOCGIFMTU:
825 @@ -1982,6 +1983,11 @@ COMPATIBLE_IOCTL(TUNSETNOCSUM)
826 COMPATIBLE_IOCTL(TUNSETDEBUG)
827 COMPATIBLE_IOCTL(TUNSETPERSIST)
828 COMPATIBLE_IOCTL(TUNSETOWNER)
829 +COMPATIBLE_IOCTL(TUNSETLINK)
830 +COMPATIBLE_IOCTL(TUNSETGROUP)
831 +COMPATIBLE_IOCTL(TUNGETFEATURES)
832 +COMPATIBLE_IOCTL(TUNSETOFFLOAD)
833 +COMPATIBLE_IOCTL(TUNSETTXFILTER)
834 /* Big V */
835 COMPATIBLE_IOCTL(VT_SETMODE)
836 COMPATIBLE_IOCTL(VT_GETMODE)
837 @@ -2573,6 +2579,7 @@ HANDLE_IOCTL(SIOCGIFPFLAGS, dev_ifsioc)
838 HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc)
839 HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc)
840 HANDLE_IOCTL(TUNSETIFF, dev_ifsioc)
841 +HANDLE_IOCTL(TUNGETIFF, dev_ifsioc)
842 HANDLE_IOCTL(SIOCETHTOOL, ethtool_ioctl)
843 HANDLE_IOCTL(SIOCBONDENSLAVE, bond_ioctl)
844 HANDLE_IOCTL(SIOCBONDRELEASE, bond_ioctl)
845 diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
846 index cf0d5c2..dc934da 100644
847 --- a/fs/lockd/svclock.c
848 +++ b/fs/lockd/svclock.c
849 @@ -418,7 +418,7 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
850 goto out;
851 case -EAGAIN:
852 ret = nlm_lck_denied;
853 - goto out;
854 + break;
855 case FILE_LOCK_DEFERRED:
856 if (wait)
857 break;
858 @@ -434,6 +434,10 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
859 goto out;
860 }
861
862 + ret = nlm_lck_denied;
863 + if (!wait)
864 + goto out;
865 +
866 ret = nlm_lck_blocked;
867
868 /* Append to list of blocked */
869 diff --git a/include/linux/ata.h b/include/linux/ata.h
870 index 8a12d71..8297a3c 100644
871 --- a/include/linux/ata.h
872 +++ b/include/linux/ata.h
873 @@ -681,12 +681,17 @@ static inline int ata_id_current_chs_valid(const u16 *id)
874
875 static inline int ata_id_is_cfa(const u16 *id)
876 {
877 - if (id[ATA_ID_CONFIG] == 0x848A) /* Standard CF */
878 + if (id[ATA_ID_CONFIG] == 0x848A) /* Traditional CF */
879 return 1;
880 - /* Could be CF hiding as standard ATA */
881 - if (ata_id_major_version(id) >= 3 &&
882 - id[ATA_ID_COMMAND_SET_1] != 0xFFFF &&
883 - (id[ATA_ID_COMMAND_SET_1] & (1 << 2)))
884 + /*
885 + * CF specs don't require specific value in the word 0 anymore and yet
886 + * they forbid to report the ATA version in the word 80 and require the
887 + * CFA feature set support to be indicated in the word 83 in this case.
888 + * Unfortunately, some cards only follow either of this requirements,
889 + * and while those that don't indicate CFA feature support need some
890 + * sort of quirk list, it seems impractical for the ones that do...
891 + */
892 + if ((id[ATA_ID_COMMAND_SET_2] & 0xC004) == 0x4004)
893 return 1;
894 return 0;
895 }
896 diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
897 index f54aa38..258a17b 100644
898 --- a/include/linux/syscalls.h
899 +++ b/include/linux/syscalls.h
900 @@ -95,13 +95,13 @@ struct old_linux_dirent;
901 #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__)
902 #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
903
904 -#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void)
905 -#define SYSCALL_DEFINE1(...) SYSCALL_DEFINEx(1, __VA_ARGS__)
906 -#define SYSCALL_DEFINE2(...) SYSCALL_DEFINEx(2, __VA_ARGS__)
907 -#define SYSCALL_DEFINE3(...) SYSCALL_DEFINEx(3, __VA_ARGS__)
908 -#define SYSCALL_DEFINE4(...) SYSCALL_DEFINEx(4, __VA_ARGS__)
909 -#define SYSCALL_DEFINE5(...) SYSCALL_DEFINEx(5, __VA_ARGS__)
910 -#define SYSCALL_DEFINE6(...) SYSCALL_DEFINEx(6, __VA_ARGS__)
911 +#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void)
912 +#define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
913 +#define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
914 +#define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
915 +#define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
916 +#define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
917 +#define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
918
919 #ifdef CONFIG_PPC64
920 #define SYSCALL_ALIAS(alias, name) \
921 @@ -116,21 +116,21 @@ struct old_linux_dirent;
922
923 #define SYSCALL_DEFINE(name) static inline long SYSC_##name
924 #define SYSCALL_DEFINEx(x, name, ...) \
925 - asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)); \
926 - static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)); \
927 - asmlinkage long SyS_##name(__SC_LONG##x(__VA_ARGS__)) \
928 + asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__)); \
929 + static inline long SYSC##name(__SC_DECL##x(__VA_ARGS__)); \
930 + asmlinkage long SyS##name(__SC_LONG##x(__VA_ARGS__)) \
931 { \
932 __SC_TEST##x(__VA_ARGS__); \
933 - return (long) SYSC_##name(__SC_CAST##x(__VA_ARGS__)); \
934 + return (long) SYSC##name(__SC_CAST##x(__VA_ARGS__)); \
935 } \
936 - SYSCALL_ALIAS(sys_##name, SyS_##name); \
937 - static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__))
938 + SYSCALL_ALIAS(sys##name, SyS##name); \
939 + static inline long SYSC##name(__SC_DECL##x(__VA_ARGS__))
940
941 #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */
942
943 #define SYSCALL_DEFINE(name) asmlinkage long sys_##name
944 #define SYSCALL_DEFINEx(x, name, ...) \
945 - asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__))
946 + asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__))
947
948 #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */
949
950 diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
951 index b799fb2..2fec3c3 100644
952 --- a/include/net/sctp/checksum.h
953 +++ b/include/net/sctp/checksum.h
954 @@ -79,5 +79,5 @@ static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32)
955
956 static inline __be32 sctp_end_cksum(__be32 crc32)
957 {
958 - return ~crc32;
959 + return (__force __be32)~cpu_to_le32((__force u32)crc32);
960 }
961 diff --git a/mm/page-writeback.c b/mm/page-writeback.c
962 index 8875822..5f7cdc2 100644
963 --- a/mm/page-writeback.c
964 +++ b/mm/page-writeback.c
965 @@ -985,13 +985,25 @@ continue_unlock:
966 }
967 }
968
969 - if (wbc->sync_mode == WB_SYNC_NONE) {
970 + if (wbc->nr_to_write > 0) {
971 wbc->nr_to_write--;
972 - if (wbc->nr_to_write <= 0) {
973 + if (wbc->nr_to_write == 0 &&
974 + wbc->sync_mode == WB_SYNC_NONE) {
975 + /*
976 + * We stop writing back only if we are
977 + * not doing integrity sync. In case of
978 + * integrity sync we have to keep going
979 + * because someone may be concurrently
980 + * dirtying pages, and we might have
981 + * synced a lot of newly appeared dirty
982 + * pages, but have not synced all of the
983 + * old dirty pages.
984 + */
985 done = 1;
986 break;
987 }
988 }
989 +
990 if (wbc->nonblocking && bdi_write_congested(bdi)) {
991 wbc->encountered_congestion = 1;
992 done = 1;
993 @@ -1001,7 +1013,7 @@ continue_unlock:
994 pagevec_release(&pvec);
995 cond_resched();
996 }
997 - if (!cycled) {
998 + if (!cycled && !done) {
999 /*
1000 * range_cyclic:
1001 * We hit the last page and there is more work to be done: wrap
1002 diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
1003 index 96434d7..0abd0ef 100644
1004 --- a/net/bluetooth/hidp/core.c
1005 +++ b/net/bluetooth/hidp/core.c
1006 @@ -684,6 +684,10 @@ static const struct {
1007 } hidp_blacklist[] = {
1008 /* Apple wireless Mighty Mouse */
1009 { 0x05ac, 0x030c, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
1010 + /* Apple Wireless Keyboard */
1011 + { 0x05ac, 0x022c, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
1012 + { 0x05ac, 0x022d, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
1013 + { 0x05ac, 0x022e, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
1014
1015 { } /* Terminating entry */
1016 };
1017 diff --git a/net/core/skbuff.c b/net/core/skbuff.c
1018 index ca1ccdf..53425fa 100644
1019 --- a/net/core/skbuff.c
1020 +++ b/net/core/skbuff.c
1021 @@ -73,17 +73,13 @@ static struct kmem_cache *skbuff_fclone_cache __read_mostly;
1022 static void sock_pipe_buf_release(struct pipe_inode_info *pipe,
1023 struct pipe_buffer *buf)
1024 {
1025 - struct sk_buff *skb = (struct sk_buff *) buf->private;
1026 -
1027 - kfree_skb(skb);
1028 + put_page(buf->page);
1029 }
1030
1031 static void sock_pipe_buf_get(struct pipe_inode_info *pipe,
1032 struct pipe_buffer *buf)
1033 {
1034 - struct sk_buff *skb = (struct sk_buff *) buf->private;
1035 -
1036 - skb_get(skb);
1037 + get_page(buf->page);
1038 }
1039
1040 static int sock_pipe_buf_steal(struct pipe_inode_info *pipe,
1041 @@ -1262,9 +1258,19 @@ fault:
1042 */
1043 static void sock_spd_release(struct splice_pipe_desc *spd, unsigned int i)
1044 {
1045 - struct sk_buff *skb = (struct sk_buff *) spd->partial[i].private;
1046 + put_page(spd->pages[i]);
1047 +}
1048
1049 - kfree_skb(skb);
1050 +static inline struct page *linear_to_page(struct page *page, unsigned int len,
1051 + unsigned int offset)
1052 +{
1053 + struct page *p = alloc_pages(GFP_KERNEL, 0);
1054 +
1055 + if (!p)
1056 + return NULL;
1057 + memcpy(page_address(p) + offset, page_address(page) + offset, len);
1058 +
1059 + return p;
1060 }
1061
1062 /*
1063 @@ -1272,16 +1278,23 @@ static void sock_spd_release(struct splice_pipe_desc *spd, unsigned int i)
1064 */
1065 static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page,
1066 unsigned int len, unsigned int offset,
1067 - struct sk_buff *skb)
1068 + struct sk_buff *skb, int linear)
1069 {
1070 if (unlikely(spd->nr_pages == PIPE_BUFFERS))
1071 return 1;
1072
1073 + if (linear) {
1074 + page = linear_to_page(page, len, offset);
1075 + if (!page)
1076 + return 1;
1077 + } else
1078 + get_page(page);
1079 +
1080 spd->pages[spd->nr_pages] = page;
1081 spd->partial[spd->nr_pages].len = len;
1082 spd->partial[spd->nr_pages].offset = offset;
1083 - spd->partial[spd->nr_pages].private = (unsigned long) skb_get(skb);
1084 spd->nr_pages++;
1085 +
1086 return 0;
1087 }
1088
1089 @@ -1297,7 +1310,7 @@ static inline void __segment_seek(struct page **page, unsigned int *poff,
1090 static inline int __splice_segment(struct page *page, unsigned int poff,
1091 unsigned int plen, unsigned int *off,
1092 unsigned int *len, struct sk_buff *skb,
1093 - struct splice_pipe_desc *spd)
1094 + struct splice_pipe_desc *spd, int linear)
1095 {
1096 if (!*len)
1097 return 1;
1098 @@ -1320,7 +1333,7 @@ static inline int __splice_segment(struct page *page, unsigned int poff,
1099 /* the linear region may spread across several pages */
1100 flen = min_t(unsigned int, flen, PAGE_SIZE - poff);
1101
1102 - if (spd_fill_page(spd, page, flen, poff, skb))
1103 + if (spd_fill_page(spd, page, flen, poff, skb, linear))
1104 return 1;
1105
1106 __segment_seek(&page, &poff, &plen, flen);
1107 @@ -1347,7 +1360,7 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
1108 if (__splice_segment(virt_to_page(skb->data),
1109 (unsigned long) skb->data & (PAGE_SIZE - 1),
1110 skb_headlen(skb),
1111 - offset, len, skb, spd))
1112 + offset, len, skb, spd, 1))
1113 return 1;
1114
1115 /*
1116 @@ -1357,7 +1370,7 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
1117 const skb_frag_t *f = &skb_shinfo(skb)->frags[seg];
1118
1119 if (__splice_segment(f->page, f->page_offset, f->size,
1120 - offset, len, skb, spd))
1121 + offset, len, skb, spd, 0))
1122 return 1;
1123 }
1124
1125 @@ -1370,7 +1383,7 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
1126 * the frag list, if such a thing exists. We'd probably need to recurse to
1127 * handle that cleanly.
1128 */
1129 -int skb_splice_bits(struct sk_buff *__skb, unsigned int offset,
1130 +int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
1131 struct pipe_inode_info *pipe, unsigned int tlen,
1132 unsigned int flags)
1133 {
1134 @@ -1383,16 +1396,6 @@ int skb_splice_bits(struct sk_buff *__skb, unsigned int offset,
1135 .ops = &sock_pipe_buf_ops,
1136 .spd_release = sock_spd_release,
1137 };
1138 - struct sk_buff *skb;
1139 -
1140 - /*
1141 - * I'd love to avoid the clone here, but tcp_read_sock()
1142 - * ignores reference counts and unconditonally kills the sk_buff
1143 - * on return from the actor.
1144 - */
1145 - skb = skb_clone(__skb, GFP_KERNEL);
1146 - if (unlikely(!skb))
1147 - return -ENOMEM;
1148
1149 /*
1150 * __skb_splice_bits() only fails if the output has no room left,
1151 @@ -1416,15 +1419,9 @@ int skb_splice_bits(struct sk_buff *__skb, unsigned int offset,
1152 }
1153
1154 done:
1155 - /*
1156 - * drop our reference to the clone, the pipe consumption will
1157 - * drop the rest.
1158 - */
1159 - kfree_skb(skb);
1160 -
1161 if (spd.nr_pages) {
1162 + struct sock *sk = skb->sk;
1163 int ret;
1164 - struct sock *sk = __skb->sk;
1165
1166 /*
1167 * Drop the socket lock, otherwise we have reverse
1168 @@ -2001,10 +1998,10 @@ unsigned int skb_seq_read(unsigned int consumed, const u8 **data,
1169 return 0;
1170
1171 next_skb:
1172 - block_limit = skb_headlen(st->cur_skb);
1173 + block_limit = skb_headlen(st->cur_skb) + st->stepped_offset;
1174
1175 if (abs_offset < block_limit) {
1176 - *data = st->cur_skb->data + abs_offset;
1177 + *data = st->cur_skb->data + (abs_offset - st->stepped_offset);
1178 return block_limit - abs_offset;
1179 }
1180
1181 @@ -2039,13 +2036,14 @@ next_skb:
1182 st->frag_data = NULL;
1183 }
1184
1185 - if (st->cur_skb->next) {
1186 - st->cur_skb = st->cur_skb->next;
1187 + if (st->root_skb == st->cur_skb &&
1188 + skb_shinfo(st->root_skb)->frag_list) {
1189 + st->cur_skb = skb_shinfo(st->root_skb)->frag_list;
1190 st->frag_idx = 0;
1191 goto next_skb;
1192 - } else if (st->root_skb == st->cur_skb &&
1193 - skb_shinfo(st->root_skb)->frag_list) {
1194 - st->cur_skb = skb_shinfo(st->root_skb)->frag_list;
1195 + } else if (st->cur_skb->next) {
1196 + st->cur_skb = st->cur_skb->next;
1197 + st->frag_idx = 0;
1198 goto next_skb;
1199 }
1200
1201 diff --git a/net/core/sock.c b/net/core/sock.c
1202 index 91f8bbc..b1b2f22 100644
1203 --- a/net/core/sock.c
1204 +++ b/net/core/sock.c
1205 @@ -695,6 +695,8 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
1206 if (len < 0)
1207 return -EINVAL;
1208
1209 + v.val = 0;
1210 +
1211 switch(optname) {
1212 case SO_DEBUG:
1213 v.val = sock_flag(sk, SOCK_DBG);
1214 diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
1215 index 42065ff..ff75000 100644
1216 --- a/net/ipv4/ipconfig.c
1217 +++ b/net/ipv4/ipconfig.c
1218 @@ -1272,6 +1272,9 @@ __be32 __init root_nfs_parse_addr(char *name)
1219 static int __init ip_auto_config(void)
1220 {
1221 __be32 addr;
1222 +#ifdef IPCONFIG_DYNAMIC
1223 + int retries = CONF_OPEN_RETRIES;
1224 +#endif
1225
1226 #ifdef CONFIG_PROC_FS
1227 proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops);
1228 @@ -1308,9 +1311,6 @@ static int __init ip_auto_config(void)
1229 #endif
1230 ic_first_dev->next) {
1231 #ifdef IPCONFIG_DYNAMIC
1232 -
1233 - int retries = CONF_OPEN_RETRIES;
1234 -
1235 if (ic_dynamic() < 0) {
1236 ic_close_devs();
1237
1238 diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
1239 index f57d576..9440ba6 100644
1240 --- a/net/ipv4/tcp.c
1241 +++ b/net/ipv4/tcp.c
1242 @@ -518,8 +518,13 @@ static int tcp_splice_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
1243 unsigned int offset, size_t len)
1244 {
1245 struct tcp_splice_state *tss = rd_desc->arg.data;
1246 + int ret;
1247
1248 - return skb_splice_bits(skb, offset, tss->pipe, tss->len, tss->flags);
1249 + ret = skb_splice_bits(skb, offset, tss->pipe, min(rd_desc->count, len),
1250 + tss->flags);
1251 + if (ret > 0)
1252 + rd_desc->count -= ret;
1253 + return ret;
1254 }
1255
1256 static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss)
1257 @@ -527,6 +532,7 @@ static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss)
1258 /* Store TCP splice context information in read_descriptor_t. */
1259 read_descriptor_t rd_desc = {
1260 .arg.data = tss,
1261 + .count = tss->len,
1262 };
1263
1264 return tcp_read_sock(sk, &rd_desc, tcp_splice_data_recv);
1265 @@ -611,11 +617,13 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
1266 tss.len -= ret;
1267 spliced += ret;
1268
1269 + if (!timeo)
1270 + break;
1271 release_sock(sk);
1272 lock_sock(sk);
1273
1274 if (sk->sk_err || sk->sk_state == TCP_CLOSE ||
1275 - (sk->sk_shutdown & RCV_SHUTDOWN) || !timeo ||
1276 + (sk->sk_shutdown & RCV_SHUTDOWN) ||
1277 signal_pending(current))
1278 break;
1279 }
1280 diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
1281 index 915e6b7..a9b62ee 100644
1282 --- a/net/ipv4/udp.c
1283 +++ b/net/ipv4/udp.c
1284 @@ -959,9 +959,11 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
1285
1286 if ((rc = sock_queue_rcv_skb(sk, skb)) < 0) {
1287 /* Note that an ENOMEM error is charged twice */
1288 - if (rc == -ENOMEM)
1289 + if (rc == -ENOMEM) {
1290 UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
1291 is_udplite);
1292 + atomic_inc(&sk->sk_drops);
1293 + }
1294 goto drop;
1295 }
1296
1297 @@ -1172,7 +1174,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
1298 int proto)
1299 {
1300 struct sock *sk;
1301 - struct udphdr *uh = udp_hdr(skb);
1302 + struct udphdr *uh;
1303 unsigned short ulen;
1304 struct rtable *rt = (struct rtable*)skb->dst;
1305 __be32 saddr = ip_hdr(skb)->saddr;
1306 @@ -1185,6 +1187,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
1307 if (!pskb_may_pull(skb, sizeof(struct udphdr)))
1308 goto drop; /* No space for header. */
1309
1310 + uh = udp_hdr(skb);
1311 ulen = ntohs(uh->len);
1312 if (ulen > skb->len)
1313 goto short_packet;
1314 diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
1315 index 37a4e77..489a7fd 100644
1316 --- a/net/ipv6/ip6_flowlabel.c
1317 +++ b/net/ipv6/ip6_flowlabel.c
1318 @@ -323,17 +323,21 @@ static struct ip6_flowlabel *
1319 fl_create(struct net *net, struct in6_flowlabel_req *freq, char __user *optval,
1320 int optlen, int *err_p)
1321 {
1322 - struct ip6_flowlabel *fl;
1323 + struct ip6_flowlabel *fl = NULL;
1324 int olen;
1325 int addr_type;
1326 int err;
1327
1328 + olen = optlen - CMSG_ALIGN(sizeof(*freq));
1329 + err = -EINVAL;
1330 + if (olen > 64 * 1024)
1331 + goto done;
1332 +
1333 err = -ENOMEM;
1334 fl = kzalloc(sizeof(*fl), GFP_KERNEL);
1335 if (fl == NULL)
1336 goto done;
1337
1338 - olen = optlen - CMSG_ALIGN(sizeof(*freq));
1339 if (olen > 0) {
1340 struct msghdr msg;
1341 struct flowi flowi;
1342 diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
1343 index 3df2c44..a423200 100644
1344 --- a/net/ipv6/ip6_output.c
1345 +++ b/net/ipv6/ip6_output.c
1346 @@ -1091,6 +1091,18 @@ static inline int ip6_ufo_append_data(struct sock *sk,
1347 return err;
1348 }
1349
1350 +static inline struct ipv6_opt_hdr *ip6_opt_dup(struct ipv6_opt_hdr *src,
1351 + gfp_t gfp)
1352 +{
1353 + return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL;
1354 +}
1355 +
1356 +static inline struct ipv6_rt_hdr *ip6_rthdr_dup(struct ipv6_rt_hdr *src,
1357 + gfp_t gfp)
1358 +{
1359 + return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL;
1360 +}
1361 +
1362 int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
1363 int offset, int len, int odd, struct sk_buff *skb),
1364 void *from, int length, int transhdrlen,
1365 @@ -1116,17 +1128,37 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
1366 * setup for corking
1367 */
1368 if (opt) {
1369 - if (np->cork.opt == NULL) {
1370 - np->cork.opt = kmalloc(opt->tot_len,
1371 - sk->sk_allocation);
1372 - if (unlikely(np->cork.opt == NULL))
1373 - return -ENOBUFS;
1374 - } else if (np->cork.opt->tot_len < opt->tot_len) {
1375 - printk(KERN_DEBUG "ip6_append_data: invalid option length\n");
1376 + if (WARN_ON(np->cork.opt))
1377 return -EINVAL;
1378 - }
1379 - memcpy(np->cork.opt, opt, opt->tot_len);
1380 - inet->cork.flags |= IPCORK_OPT;
1381 +
1382 + np->cork.opt = kmalloc(opt->tot_len, sk->sk_allocation);
1383 + if (unlikely(np->cork.opt == NULL))
1384 + return -ENOBUFS;
1385 +
1386 + np->cork.opt->tot_len = opt->tot_len;
1387 + np->cork.opt->opt_flen = opt->opt_flen;
1388 + np->cork.opt->opt_nflen = opt->opt_nflen;
1389 +
1390 + np->cork.opt->dst0opt = ip6_opt_dup(opt->dst0opt,
1391 + sk->sk_allocation);
1392 + if (opt->dst0opt && !np->cork.opt->dst0opt)
1393 + return -ENOBUFS;
1394 +
1395 + np->cork.opt->dst1opt = ip6_opt_dup(opt->dst1opt,
1396 + sk->sk_allocation);
1397 + if (opt->dst1opt && !np->cork.opt->dst1opt)
1398 + return -ENOBUFS;
1399 +
1400 + np->cork.opt->hopopt = ip6_opt_dup(opt->hopopt,
1401 + sk->sk_allocation);
1402 + if (opt->hopopt && !np->cork.opt->hopopt)
1403 + return -ENOBUFS;
1404 +
1405 + np->cork.opt->srcrt = ip6_rthdr_dup(opt->srcrt,
1406 + sk->sk_allocation);
1407 + if (opt->srcrt && !np->cork.opt->srcrt)
1408 + return -ENOBUFS;
1409 +
1410 /* need source address above miyazawa*/
1411 }
1412 dst_hold(&rt->u.dst);
1413 @@ -1153,8 +1185,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
1414 } else {
1415 rt = (struct rt6_info *)inet->cork.dst;
1416 fl = &inet->cork.fl;
1417 - if (inet->cork.flags & IPCORK_OPT)
1418 - opt = np->cork.opt;
1419 + opt = np->cork.opt;
1420 transhdrlen = 0;
1421 exthdrlen = 0;
1422 mtu = inet->cork.fragsize;
1423 @@ -1393,9 +1424,15 @@ error:
1424
1425 static void ip6_cork_release(struct inet_sock *inet, struct ipv6_pinfo *np)
1426 {
1427 - inet->cork.flags &= ~IPCORK_OPT;
1428 - kfree(np->cork.opt);
1429 - np->cork.opt = NULL;
1430 + if (np->cork.opt) {
1431 + kfree(np->cork.opt->dst0opt);
1432 + kfree(np->cork.opt->dst1opt);
1433 + kfree(np->cork.opt->hopopt);
1434 + kfree(np->cork.opt->srcrt);
1435 + kfree(np->cork.opt);
1436 + np->cork.opt = NULL;
1437 + }
1438 +
1439 if (inet->cork.dst) {
1440 dst_release(inet->cork.dst);
1441 inet->cork.dst = NULL;
1442 diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
1443 index 14d47d8..0610123 100644
1444 --- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
1445 +++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
1446 @@ -49,8 +49,8 @@ static bool icmpv6_pkt_to_tuple(const struct sk_buff *skb,
1447 static const u_int8_t invmap[] = {
1448 [ICMPV6_ECHO_REQUEST - 128] = ICMPV6_ECHO_REPLY + 1,
1449 [ICMPV6_ECHO_REPLY - 128] = ICMPV6_ECHO_REQUEST + 1,
1450 - [ICMPV6_NI_QUERY - 128] = ICMPV6_NI_QUERY + 1,
1451 - [ICMPV6_NI_REPLY - 128] = ICMPV6_NI_REPLY +1
1452 + [ICMPV6_NI_QUERY - 128] = ICMPV6_NI_REPLY + 1,
1453 + [ICMPV6_NI_REPLY - 128] = ICMPV6_NI_QUERY +1
1454 };
1455
1456 static bool icmpv6_invert_tuple(struct nf_conntrack_tuple *tuple,
1457 diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
1458 index 79a0627..27bd353 100644
1459 --- a/net/mac80211/debugfs_sta.c
1460 +++ b/net/mac80211/debugfs_sta.c
1461 @@ -200,7 +200,7 @@ static ssize_t sta_agg_status_write(struct file *file,
1462 /* toggle Rx aggregation command */
1463 tid_num = tid_num - 100;
1464 if (tid_static_rx[tid_num] == 1) {
1465 - strcpy(state, "off ");
1466 + strcpy(state, "off");
1467 ieee80211_sta_stop_rx_ba_session(dev, da, tid_num, 0,
1468 WLAN_REASON_QSTA_REQUIRE_SETUP);
1469 sta->ampdu_mlme.tid_state_rx[tid_num] |=
1470 diff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c
1471 index e6e4681..aa7aec0 100644
1472 --- a/net/netfilter/xt_sctp.c
1473 +++ b/net/netfilter/xt_sctp.c
1474 @@ -105,7 +105,7 @@ match_packet(const struct sk_buff *skb,
1475
1476 switch (chunk_match_type) {
1477 case SCTP_CHUNK_MATCH_ALL:
1478 - return SCTP_CHUNKMAP_IS_CLEAR(info->chunkmap);
1479 + return SCTP_CHUNKMAP_IS_CLEAR(chunkmapcopy);
1480 case SCTP_CHUNK_MATCH_ANY:
1481 return false;
1482 case SCTP_CHUNK_MATCH_ONLY:
1483 diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
1484 index c718e7e..4b50878 100644
1485 --- a/net/packet/af_packet.c
1486 +++ b/net/packet/af_packet.c
1487 @@ -77,6 +77,7 @@
1488 #include <linux/poll.h>
1489 #include <linux/module.h>
1490 #include <linux/init.h>
1491 +#include <linux/mutex.h>
1492
1493 #ifdef CONFIG_INET
1494 #include <net/inet_common.h>
1495 @@ -175,6 +176,7 @@ struct packet_sock {
1496 #endif
1497 struct packet_type prot_hook;
1498 spinlock_t bind_lock;
1499 + struct mutex pg_vec_lock;
1500 unsigned int running:1, /* prot_hook is attached*/
1501 auxdata:1,
1502 origdev:1;
1503 @@ -220,13 +222,13 @@ static void *packet_lookup_frame(struct packet_sock *po, unsigned int position,
1504 h.raw = po->pg_vec[pg_vec_pos] + (frame_offset * po->frame_size);
1505 switch (po->tp_version) {
1506 case TPACKET_V1:
1507 - if (status != h.h1->tp_status ? TP_STATUS_USER :
1508 - TP_STATUS_KERNEL)
1509 + if (status != (h.h1->tp_status ? TP_STATUS_USER :
1510 + TP_STATUS_KERNEL))
1511 return NULL;
1512 break;
1513 case TPACKET_V2:
1514 - if (status != h.h2->tp_status ? TP_STATUS_USER :
1515 - TP_STATUS_KERNEL)
1516 + if (status != (h.h2->tp_status ? TP_STATUS_USER :
1517 + TP_STATUS_KERNEL))
1518 return NULL;
1519 break;
1520 }
1521 @@ -1068,6 +1070,7 @@ static int packet_create(struct net *net, struct socket *sock, int protocol)
1522 */
1523
1524 spin_lock_init(&po->bind_lock);
1525 + mutex_init(&po->pg_vec_lock);
1526 po->prot_hook.func = packet_rcv;
1527
1528 if (sock->type == SOCK_PACKET)
1529 @@ -1863,6 +1866,7 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing
1530 synchronize_net();
1531
1532 err = -EBUSY;
1533 + mutex_lock(&po->pg_vec_lock);
1534 if (closing || atomic_read(&po->mapped) == 0) {
1535 err = 0;
1536 #define XC(a, b) ({ __typeof__ ((a)) __t; __t = (a); (a) = (b); __t; })
1537 @@ -1884,6 +1888,7 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing
1538 if (atomic_read(&po->mapped))
1539 printk(KERN_DEBUG "packet_mmap: vma is busy: %d\n", atomic_read(&po->mapped));
1540 }
1541 + mutex_unlock(&po->pg_vec_lock);
1542
1543 spin_lock(&po->bind_lock);
1544 if (was_running && !po->running) {
1545 @@ -1916,7 +1921,7 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st
1546
1547 size = vma->vm_end - vma->vm_start;
1548
1549 - lock_sock(sk);
1550 + mutex_lock(&po->pg_vec_lock);
1551 if (po->pg_vec == NULL)
1552 goto out;
1553 if (size != po->pg_vec_len*po->pg_vec_pages*PAGE_SIZE)
1554 @@ -1939,7 +1944,7 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_st
1555 err = 0;
1556
1557 out:
1558 - release_sock(sk);
1559 + mutex_unlock(&po->pg_vec_lock);
1560 return err;
1561 }
1562 #endif
1563 diff --git a/net/sctp/output.c b/net/sctp/output.c
1564 index 225c712..e4746fd 100644
1565 --- a/net/sctp/output.c
1566 +++ b/net/sctp/output.c
1567 @@ -324,14 +324,16 @@ append:
1568 switch (chunk->chunk_hdr->type) {
1569 case SCTP_CID_DATA:
1570 retval = sctp_packet_append_data(packet, chunk);
1571 + if (SCTP_XMIT_OK != retval)
1572 + goto finish;
1573 /* Disallow SACK bundling after DATA. */
1574 packet->has_sack = 1;
1575 /* Disallow AUTH bundling after DATA */
1576 packet->has_auth = 1;
1577 /* Let it be knows that packet has DATA in it */
1578 packet->has_data = 1;
1579 - if (SCTP_XMIT_OK != retval)
1580 - goto finish;
1581 + /* timestamp the chunk for rtx purposes */
1582 + chunk->sent_at = jiffies;
1583 break;
1584 case SCTP_CID_COOKIE_ECHO:
1585 packet->has_cookie_echo = 1;
1586 @@ -470,7 +472,6 @@ int sctp_packet_transmit(struct sctp_packet *packet)
1587 } else
1588 chunk->resent = 1;
1589
1590 - chunk->sent_at = jiffies;
1591 has_data = 1;
1592 }
1593
1594 diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
1595 index 4328ad5..fe11686 100644
1596 --- a/net/sctp/outqueue.c
1597 +++ b/net/sctp/outqueue.c
1598 @@ -929,7 +929,6 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
1599 }
1600
1601 /* Finally, transmit new packets. */
1602 - start_timer = 0;
1603 while ((chunk = sctp_outq_dequeue_data(q)) != NULL) {
1604 /* RFC 2960 6.5 Every DATA chunk MUST carry a valid
1605 * stream identifier.
1606 @@ -1028,7 +1027,7 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
1607 list_add_tail(&chunk->transmitted_list,
1608 &transport->transmitted);
1609
1610 - sctp_transport_reset_timers(transport, start_timer-1);
1611 + sctp_transport_reset_timers(transport, 0);
1612
1613 q->empty = 0;
1614
1615 diff --git a/scripts/kernel-doc b/scripts/kernel-doc
1616 index 44ee94d..0865a89 100755
1617 --- a/scripts/kernel-doc
1618 +++ b/scripts/kernel-doc
1619 @@ -1758,6 +1758,40 @@ sub reset_state {
1620 $state = 0;
1621 }
1622
1623 +sub syscall_munge() {
1624 + my $void = 0;
1625 +
1626 + $prototype =~ s@[\r\n\t]+@ @gos; # strip newlines/CR's/tabs
1627 +## if ($prototype =~ m/SYSCALL_DEFINE0\s*\(\s*(a-zA-Z0-9_)*\s*\)/) {
1628 + if ($prototype =~ m/SYSCALL_DEFINE0/) {
1629 + $void = 1;
1630 +## $prototype = "long sys_$1(void)";
1631 + }
1632 +
1633 + $prototype =~ s/SYSCALL_DEFINE.*\(/long sys_/; # fix return type & func name
1634 + if ($prototype =~ m/long (sys_.*?),/) {
1635 + $prototype =~ s/,/\(/;
1636 + } elsif ($void) {
1637 + $prototype =~ s/\)/\(void\)/;
1638 + }
1639 +
1640 + # now delete all of the odd-number commas in $prototype
1641 + # so that arg types & arg names don't have a comma between them
1642 + my $count = 0;
1643 + my $len = length($prototype);
1644 + if ($void) {
1645 + $len = 0; # skip the for-loop
1646 + }
1647 + for (my $ix = 0; $ix < $len; $ix++) {
1648 + if (substr($prototype, $ix, 1) eq ',') {
1649 + $count++;
1650 + if ($count % 2 == 1) {
1651 + substr($prototype, $ix, 1) = ' ';
1652 + }
1653 + }
1654 + }
1655 +}
1656 +
1657 sub process_state3_function($$) {
1658 my $x = shift;
1659 my $file = shift;
1660 @@ -1774,7 +1808,10 @@ sub process_state3_function($$) {
1661 $prototype =~ s@/\*.*?\*/@@gos; # strip comments.
1662 $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
1663 $prototype =~ s@^\s+@@gos; # strip leading spaces
1664 - dump_function($prototype,$file);
1665 + if ($prototype =~ /SYSCALL_DEFINE/) {
1666 + syscall_munge();
1667 + }
1668 + dump_function($prototype, $file);
1669 reset_state();
1670 }
1671 }
1672 diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
1673 index b5e1a71..04d50aa 100644
1674 --- a/sound/drivers/mtpav.c
1675 +++ b/sound/drivers/mtpav.c
1676 @@ -706,7 +706,6 @@ static int __devinit snd_mtpav_probe(struct platform_device *dev)
1677 mtp_card->card = card;
1678 mtp_card->irq = -1;
1679 mtp_card->share_irq = 0;
1680 - mtp_card->inmidiport = 0xffffffff;
1681 mtp_card->inmidistate = 0;
1682 mtp_card->outmidihwport = 0xffffffff;
1683 init_timer(&mtp_card->timer);
1684 @@ -715,6 +714,8 @@ static int __devinit snd_mtpav_probe(struct platform_device *dev)
1685
1686 card->private_free = snd_mtpav_free;
1687
1688 + mtp_card->inmidiport = mtp_card->num_ports + MTPAV_PIDX_BROADCAST;
1689 +
1690 err = snd_mtpav_get_ISA(mtp_card);
1691 if (err < 0)
1692 goto __error;