Linux 2.6.20.4
Subsystems (25)
We (the -stable team) are announcing the release of the 2.6.20.4 kernel. It contains a number of bugfixes and all 2.6.20 users are recommended to upgrade.
The diffstat and short summary of the fixes are below.
I'll also be replying to this message with a copy of the patch between 2.6.20.3 and 2.6.20.4.
The updated 2.6.20.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.20.y.git
and can be browsed at the normal kernel.org git web browser:
www.kernel.org/git/
thanks,
greg k-h
--------
Makefile | 2 arch/ia64/kernel/iosapic.c | 8 ++- arch/ia64/sn/kernel/irq.c | 14 +++++- arch/sparc64/kernel/ktlb.S | 8 +++ arch/sparc64/kernel/tsb.S | 1 arch/sparc64/lib/NGbzero.S | 1 arch/sparc64/lib/NGmemcpy.S | 2 arch/sparc64/lib/NGpage.S | 2 arch/sparc64/mm/hugetlbpage.c | 3 + arch/sparc64/mm/init.c | 30 ++++++++++++- arch/um/include/os.h | 2 arch/um/os-Linux/sys-x86_64/Makefile | 2 arch/um/os-Linux/sys-x86_64/prctl.c | 12 +++++ arch/um/sys-x86_64/syscalls.c | 76 ++++++++++++++++++++++++++--------- arch/um/sys-x86_64/tls.c | 11 +++-- drivers/input/serio/i8042.c | 20 ++++++--- drivers/md/linear.c | 2 drivers/net/r8169.c | 10 ++-- drivers/pci/probe.c | 45 ++++++++++++++------ drivers/scsi/gdth.c | 2 drivers/scsi/st.c | 23 +++++----- drivers/scsi/st.h | 3 - drivers/usb/host/ehci-hub.c | 4 + fs/nfs/inode.c | 3 - include/asm-sparc64/tsb.h | 2 include/asm-um/processor-x86_64.h | 6 +- include/asm-um/ptrace-x86_64.h | 6 -- include/linux/ktime.h | 6 ++ kernel/auditsc.c | 24 +++++------ kernel/fork.c | 2 kernel/futex.c | 2 kernel/hrtimer.c | 6 ++ mm/filemap.c | 46 ++++++++++++++++----- mm/madvise.c | 5 +- mm/oom_kill.c | 2 net/core/skbuff.c | 1 net/ipv4/cipso_ipv4.c | 7 +-- net/ipv4/devinet.c | 4 + net/ipv4/fib_trie.c | 2 net/ipv6/ipv6_sockglue.c | 2 net/ipv6/tcp_ipv6.c | 1 net/irda/irttp.c | 1 net/netfilter/nfnetlink_log.c | 8 --- net/xfrm/xfrm_state.c | 6 +- sound/pci/hda/hda_intel.c | 13 +++++ 45 files changed, 321 insertions(+), 117 deletions(-)
Summary of changes from v2.6.20.3 to v2.6.20.4
==============================================
Al Viro (1):
fix deadlock in audit_log_task_context()
Alan Stern (1):
EHCI: add delay to bus_resume before accessing ports
Alexey Dobriyan (1):
Copy over mac_len when cloning an skb
Andy Isaacson (1):
fix read past end of array in md/linear.c
Ankita Garg (1):
oom fix: prevent oom from killing a process with children/sibling unkillable
David Miller (3):
Fix sparc64 hugepage bugs
Fix page allocation debugging on sparc64
Fix niagara memory corruption
Dmitry Torokhov (3):
Input: i8042 - really suppress ACK/NAK during panic blink
Input: i8042 - fix AUX IRQ delivery check
Input: i8042 - another attempt to fix AUX delivery checks
Evgeniy Polyakov (1):
Fix rtm_to_ifaddr() error return.
Francois Romieu (1):
r8169: fix a race between PCI probe and dev_open
Greg Kroah-Hartman (1):
Linux 2.6.20.4
Ingo Molnar (1):
futex: PI state locking fix
Jan Beulich (1):
adjust legacy IDE resource setting (v2)
Jeff Dike (1):
UML - arch_prctl should set thread fs
Joerg Dorchain (1):
gdth: fix oops in gdth_copy_cmd()
Joy Latten (1):
Fix extraneous IPSEC larval SA creation
KAMEZAWA Hiroyuki (1):
IA64: fix NULL pointer in ia64/irq_chip-mask/unmask function
Kai Makisara (1):
st: fix Tape dies if wrong block size used, bug 7919
Masayuki Nakagawa (1):
Fix ipv6 flow label inheritance
Michal Miroslaw (1):
NETFILTER: nfnetlink_log: fix reference counting
Nick Piggin (1):
mm: fix madvise infinine loop
Olaf Kirch (1):
Fix another NULL pointer deref in ipv6_sockglue.c
Paul Moore (1):
NetLabel: Verify sensitivity level has a valid CIPSO mapping
Robert Olsson (1):
Fix GFP_KERNEL with preemption disabled in fib_trie
Samuel Ortiz (1):
IrDA: irttp_dup spin_lock initialisation
Takashi Iwai (1):
hda-intel - Fix codec probe with ATI controllers
Thomas Gleixner (2):
hrtimer: prevent overrun DoS in hrtimer_forward() fix MTIME_SEC_MAX on 32-bit
Trond Myklebust (1):
nfs: nfs_getattr() can't call nfs_sync_mapping_range() for non-regular files
Zach Brown (1):
dio: invalidate clean pages before dio write
Zilvinas Valinskas (1):
initialise pi_lock if CONFIG_RT_MUTEXES=N
Makefile +1 -1
@@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 20 -EXTRAVERSION = .3 +EXTRAVERSION = .4 NAME = Homicidal Dwarf Hamster # *DOCUMENTATION*
arch/ia64/kernel/iosapic.c +6 -2
@@ -446,7 +446,7 @@ iosapic_end_level_irq (unsigned int irq)#define iosapic_disable_level_irq mask_irq#define iosapic_ack_level_irq nop -struct hw_interrupt_type irq_type_iosapic_level = { +struct irq_chip irq_type_iosapic_level = { .name ="IO-SAPIC-level" , .startup = iosapic_startup_level_irq, .shutdown = iosapic_shutdown_level_irq,
@@ -454,6 +454,8 @@ struct hw_interrupt_type irq_type_iosapic_level = { .disable = iosapic_disable_level_irq, .ack = iosapic_ack_level_irq, .end = iosapic_end_level_irq, + .mask = mask_irq, + .unmask = unmask_irq, .set_affinity = iosapic_set_affinity };
@@ -493,7 +495,7 @@ iosapic_ack_edge_irq (unsigned int irq)#define iosapic_disable_edge_irq nop#define iosapic_end_edge_irq nop -struct hw_interrupt_type irq_type_iosapic_edge = { +struct irq_chip irq_type_iosapic_edge = { .name ="IO-SAPIC-edge" , .startup = iosapic_startup_edge_irq, .shutdown = iosapic_disable_edge_irq,
@@ -501,6 +503,8 @@ struct hw_interrupt_type irq_type_iosapic_edge = { .disable = iosapic_disable_edge_irq, .ack = iosapic_ack_edge_irq, .end = iosapic_end_edge_irq, + .mask = mask_irq, + .unmask = unmask_irq, .set_affinity = iosapic_set_affinity };
arch/ia64/sn/kernel/irq.c +13 -1
@@ -205,7 +205,17 @@ static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) (void )sn_retarget_vector (sn_irq_info, nasid, slice); } -struct hw_interrupt_type irq_type_sn = { +static void +sn_mask_irq (unsigned int irq) +{ +} + +static void +sn_unmask_irq (unsigned int irq) +{ +} + +struct irq_chip irq_type_sn = { .name ="SN hub" , .startup = sn_startup_irq, .shutdown = sn_shutdown_irq,
@@ -213,6 +223,8 @@ struct hw_interrupt_type irq_type_sn = { .disable = sn_disable_irq, .ack = sn_ack_irq, .end = sn_end_irq, + .mask = sn_mask_irq, + .unmask = sn_unmask_irq, .set_affinity = sn_set_affinity_irq };
arch/sparc64/kernel/ktlb.S +7 -1
@@ -138,9 +138,15 @@ kvmap_dtlb_4v: brgez,pn %g4, kvmap_dtlb_nonlinear nop +#ifdef CONFIG_DEBUG_PAGEALLOC + /* Index through the base page size TSB even for linear + * mappings when using page allocation debugging. + */ + KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load) +#else /* Correct TAG_TARGET is already in %g6, check 4mb TSB. */ KERN_TSB4M_LOOKUP_TL1(%g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load) - +#endif /* TSB entry address left in %g1, lookup linear PTE. * Must preserve %g1 and %g6 (TAG). */
arch/sparc64/kernel/tsb.S +1 -0
@@ -546,6 +546,7 @@ NGtsb_init: subcc %o1, 0x100, %o1 bne,pt %xcc, 1b add %o0, 0x100, %o0 + membar #Sync retl wr %g2, 0x0, %asi .size NGtsb_init, .-NGtsb_init
arch/sparc64/lib/NGbzero.S +1 -0
@@ -88,6 +88,7 @@ NGbzero_loop: bne,pt %xcc, NGbzero_loop add %o0, 64, %o0 + membar #Sync wr %o4, 0x0, %asi brz,pn %o1, NGbzero_done NGbzero_medium:
arch/sparc64/lib/NGmemcpy.S +2 -0
@@ -247,6 +247,8 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ /* fall through */ 60: + membar #Sync + /* %o2 contains any final bytes still needed to be copied * over. If anything is left, we copy it one byte at a time. */
arch/sparc64/lib/NGpage.S +2 -0
@@ -41,6 +41,7 @@ NGcopy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */ subcc %g7, 64, %g7 bne,pt %xcc, 1b add %o0, 32, %o0 + membar #Sync retl nop
@@ -63,6 +64,7 @@ NGclear_user_page: /* %o0=dest, %o1=vaddr */ subcc %g7, 64, %g7 bne,pt %xcc, 1b add %o0, 32, %o0 + membar #Sync retl nop
arch/sparc64/mm/hugetlbpage.c +3 -0
@@ -248,6 +248,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,if (!pte_present (*ptep) &&pte_present (entry)) mm->context.huge_pte_count++; + addr &=HPAGE_MASK ;for (i =0 ; i < (1 <<HUGETLB_PAGE_ORDER ); i++) {set_pte_at (mm, addr, ptep, entry); ptep++;
@@ -266,6 +267,8 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,if (pte_present (entry)) mm->context.huge_pte_count--; + addr &=HPAGE_MASK ; +for (i =0 ; i < (1 <<HUGETLB_PAGE_ORDER ); i++) {pte_clear (mm, addr, ptep); addr +=PAGE_SIZE ;
arch/sparc64/mm/init.c +28 -2
@@ -59,8 +59,10 @@ unsigned long kern_linear_pte_xor[2] __read_mostly;*/ unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES /sizeof (unsigned long )]; +#ifndef CONFIG_DEBUG_PAGEALLOC /* A special kernel TSB for 4MB and 256MB linear mappings. */ struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES ]; +#endif #define MAX_BANKS 32
@@ -1301,7 +1303,12 @@ static void __init tsb_phys_patch(void) }/* Don't mark as init, we give this to the Hypervisor. */ -static struct hv_tsb_descr ktsb_descr[2 ]; +#ifndef CONFIG_DEBUG_PAGEALLOC +#define NUM_KTSB_DESCR 2 +#else +#define NUM_KTSB_DESCR 1 +#endif +static struct hv_tsb_descr ktsb_descr[NUM_KTSB_DESCR ];extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES ];static void __init sun4v_ktsb_init (void )
@@ -1340,6 +1347,7 @@ static void __init sun4v_ktsb_init(void) ktsb_descr[0 ].tsb_base = ktsb_pa; ktsb_descr[0 ].resv =0 ; +#ifndef CONFIG_DEBUG_PAGEALLOC /* Second KTSB for 4MB/256MB mappings. */ ktsb_pa = (kern_base + ((unsigned long )&swapper_4m_tsb[0 ] -KERNBASE ));
@@ -1352,6 +1360,7 @@ static void __init sun4v_ktsb_init(void) ktsb_descr[1 ].ctx_idx =0 ; ktsb_descr[1 ].tsb_base = ktsb_pa; ktsb_descr[1 ].resv =0 ; +#endif }void __cpuinit sun4v_ktsb_register (void )
@@ -1364,7 +1373,7 @@ void __cpuinit sun4v_ktsb_register(void) pa = kern_base + ((unsigned long )&ktsb_descr[0 ] -KERNBASE ); func =HV_FAST_MMU_TSB_CTX0 ; - arg0 =2 ; + arg0 =NUM_KTSB_DESCR ; arg1 = pa; __asm__ __volatile__("ta %6" : "=&r" (func), "=&r" (arg0), "=&r" (arg1)
@@ -1393,7 +1402,9 @@ void __init paging_init(void)/* Invalidate both kernel TSBs. */ memset (swapper_tsb,0x40 ,sizeof (swapper_tsb)); +#ifndef CONFIG_DEBUG_PAGEALLOC memset (swapper_4m_tsb,0x40 ,sizeof (swapper_4m_tsb)); +#endif if (tlb_type == hypervisor)sun4v_pgprot_init ();
@@ -1725,8 +1736,13 @@ static void __init sun4u_pgprot_init(void) pg_iobits = (_PAGE_VALID | _PAGE_PRESENT_4U | __DIRTY_BITS_4U | __ACCESS_BITS_4U | _PAGE_E_4U); +#ifdef CONFIG_DEBUG_PAGEALLOC + kern_linear_pte_xor[0 ] = (_PAGE_VALID | _PAGE_SZBITS_4U) ^ +0xfffff80000000000 ; +#else kern_linear_pte_xor[0 ] = (_PAGE_VALID | _PAGE_SZ4MB_4U) ^0xfffff80000000000 ; +#endif kern_linear_pte_xor[0 ] |= (_PAGE_CP_4U | _PAGE_CV_4U | _PAGE_P_4U | _PAGE_W_4U);
@@ -1769,13 +1785,23 @@ static void __init sun4v_pgprot_init(void) _PAGE_E = _PAGE_E_4V; _PAGE_CACHE = _PAGE_CACHE_4V; +#ifdef CONFIG_DEBUG_PAGEALLOC + kern_linear_pte_xor[0 ] = (_PAGE_VALID | _PAGE_SZBITS_4V) ^ +0xfffff80000000000 ; +#else kern_linear_pte_xor[0 ] = (_PAGE_VALID | _PAGE_SZ4MB_4V) ^0xfffff80000000000 ; +#endif kern_linear_pte_xor[0 ] |= (_PAGE_CP_4V | _PAGE_CV_4V | _PAGE_P_4V | _PAGE_W_4V); +#ifdef CONFIG_DEBUG_PAGEALLOC + kern_linear_pte_xor[1 ] = (_PAGE_VALID | _PAGE_SZBITS_4V) ^ +0xfffff80000000000 ; +#else kern_linear_pte_xor[1 ] = (_PAGE_VALID | _PAGE_SZ256MB_4V) ^0xfffff80000000000 ; +#endif kern_linear_pte_xor[1 ] |= (_PAGE_CP_4V | _PAGE_CV_4V | _PAGE_P_4V | _PAGE_W_4V);
arch/um/include/os.h +2 -0
@@ -341,4 +341,6 @@ extern void maybe_sigio_broken(int fd, int read);extern void sig_handler_common_skas (int sig,void *sc_ptr);extern void user_signal (int sig,union uml_pt_regs *regs,int pid); +extern int os_arch_prctl (int pid,int code,unsigned long *addr); +#endif
arch/um/os-Linux/sys-x86_64/Makefile +1 -1
@@ -3,7 +3,7 @@ # Licensed under the GPL # -obj-$(CONFIG_MODE_SKAS) = registers.o signal.o +obj-$(CONFIG_MODE_SKAS) = registers.o prctl.o signal.o USER_OBJS := $(obj-y)
arch/um/os-Linux/sys-x86_64/prctl.c new file +12 -0
@@ -0,0 +1,12 @@ +/* +* Copyright (C) 2007 Jeff Dike (jdike@{addtoit.com,linux.intel.com}) +* Licensed under the GPL +*/ + +#include <sys/ptrace.h> +#include <linux/ptrace.h> + +int os_arch_prctl (int pid,int code,unsigned long *addr) +{ +return ptrace (PTRACE_ARCH_PRCTL , pid, (unsigned long ) addr, code); +}
arch/um/sys-x86_64/syscalls.c +58 -18
109 lines not on this page · raw message
arch/um/sys-x86_64/tls.c +7 -4
@@ -1,14 +1,17 @@#include "linux/sched.h" -void debug_arch_force_load_TLS (void ) -{ -} -void clear_flushed_tls (struct task_struct *task) { }int arch_copy_tls (struct task_struct *t) { +/* +* If CLONE_SETTLS is set, we need to save the thread id +* (which is argument 5, child_tid, of clone) so it can be set +* during context switches. +*/ + t->thread.arch.fs = t->thread.regs.regs.skas.regs[R8 /sizeof (long )]; +return 0 ; }
drivers/input/serio/i8042.c +15 -5
@@ -371,7 +371,7 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)if (unlikely (i8042_suppress_kbd_ack))if (port_no ==I8042_KBD_PORT_NO && (data ==0xfa || data ==0xfe )) { - i8042_suppress_kbd_ack =0 ; + i8042_suppress_kbd_ack--; goto out; }
@@ -543,6 +543,7 @@ static int __devinit i8042_check_aux(void) {int retval =-1 ;int irq_registered =0 ; +int aux_loop_broken =0 ;unsigned long flags;unsigned char param;
@@ -559,7 +560,8 @@ static int __devinit i8042_check_aux(void)*/ param =0x5a ; -if (i8042_command (¶m,I8042_CMD_AUX_LOOP ) || param !=0x5a ) { + retval =i8042_command (¶m,I8042_CMD_AUX_LOOP ); +if (retval || param !=0x5a ) {/* * External connection test - filters out AT-soldered PS/2 i8042's
@@ -572,6 +574,13 @@ static int __devinit i8042_check_aux(void)if (i8042_command (¶m,I8042_CMD_AUX_TEST ) || (param && param !=0xfa && param !=0xff ))return -1 ; + +/* +* If AUX_LOOP completed without error but returned unexpected data +* mark it as broken +*/ +if (!retval) + aux_loop_broken =1 ; }/*
@@ -595,7 +604,7 @@ static int __devinit i8042_check_aux(void)* used it for a PCI card or somethig else. */ -if (i8042_noloop) { +if (i8042_noloop || aux_loop_broken) {/* * Without LOOP command we can't test AUX IRQ delivery. Assume the port * is working and hope we are right.
@@ -838,13 +847,14 @@ static long i8042_panic_blink(long count) led ^=0x01 |0x04 ;while (i8042_read_status () &I8042_STR_IBF )DELAY ; - i8042_suppress_kbd_ack =1 ; +dbg ("%02x -> i8042 (panic blink)" ,0xed ); + i8042_suppress_kbd_ack =2 ;i8042_write_data (0xed );/* set leds */ DELAY ;while (i8042_read_status () &I8042_STR_IBF )DELAY ;DELAY ; - i8042_suppress_kbd_ack =1 ; +dbg ("%02x -> i8042 (panic blink)" , led);i8042_write_data (led);DELAY ; last_blink = count;
drivers/md/linear.c +1 -1
@@ -188,7 +188,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)for (i=0 ; i < cnt-1 ; i++) {sector_t sz =0 ;int j; -for (j=i; i<cnt-1 && sz < min_spacing ; j++) +for (j = i; j < cnt -1 && sz < min_spacing; j++) sz += conf->disks[j].size;if (sz >= min_spacing && sz < conf->hash_spacing) conf->hash_spacing = sz;
drivers/net/r8169.c +5 -5
@@ -1369,11 +1369,7 @@ static inline void rtl8169_request_timer(struct net_device *dev) (tp->phy_version >= RTL_GIGA_PHY_VER_H))return ; -init_timer (timer); - timer->expires = jiffies +RTL8169_PHY_TIMEOUT ; - timer->data = (unsigned long )(dev); - timer->function = rtl8169_phy_timer; -add_timer (timer); +mod_timer (timer, jiffies +RTL8169_PHY_TIMEOUT ); }#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -1686,6 +1682,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) tp->mmio_addr = ioaddr; tp->align = rtl_cfg_info[ent->driver_data].align; +init_timer (&tp->timer); + tp->timer.data = (unsigned long ) dev; + tp->timer.function = rtl8169_phy_timer; +spin_lock_init (&tp->lock); rc =register_netdev (dev);
drivers/pci/probe.c +32 -13
59 lines not on this page · raw message
drivers/scsi/gdth.c +2 -0
@@ -3092,6 +3092,7 @@ static int gdth_fill_raw_cmd(int hanum,Scsi_Cmnd *scp,unchar b) cmdp->u.raw64.direction = gdth_direction_tab[scp->cmnd[0 ]]==DOU ?GDTH_DATA_OUT :GDTH_DATA_IN ;memcpy (cmdp->u.raw64.cmd,scp->cmnd,16 ); + cmdp->u.raw64.sg_ranz =0 ; }else { cmdp->u.raw.reserved =0 ; cmdp->u.raw.mdisc_time =0 ;
@@ -3108,6 +3109,7 @@ static int gdth_fill_raw_cmd(int hanum,Scsi_Cmnd *scp,unchar b) cmdp->u.raw.direction = gdth_direction_tab[scp->cmnd[0 ]]==DOU ?GDTH_DATA_OUT :GDTH_DATA_IN ;memcpy (cmdp->u.raw.cmd,scp->cmnd,12 ); + cmdp->u.raw.sg_ranz =0 ; }if (scp->use_sg) {
drivers/scsi/st.c +13 -10
@@ -9,7 +9,7 @@ Steve Hirsch, Andreas Koppenh"ofer, Michael Leodolter, Eyal Lebedinsky, Michael Schaefer, J"org Weule, and Eric Youngdale. - Copyright 1992 - 2006 Kai Makisara + Copyright 1992 - 2007 Kai Makisara email [email protected] Some small formal changes - aeb, 950809
@@ -17,7 +17,7 @@Last modified: 18-JAN-1998 Richard Gooch <[email protected]> Devfs support */ -static const char *verstr ="20061107" ; +static const char *verstr ="20070203" ;#include <linux/module.h>
@@ -1168,6 +1168,7 @@ static int st_open(struct inode *inode, struct file *filp) STps = &(STp->ps[i]); STps->rw =ST_IDLE ; } + STp->try_dio_now = STp->try_dio; STp->recover_count =0 ; DEB( STp->nbr_waits = STp->nbr_finished = 0; STp->nbr_requests = STp->nbr_dio = STp->nbr_pages = STp->nbr_combinable = 0; )
@@ -1400,9 +1401,9 @@ static int setup_buffering(struct scsi_tape *STp, const char __user *buf,struct st_buffer *STbp = STp->buffer;if (is_read) - i = STp->try_dio && try_rdio; + i = STp->try_dio_now && try_rdio;else - i = STp->try_dio && try_wdio; + i = STp->try_dio_now && try_wdio;if (i && ((unsigned long )buf &queue_dma_alignment ( STp->device->request_queue)) ==0 ) {
@@ -1599,7 +1600,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) STm->do_async_writes && STps->eof <ST_EOM_OK ;if (STp->block_size !=0 && STm->do_buffer_writes && - !(STp->try_dio && try_wdio) && STps->eof <ST_EOM_OK && + !(STp->try_dio_now && try_wdio) && STps->eof <ST_EOM_OK && STbp->buffer_bytes < STbp->buffer_size) { STp->dirty =1 ;/* Don't write a buffer that is not full enough. */
@@ -1769,7 +1770,7 @@ static long read_tape(struct scsi_tape *STp, long count,if (STp->block_size ==0 ) blks = bytes = count;else { -if (!(STp->try_dio && try_rdio) && STm->do_read_ahead) { +if (!(STp->try_dio_now && try_rdio) && STm->do_read_ahead) { blks = (STp->buffer)->buffer_blocks; bytes = blks * STp->block_size; }else {
@@ -1948,10 +1949,12 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) goto out; STm = &(STp->modes[STp->current_mode]); -if (!(STm->do_read_ahead) && STp->block_size !=0 && - (count % STp->block_size) !=0 ) { - retval = (-EINVAL );/* Read must be integral number of blocks */ - goto out; +if (STp->block_size !=0 && (count % STp->block_size) !=0 ) { +if (!STm->do_read_ahead) { + retval = (-EINVAL );/* Read must be integral number of blocks */ + goto out; + } + STp->try_dio_now =0 ;/* Direct i/o can't handle split blocks */ } STps = &(STp->ps[STp->partition]);
drivers/scsi/st.h +2 -1
@@ -117,7 +117,8 @@ struct scsi_tape {unsigned char cln_sense_value;unsigned char cln_sense_mask;unsigned char use_pf;/* Set Page Format bit in all mode selects? */ -unsigned char try_dio;/* try direct i/o? */ +unsigned char try_dio;/* try direct i/o in general? */ +unsigned char try_dio_now;/* try direct i/o before next close? */ unsigned char c_algo;/* compression algorithm */ unsigned char pos_unknown;/* after reset position unknown */ int tape_type;
drivers/usb/host/ehci-hub.c +4 -0
@@ -134,6 +134,10 @@ static int ehci_bus_resume (struct usb_hcd *hcd)/* restore CMD_RUN, framelist size, and irq threshold */ writel (ehci->command, &ehci->regs->command); +/* Some controller/firmware combinations need a delay during which +* they set up the port statuses. See Bugzilla #8190. */ +mdelay (8 ); +/* manually resume the ports we suspended during bus_suspend() */ i =HCS_N_PORTS (ehci->hcs_params);while (i--) {
fs/nfs/inode.c +2 -1
@@ -422,7 +422,8 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)int err;/* Flush out writes to the server in order to update c/mtime */ -nfs_sync_mapping_range (inode->i_mapping,0 ,0 ,FLUSH_NOCOMMIT ); +if (S_ISREG (inode->i_mode)) +nfs_sync_mapping_range (inode->i_mapping,0 ,0 ,FLUSH_NOCOMMIT );/* * We may force a getattr if the user cares about atime.
include/asm-sparc64/tsb.h +2 -0
@@ -264,6 +264,7 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end; be,a,pt %xcc,OK_LABEL ; \mov REG4 ,REG1 ; +#ifndef CONFIG_DEBUG_PAGEALLOC /* This version uses a trick, the TAG is already (VADDR >> 22) so * we can make use of that for the index computation. */
@@ -277,5 +278,6 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end;cmp REG3 ,TAG ; \ be,a,pt %xcc,OK_LABEL ; \mov REG4 ,REG1 ; +#endif #endif /* !(_SPARC64_TSB_H) */
include/asm-um/processor-x86_64.h +4 -2
@@ -13,6 +13,7 @@struct arch_thread {unsigned long debugregs[8 ];int debugregs_seq; +unsigned long fs;struct faultinfo faultinfo; };
@@ -25,8 +26,9 @@ extern inline void rep_nop(void)#define cpu_relax () rep_nop()#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ - .debugregs_seq = 0, \ - .faultinfo = { 0, 0, 0 } } + .debugregs_seq = 0, \ + .fs = 0, \ + .faultinfo = { 0, 0, 0 } }static inline void arch_flush_thread (struct arch_thread *thread) {
include/asm-um/ptrace-x86_64.h +2 -4
@@ -81,9 +81,7 @@ static inline void arch_switch_to_tt(struct task_struct *from, { } -static inline void arch_switch_to_skas (struct task_struct *from, -struct task_struct *to) -{ -} +extern void arch_switch_to_skas (struct task_struct *from, +struct task_struct *to);#endif
include/linux/ktime.h +5 -1
@@ -57,7 +57,11 @@ typedef union { } ktime_t;#define KTIME_MAX ((s64)~((u64)1 << 63)) -#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) +#if (BITS_PER_LONG ==64 ) +# define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) +#else +# define KTIME_SEC_MAX LONG_MAX +#endif /* * ktime_t definitions when using the 64-bit scalar representation:
kernel/auditsc.c +11 -13
@@ -734,28 +734,26 @@ static inline void audit_free_context(struct audit_context *context)void audit_log_task_context (struct audit_buffer *ab) {char *ctx =NULL ; -ssize_t len =0 ; +unsigned len; +int error; +u32 sid; + +selinux_get_task_sid (current, &sid); +if (!sid) +return ; - len =security_getprocattr (current,"current" ,NULL ,0 ); -if (len <0 ) { -if (len != -EINVAL ) + error =selinux_sid_to_string (sid, &ctx, &len); +if (error) { +if (error != -EINVAL ) goto error_path;return ; } - ctx =kmalloc (len,GFP_KERNEL ); -if (!ctx) - goto error_path; - - len =security_getprocattr (current,"current" , ctx, len); -if (len <0 ) - goto error_path; -audit_log_format (ab," subj=%s" , ctx); +kfree (ctx);return ; error_path: -kfree (ctx);audit_panic ("error in audit_log_task_context" );return ; }
kernel/fork.c +1 -1
@@ -933,8 +933,8 @@ asmlinkage long sys_set_tid_address(int __user *tidptr)static inline void rt_mutex_init_task (struct task_struct *p) { -#ifdef CONFIG_RT_MUTEXES spin_lock_init (&p->pi_lock); +#ifdef CONFIG_RT_MUTEXES plist_head_init (&p->pi_waiters, &p->pi_lock); p->pi_blocked_on =NULL ;#endif
kernel/futex.c +2 -0
@@ -565,6 +565,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)if (!pi_state)return -EINVAL ; +spin_lock (&pi_state->pi_mutex.wait_lock); new_owner =rt_mutex_next_owner (&pi_state->pi_mutex);/*
@@ -604,6 +605,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) pi_state->owner = new_owner;spin_unlock_irq (&new_owner->pi_lock); +spin_unlock (&pi_state->pi_mutex.wait_lock);rt_mutex_unlock (&pi_state->pi_mutex);return 0 ;
kernel/hrtimer.c +6 -0
@@ -332,6 +332,12 @@ hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) orun++; } timer->expires =ktime_add (timer->expires, interval); +/* +* Make sure, that the result did not wrap with a very large +* interval. +*/ +if (timer->expires.tv64 <0 ) + timer->expires =ktime_set (KTIME_SEC_MAX ,0 );return orun; }
mm/filemap.c +35 -11
65 lines not on this page · raw message
mm/madvise.c +4 -1
@@ -155,11 +155,14 @@ static long madvise_dontneed(struct vm_area_struct * vma,* Other filesystems return -ENOSYS. */ static long madvise_remove (struct vm_area_struct *vma, +struct vm_area_struct **prev,unsigned long start,unsigned long end) {struct address_space *mapping;loff_t offset, endoff; + *prev = vma; +if (vma->vm_flags & (VM_LOCKED |VM_NONLINEAR |VM_HUGETLB ))return -EINVAL ;
@@ -199,7 +202,7 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev, error =madvise_behavior (vma, prev, start, end, behavior);break ;case MADV_REMOVE : - error =madvise_remove (vma, start, end); + error =madvise_remove (vma, prev, start, end);break ;case MADV_WILLNEED :
mm/oom_kill.c +1 -1
@@ -320,7 +320,7 @@ static int oom_kill_task(struct task_struct *p)* Don't kill the process if any threads are set to OOM_DISABLE */ do_each_thread(g, q) { -if (q->mm == mm && p->oomkilladj ==OOM_DISABLE ) +if (q->mm == mm && q->oomkilladj ==OOM_DISABLE )return 1 ; }while_each_thread (g, q);
net/core/skbuff.c +1 -0
@@ -464,6 +464,7 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask)memcpy (n->cb, skb->cb,sizeof (skb->cb));C (len);C (data_len); +C (mac_len);C (csum);C (local_df); n->cloned =1 ;
net/ipv4/cipso_ipv4.c +4 -3
@@ -732,11 +732,12 @@ static int cipso_v4_map_lvl_hton(const struct cipso_v4_doi *doi_def, *net_lvl = host_lvl;return 0 ;case CIPSO_V4_MAP_STD : -if (host_lvl < doi_def->map.std->lvl.local_size) { +if (host_lvl < doi_def->map.std->lvl.local_size && + doi_def->map.std->lvl.local[host_lvl] <CIPSO_V4_INV_LVL ) { *net_lvl = doi_def->map.std->lvl.local[host_lvl];return 0 ; } -break ; +return -EPERM ; }return -EINVAL ;
@@ -771,7 +772,7 @@ static int cipso_v4_map_lvl_ntoh(const struct cipso_v4_doi *doi_def, *host_lvl = doi_def->map.std->lvl.cipso[net_lvl];return 0 ; } -break ; +return -EPERM ; }return -EINVAL ;
net/ipv4/devinet.c +3 -1
@@ -503,8 +503,10 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh) goto errout; ifm =nlmsg_data (nlh); -if (ifm->ifa_prefixlen >32 || tb[IFA_LOCAL ] ==NULL ) +if (ifm->ifa_prefixlen >32 || tb[IFA_LOCAL ] ==NULL ) { + err = -EINVAL ; goto errout; + } dev =__dev_get_by_index (ifm->ifa_index);if (dev ==NULL ) {
net/ipv4/fib_trie.c +0 -2
@@ -1528,7 +1528,6 @@ static int trie_leaf_remove(struct trie *t, t_key key) t->revision++; t->size--; -preempt_disable (); tp =NODE_PARENT (n);tnode_free ((struct tnode *) n);
@@ -1538,7 +1537,6 @@ static int trie_leaf_remove(struct trie *t, t_key key)rcu_assign_pointer (t->trie,trie_rebalance (t, tp)); }else rcu_assign_pointer (t->trie,NULL ); -preempt_enable ();return 1 ; }
net/ipv6/ipv6_sockglue.c +1 -1
@@ -414,7 +414,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, }/* routing header option needs extra check */ -if (optname ==IPV6_RTHDR && opt->srcrt) { +if (optname ==IPV6_RTHDR && opt && opt->srcrt) {struct ipv6_rt_hdr *rthdr = opt->srcrt;switch (rthdr->type) {case IPV6_SRCRT_TYPE_0 :
net/ipv6/tcp_ipv6.c +1 -0
@@ -1453,6 +1453,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,First: no IPv4 options. */ newinet->opt =NULL ; + newnp->ipv6_fl_list =NULL ;/* Clone RX bits */ newnp->rxopt.all = np->rxopt.all;
net/irda/irttp.c +1 -0
@@ -1455,6 +1455,7 @@ struct tsap_cb *irttp_dup(struct tsap_cb *orig, void *instance)/* Not everything should be copied */ new->notify.instance = instance; +spin_lock_init (&new->lock);init_timer (&new->todo_timer);skb_queue_head_init (&new->rx_queue);
net/netfilter/nfnetlink_log.c +2 -6
@@ -218,10 +218,8 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock)spin_lock_bh (&inst->lock);if (inst->skb) {/* timer "holds" one reference (we have one more) */ -if (timer_pending (&inst->timer)) { -del_timer (&inst->timer); +if (del_timer (&inst->timer))instance_put (inst); - }if (inst->qlen)__nfulnl_send (inst);if (inst->skb) {
@@ -695,10 +693,8 @@ nfulnl_log_packet(unsigned int pf,UDEBUG ("flushing old skb\n" );/* timer "holds" one reference (we have another one) */ -if (timer_pending (&inst->timer)) { -del_timer (&inst->timer); +if (del_timer (&inst->timer))instance_put (inst); - }__nfulnl_send (inst);if (!(inst->skb =nfulnl_alloc_skb (nlbufsiz, size))) {
net/xfrm/xfrm_state.c +4 -2
@@ -707,7 +707,8 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re x->props.mode != mode || x->props.family != family || x->km.state !=XFRM_STATE_ACQ || - x->id.spi != 0) + x->id.spi !=0 || + x->id.proto != proto) continue;switch (family) {
@@ -804,7 +805,8 @@ int xfrm_state_add(struct xfrm_state *x)if (use_spi && x->km.seq) { x1 =__xfrm_find_acq_byseq (x->km.seq); -if (x1 &&xfrm_addr_cmp (&x1->id.daddr, &x->id.daddr, family)) { +if (x1 && ((x1->id.proto != x->id.proto) || +xfrm_addr_cmp (&x1->id.daddr, &x->id.daddr, family))) {xfrm_state_put (x1); x1 =NULL ; }
sound/pci/hda/hda_intel.c +11 -2
@@ -199,7 +199,6 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };/* STATESTS int mask: SD2,SD1,SD0 */ #define STATESTS_INT_MASK 0x07 -#define AZX_MAX_CODECS 3/* SD_CTL bits */ #define SD_CTL_STREAM_RESET 0x01/* stream reset bit */
@@ -966,6 +965,16 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev)* Codec initialization */ +static unsigned int azx_max_codecs[]__devinitdata = { + [AZX_DRIVER_ICH ] =3 , + [AZX_DRIVER_ATI ] =4 , + [AZX_DRIVER_ATIHDMI ] =4 , + [AZX_DRIVER_VIA ] =3 ,/* FIXME: correct? */ + [AZX_DRIVER_SIS ] =3 ,/* FIXME: correct? */ + [AZX_DRIVER_ULI ] =3 ,/* FIXME: correct? */ + [AZX_DRIVER_NVIDIA ] =3 ,/* FIXME: correct? */ +}; +static int __devinit azx_codec_create (struct azx *chip,const char *model) {struct hda_bus_template bus_temp;
@@ -982,7 +991,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model)return err; codecs =0 ; -for (c =0 ; c <AZX_MAX_CODECS ; c++) { +for (c =0 ; c < azx_max_codecs[chip->driver_type]; c++) {if ((chip->codec_mask & (1 << c)) & probe_mask) { err =snd_hda_codec_new (chip->bus, c,NULL );if (err <0 )