Linux 3.13.11
Greg KH
maintainerNOTE
This is the LAST 3.13.y release. It is now end-of-life. Please move to 3.14.y now.
-----------
I'm announcing the release of the 3.13.11 kernel.
All users of the 3.13 kernel series must upgrade.
The updated 3.13.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.13.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 - arch/sparc/Kconfig | 2 - arch/sparc/kernel/process_64.c | 4 ++- arch/sparc/kernel/syscalls.S | 4 +-- arch/x86/kernel/cpu/mshyperv.c | 6 ++++ arch/x86/kernel/early-quirks.c | 15 ++++------- drivers/acpi/button.c | 4 +++ drivers/char/ipmi/ipmi_bt_sm.c | 2 - drivers/pci/host/pcie-designware.c | 8 +++--- drivers/pci/pci.c | 3 ++ drivers/scsi/sd.c | 4 +-- drivers/staging/comedi/drivers/8255_pci.c | 34 +++++++++++++++++++++++++ drivers/tty/ipwireless/tty.c | 3 -- drivers/tty/tty_buffer.c | 20 +++------------ drivers/tty/tty_io.c | 23 ++++++++++++----- drivers/usb/gadget/u_serial.c | 4 +-- fs/btrfs/disk-io.c | 4 +++ fs/btrfs/transaction.c | 14 +++------- fs/ext4/extents.c | 40 ++++++++++++++++++++++++++---- fs/fs-writeback.c | 31 ++++++++++++++++------- fs/jffs2/compr_rtime.c | 4 +-- fs/jffs2/nodelist.h | 2 - fs/jffs2/nodemgmt.c | 14 +++++++--- fs/xfs/xfs_da_btree.c | 2 - include/linux/backing-dev.h | 2 - include/linux/tty.h | 2 - kernel/exit.c | 21 +++++++++------ kernel/pid_namespace.c | 4 ++- kernel/user_namespace.c | 11 +++----- mm/backing-dev.c | 16 +++++++++--- net/bluetooth/hci_event.c | 8 +++++- security/integrity/ima/ima.h | 2 - security/integrity/ima/ima_fs.c | 2 + security/integrity/ima/ima_template_lib.c | 10 +++++-- 34 files changed, 221 insertions(+), 106 deletions(-)
Ajesh Kunhipurayil Vijayan (1):
jffs2: Fix crash due to truncation of csize
Alan Stern (1):
SCSI: sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE
Bjorn Helgaas (1):
PCI: Enable INTx in pci_reenable_device() only when MSI/MSI-X not enabled
Claudio Takahasi (1):
Bluetooth: Fix removing Long Term Key
Dave Kleikamp (1):
sparc64: don't treat 64-bit syscall return codes as 32-bit
David S. Miller (1):
sparc64: Make sure %pil interrupts are enabled during hypervisor yield.
Derek Basehore (1):
backing_dev: fix hung task on sync
Eric Whitney (3):
ext4: fix error return from ext4_ext_handle_uninitialized_extents()
ext4: fix partial cluster handling for bigalloc file systems
ext4: fix premature freeing of partial clusters split across leaf blocks
Greg Kroah-Hartman (1):
Linux 3.13.11
Hannes Reinecke (1):
tty: Set correct tty name in 'active' sysfs attribute
Hidetoshi Seto (1):
Btrfs: skip submitting barrier for missing device
Ian Abbott (1):
staging: comedi: 8255_pci: initialize MITE data window
Jan Kara (1):
bdi: avoid oops on device removal
Jason Wang (1):
x86, hyperv: Bypass the timer_irq_works() check
Jiri Slaby (1):
Char: ipmi_bt_sm, fix infinite loop
Josef Bacik (1):
Btrfs: fix deadlock with nested trans handles
Kamlakant Patel (1):
jffs2: Fix segmentation fault found in stress test
Lan Tianyu (1):
ACPI / button: Add ACPI Button event via netlink routine
Li Zefan (2):
jffs2: avoid soft-lockup in jffs2_reserve_space_gc()
jffs2: remove from wait queue after schedule()
Mark Tinguely (1):
xfs: fix directory hash ordering bug
Mikulas Patocka (1):
user namespace: fix incorrect memory barriers
Mohit Kumar (2):
PCI: designware: Fix RC BAR to be single 64-bit non-prefetchable memory BAR
PCI: designware: Fix iATU programming for cfg1, io and mem viewport
Neil Horman (1):
x86: Adjust irq remapping quirk for older revisions of 5500/5520 chipsets
Oleg Nesterov (3):
pid_namespace: pidns_get() should check task_active_pid_ns() != NULL
wait: fix reparent_leader() vs EXIT_DEAD->EXIT_ZOMBIE race
exit: call disassociate_ctty() before exit_task_namespaces()Paul Gortmaker (1):
sparc32: fix build failure for arch_jump_label_transform
Peter Hurley (1):
tty: Fix low_latency BUG
Roberto Sassu (1):
ima: restore the original behavior for sending data with ima template
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 13 -SUBLEVEL = 10 +SUBLEVEL = 11 EXTRAVERSION = NAME = One Giant Leap for Frogkind
arch/sparc/Kconfig +1 -1
@@ -26,7 +26,7 @@ config SPARC select RTC_DRV_M48T59 select HAVE_DMA_ATTRS select HAVE_DMA_API_DEBUG - select HAVE_ARCH_JUMP_LABEL + select HAVE_ARCH_JUMP_LABEL if SPARC64 select GENERIC_IRQ_SHOW select ARCH_WANT_IPC_PARSE_VERSION select GENERIC_PCI_IOMAP
arch/sparc/kernel/process_64.c +3 -1
@@ -58,9 +58,12 @@ void arch_cpu_idle(void) {if (tlb_type != hypervisor) {touch_nmi_watchdog (); +local_irq_enable (); }else {unsigned long pstate; +local_irq_enable (); +/* The sun4v sleeping code requires that we have PSTATE.IE cleared over * the cpu sleep hypervisor call. */
@@ -82,7 +85,6 @@ void arch_cpu_idle(void) : "=&r" (pstate) : "i" (PSTATE_IE)); } -local_irq_enable (); }#ifdef CONFIG_HOTPLUG_CPU
arch/sparc/kernel/syscalls.S +2 -2
@@ -189,7 +189,8 @@ linux_sparc_syscall32: mov %i0, %l5 ! IEU1 5: call %l7 ! CTI Group brk forced srl %i5, 0, %o5 ! IEU1 - ba,a,pt %xcc, 3f + ba,pt %xcc, 3f + sra %o0, 0, %o0 /* Linux native system calls enter here... */ .align 32
@@ -217,7 +218,6 @@ linux_sparc_syscall: 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] ret_sys_call: ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 - sra %o0, 0, %o0 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 sllx %g2, 32, %g2
arch/x86/kernel/cpu/mshyperv.c +6 -0
@@ -26,6 +26,7 @@#include <asm/irq_regs.h> #include <asm/i8259.h> #include <asm/apic.h> +#include <asm/timer.h> struct ms_hyperv_info ms_hyperv;EXPORT_SYMBOL_GPL (ms_hyperv);
@@ -105,6 +106,11 @@ static void __init ms_hyperv_init_platform(void)if (ms_hyperv.features &HV_X64_MSR_TIME_REF_COUNT_AVAILABLE )clocksource_register_hz (&hyperv_cs,NSEC_PER_SEC /100 ); + +#ifdef CONFIG_X86_IO_APIC + no_timer_check =1 ; +#endif + }const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
arch/x86/kernel/early-quirks.c +6 -9
@@ -203,18 +203,15 @@ static void __init intel_remapping_check(int num, int slot, int func) revision =read_pci_config_byte (num, slot, func,PCI_REVISION_ID );/* -* Revision 13 of all triggering devices id in this quirk have -* a problem draining interrupts when irq remapping is enabled, -* and should be flagged as broken. Additionally revisions 0x12 -* and 0x22 of device id 0x3405 has this problem. +* Revision <= 13 of all triggering devices id in this quirk +* have a problem draining interrupts when irq remapping is +* enabled, and should be flagged as broken. Additionally +* revision 0x22 of device id 0x3405 has this problem. */ -if (revision ==0x13 ) +if (revision <=0x13 )set_irq_remapping_broken (); -else if ((device ==0x3405 ) && - ((revision ==0x12 ) || - (revision ==0x22 ))) +else if (device ==0x3405 && revision ==0x22 )set_irq_remapping_broken (); - }/*
drivers/acpi/button.c +4 -0
@@ -302,6 +302,10 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)input_sync (input);pm_wakeup_event (&device->dev,0 ); +acpi_bus_generate_netlink_event ( + device->pnp.device_class, +dev_name (&device->dev), + event, ++button->pushed); }break ;default :
drivers/char/ipmi/ipmi_bt_sm.c +1 -1
@@ -352,7 +352,7 @@ static inline void write_all_bytes(struct si_sm_data *bt)static inline int read_all_bytes (struct si_sm_data *bt) { -unsigned char i; +unsigned int i;/* * length is "framing info", minimum = 4: NetFn, Seq, Cmd, cCode.
drivers/pci/host/pcie-designware.c +4 -4
@@ -498,13 +498,13 @@ static void dw_pcie_prog_viewport_cfg1(struct pcie_port *pp, u32 busdev)dw_pcie_writel_rc (pp,PCIE_ATU_REGION_OUTBOUND |PCIE_ATU_REGION_INDEX1 ,PCIE_ATU_VIEWPORT );dw_pcie_writel_rc (pp,PCIE_ATU_TYPE_CFG1 ,PCIE_ATU_CR1 ); -dw_pcie_writel_rc (pp,PCIE_ATU_ENABLE ,PCIE_ATU_CR2 );dw_pcie_writel_rc (pp, pp->cfg1_base,PCIE_ATU_LOWER_BASE );dw_pcie_writel_rc (pp, (pp->cfg1_base >>32 ),PCIE_ATU_UPPER_BASE );dw_pcie_writel_rc (pp, pp->cfg1_base + pp->config.cfg1_size -1 ,PCIE_ATU_LIMIT );dw_pcie_writel_rc (pp, busdev,PCIE_ATU_LOWER_TARGET );dw_pcie_writel_rc (pp,0 ,PCIE_ATU_UPPER_TARGET ); +dw_pcie_writel_rc (pp,PCIE_ATU_ENABLE ,PCIE_ATU_CR2 ); }static void dw_pcie_prog_viewport_mem_outbound (struct pcie_port *pp)
@@ -513,7 +513,6 @@ static void dw_pcie_prog_viewport_mem_outbound(struct pcie_port *pp)dw_pcie_writel_rc (pp,PCIE_ATU_REGION_OUTBOUND |PCIE_ATU_REGION_INDEX0 ,PCIE_ATU_VIEWPORT );dw_pcie_writel_rc (pp,PCIE_ATU_TYPE_MEM ,PCIE_ATU_CR1 ); -dw_pcie_writel_rc (pp,PCIE_ATU_ENABLE ,PCIE_ATU_CR2 );dw_pcie_writel_rc (pp, pp->mem_base,PCIE_ATU_LOWER_BASE );dw_pcie_writel_rc (pp, (pp->mem_base >>32 ),PCIE_ATU_UPPER_BASE ); dw_pcie_writel_rc(pp, pp->mem_base + pp->config.mem_size - 1,
@@ -521,6 +520,7 @@ static void dw_pcie_prog_viewport_mem_outbound(struct pcie_port *pp)dw_pcie_writel_rc (pp, pp->config.mem_bus_addr,PCIE_ATU_LOWER_TARGET );dw_pcie_writel_rc (pp,upper_32_bits (pp->config.mem_bus_addr),PCIE_ATU_UPPER_TARGET ); +dw_pcie_writel_rc (pp,PCIE_ATU_ENABLE ,PCIE_ATU_CR2 ); }static void dw_pcie_prog_viewport_io_outbound (struct pcie_port *pp)
@@ -529,7 +529,6 @@ static void dw_pcie_prog_viewport_io_outbound(struct pcie_port *pp)dw_pcie_writel_rc (pp,PCIE_ATU_REGION_OUTBOUND |PCIE_ATU_REGION_INDEX1 ,PCIE_ATU_VIEWPORT );dw_pcie_writel_rc (pp,PCIE_ATU_TYPE_IO ,PCIE_ATU_CR1 ); -dw_pcie_writel_rc (pp,PCIE_ATU_ENABLE ,PCIE_ATU_CR2 );dw_pcie_writel_rc (pp, pp->io_base,PCIE_ATU_LOWER_BASE );dw_pcie_writel_rc (pp, (pp->io_base >>32 ),PCIE_ATU_UPPER_BASE ); dw_pcie_writel_rc(pp, pp->io_base + pp->config.io_size - 1,
@@ -537,6 +536,7 @@ static void dw_pcie_prog_viewport_io_outbound(struct pcie_port *pp)dw_pcie_writel_rc (pp, pp->config.io_bus_addr,PCIE_ATU_LOWER_TARGET );dw_pcie_writel_rc (pp,upper_32_bits (pp->config.io_bus_addr),PCIE_ATU_UPPER_TARGET ); +dw_pcie_writel_rc (pp,PCIE_ATU_ENABLE ,PCIE_ATU_CR2 ); } static int dw_pcie_rd_other_conf(struct pcie_port *pp, struct pci_bus *bus,
@@ -773,7 +773,7 @@ void dw_pcie_setup_rc(struct pcie_port *pp)/* setup RC BARs */ dw_pcie_writel_rc (pp,0x00000004 ,PCI_BASE_ADDRESS_0 ); -dw_pcie_writel_rc (pp,0x00000004 ,PCI_BASE_ADDRESS_1 ); +dw_pcie_writel_rc (pp,0x00000000 ,PCI_BASE_ADDRESS_1 );/* setup interrupt pins */ dw_pcie_readl_rc (pp,PCI_INTERRUPT_LINE , &val);
drivers/pci/pci.c +3 -0
@@ -1134,6 +1134,9 @@ static int do_pci_enable_device(struct pci_dev *dev, int bars)if (dev->msi_enabled || dev->msix_enabled)return 0 ; +if (dev->msi_enabled || dev->msix_enabled) +return 0 ; +pci_read_config_byte (dev,PCI_INTERRUPT_PIN , &pin);if (pin) {pci_read_config_word (dev,PCI_COMMAND , &cmd);
drivers/scsi/sd.c +2 -2
@@ -1463,8 +1463,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp)sd_print_sense_hdr (sdkp, &sshdr);/* we need to evaluate the error return */ if (scsi_sense_valid (&sshdr) && -/* 0x3a is medium not present */ - sshdr.asc ==0x3a ) + (sshdr.asc ==0x3a ||/* medium not present */ + sshdr.asc ==0x20 ))/* invalid command */ /* this is no error here */ return 0 ;
drivers/staging/comedi/drivers/8255_pci.c +34 -0
@@ -56,6 +56,7 @@ Configuration Options: not applicable, uses PCI auto config#include "../comedidev.h" #include "8255.h" +#include "mite.h" enum pci_8255_boardid {BOARD_ADLINK_PCI7224 ,
@@ -79,6 +80,7 @@ struct pci_8255_boardinfo {const char *name;int dio_badr;int n_8255; + unsigned int has_mite:1; };static const struct pci_8255_boardinfo pci_8255_boards[] = {
@@ -126,36 +128,43 @@ static const struct pci_8255_boardinfo pci_8255_boards[] = { .name = "ni_pci-dio-96", .dio_badr = 1, .n_8255 = 4, + .has_mite = 1, }, [BOARD_NI_PCIDIO96B] = { .name = "ni_pci-dio-96b", .dio_badr = 1, .n_8255 = 4, + .has_mite = 1, }, [BOARD_NI_PXI6508] = { .name = "ni_pxi-6508", .dio_badr = 1, .n_8255 = 4, + .has_mite = 1, }, [BOARD_NI_PCI6503] = { .name = "ni_pci-6503", .dio_badr = 1, .n_8255 = 1, + .has_mite = 1, }, [BOARD_NI_PCI6503B] = { .name = "ni_pci-6503b", .dio_badr = 1, .n_8255 = 1, + .has_mite = 1, }, [BOARD_NI_PCI6503X] = { .name = "ni_pci-6503x", .dio_badr = 1, .n_8255 = 1, + .has_mite = 1, }, [BOARD_NI_PXI_6503] = { .name = "ni_pxi-6503", .dio_badr = 1, .n_8255 = 1, + .has_mite = 1, }, };
@@ -163,6 +172,25 @@ struct pci_8255_private {void __iomem *mmio_base; }; +static int pci_8255_mite_init (struct pci_dev *pcidev) +{ +void __iomem *mite_base; +u32 main_phys_addr; + +/* ioremap the MITE registers (BAR 0) temporarily */ + mite_base =pci_ioremap_bar (pcidev,0 ); +if (!mite_base) +return -ENOMEM ; + +/* set data window to main registers (BAR 1) */ + main_phys_addr =pci_resource_start (pcidev,1 ); +writel (main_phys_addr |WENAB , mite_base +MITE_IODWBSR ); + +/* finished with MITE registers */ +iounmap (mite_base); +return 0 ; +} +static int pci_8255_mmio (int dir,int port,int data,unsigned long iobase) {void __iomem *mmio_base = (void __iomem *)iobase;
@@ -201,6 +229,12 @@ static int pci_8255_auto_attach(struct comedi_device *dev,if (ret)return ret; +if (board->has_mite) { + ret =pci_8255_mite_init (pcidev); +if (ret) +return ret; + } + is_mmio = (pci_resource_flags (pcidev, board->dio_badr) &IORESOURCE_MEM ) !=0 ;if (is_mmio) {
drivers/tty/ipwireless/tty.c +0 -3
@@ -177,9 +177,6 @@ void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data,": %d chars not inserted to flip buffer!\n" , length - work); -/* -* This may sleep if ->low_latency is set -*/ if (work)tty_flip_buffer_push (&tty->port); }
drivers/tty/tty_buffer.c +4 -16
@@ -332,14 +332,11 @@ EXPORT_SYMBOL(tty_insert_flip_string_flags);* Takes any pending buffers and transfers their ownership to the * ldisc side of the queue. It then schedules those characters for * processing by the line discipline. -* Note that this function can only be used when the low_latency flag -* is unset. Otherwise the workqueue won't be flushed. */ void tty_schedule_flip (struct tty_port *port) {struct tty_bufhead *buf = &port->buf; -WARN_ON (port->low_latency); buf->tail->commit = buf->tail->used;schedule_work (&buf->work);
@@ -487,17 +484,15 @@ static void flush_to_ldisc(struct work_struct *work)*/ void tty_flush_to_ldisc (struct tty_struct *tty) { -if (!tty->port->low_latency) -flush_work (&tty->port->buf.work); +flush_work (&tty->port->buf.work); }/** * tty_flip_buffer_push - terminal * @port: tty port to push * -* Queue a push of the terminal flip buffers to the line discipline. This -* function must not be called from IRQ context if port->low_latency is -* set. +* Queue a push of the terminal flip buffers to the line discipline. +* Can be called from IRQ/atomic context. * * In the event of the queue being busy for flipping the work will be * held off and retried later.
@@ -505,14 +500,7 @@ void tty_flush_to_ldisc(struct tty_struct *tty)void tty_flip_buffer_push (struct tty_port *port) { -struct tty_bufhead *buf = &port->buf; - - buf->tail->commit = buf->tail->used; - -if (port->low_latency) -flush_to_ldisc (&buf->work); -else -schedule_work (&buf->work); +tty_schedule_flip (port); }EXPORT_SYMBOL (tty_flip_buffer_push);
drivers/tty/tty_io.c +17 -6
@@ -1271,12 +1271,13 @@ static void pty_line_name(struct tty_driver *driver, int index, char *p)* * Locking: None */ -static void tty_line_name (struct tty_driver *driver,int index,char *p) +static ssize_t tty_line_name (struct tty_driver *driver,int index,char *p) {if (driver->flags &TTY_DRIVER_UNNUMBERED_NODE ) -strcpy (p, driver->name); +return sprintf (p,"%s" , driver->name);else -sprintf (p,"%s%d" , driver->name, index + driver->name_base); +return sprintf (p,"%s%d" , driver->name, + index + driver->name_base); }/**
@@ -3545,9 +3546,19 @@ static ssize_t show_cons_active(struct device *dev,if (i >=ARRAY_SIZE (cs))break ; } -while (i--) - count +=sprintf (buf + count,"%s%d%c" , - cs[i]->name, cs[i]->index, i ?' ' :'\n' ); +while (i--) { +int index = cs[i]->index; +struct tty_driver *drv = cs[i]->device (cs[i], &index); + +/* don't resolve tty0 as some programs depend on it */ +if (drv && (cs[i]->index >0 || drv->major !=TTY_MAJOR )) + count +=tty_line_name (drv, index, buf + count); +else + count +=sprintf (buf + count,"%s%d" , + cs[i]->name, cs[i]->index); + + count +=sprintf (buf + count,"%c" , i ?' ' :'\n' ); + }console_unlock ();return count;
drivers/usb/gadget/u_serial.c +2 -2
@@ -549,8 +549,8 @@ static void gs_rx_push(unsigned long _port) port->read_started--; } -/* Push from tty to ldisc; without low_latency set this is handled by -* a workqueue, so we won't get callbacks and can hold port_lock +/* Push from tty to ldisc; this is handled by a workqueue, +* so we won't get callbacks and can hold port_lock */ if (do_push)tty_flip_buffer_push (&port->port);
fs/btrfs/disk-io.c +4 -0
@@ -3238,6 +3238,8 @@ static int barrier_all_devices(struct btrfs_fs_info *info)/* send down all the barriers */ head = &info->fs_devices->devices;list_for_each_entry_rcu (dev, head, dev_list) { +if (dev->missing) +continue ;if (!dev->bdev) { errors_send++;continue ;
@@ -3252,6 +3254,8 @@ static int barrier_all_devices(struct btrfs_fs_info *info)/* wait for all the barriers */ list_for_each_entry_rcu (dev, head, dev_list) { +if (dev->missing) +continue ;if (!dev->bdev) { errors_wait++;continue ;
fs/btrfs/transaction.c +4 -10
@@ -685,7 +685,8 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,int lock = (trans->type !=TRANS_JOIN_NOLOCK );int err =0 ; -if (--trans->use_count) { +if (trans->use_count >1 ) { + trans->use_count--; trans->block_rsv = trans->orig_rsv;return 0 ; }
@@ -733,17 +734,10 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, }if (lock &&ACCESS_ONCE (cur_trans->state) ==TRANS_STATE_BLOCKED ) { -if (throttle) { -/* -* We may race with somebody else here so end up having -* to call end_transaction on ourselves again, so inc -* our use_count. -*/ - trans->use_count++; +if (throttle)return btrfs_commit_transaction (trans, root); - }else { +else wake_up_process (info->transaction_kthread); - } }if (trans->type & __TRANS_FREEZABLE)
fs/ext4/extents.c +35 -5
@@ -2585,6 +2585,27 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode, ex_ee_block =le32_to_cpu (ex->ee_block); ex_ee_len =ext4_ext_get_actual_len (ex); +/* +* If we're starting with an extent other than the last one in the +* node, we need to see if it shares a cluster with the extent to +* the right (towards the end of the file). If its leftmost cluster +* is this extent's rightmost cluster and it is not cluster aligned, +* we'll mark it as a partial that is not to be deallocated. +*/ + +if (ex !=EXT_LAST_EXTENT (eh)) { +ext4_fsblk_t current_pblk, right_pblk; +long long current_cluster, right_cluster; + + current_pblk =ext4_ext_pblock (ex) + ex_ee_len -1 ; + current_cluster = (long long )EXT4_B2C (sbi, current_pblk); + right_pblk =ext4_ext_pblock (ex +1 ); + right_cluster = (long long )EXT4_B2C (sbi, right_pblk); +if (current_cluster == right_cluster && +EXT4_PBLK_COFF (sbi, right_pblk)) + *partial_cluster = -right_cluster; + } +trace_ext4_ext_rm_leaf (inode, start, ex, *partial_cluster); while (ex >= EXT_FIRST_EXTENT(eh) &&
@@ -2710,10 +2731,15 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode, err =ext4_ext_correct_indexes (handle, inode, path);/* -* Free the partial cluster only if the current extent does not -* reference it. Otherwise we might free used cluster. +* If there's a partial cluster and at least one extent remains in +* the leaf, free the partial cluster if it isn't shared with the +* current extent. If there's a partial cluster and no extents +* remain in the leaf, it can't be freed here. It can only be +* freed when it's possible to determine if it's not shared with +* any other extent - when the next leaf is processed or when space +* removal is complete. */ -if (*partial_cluster >0 && +if (*partial_cluster >0 && eh->eh_entries && (EXT4_B2C (sbi,ext4_ext_pblock (ex) + ex_ee_len -1 ) != *partial_cluster)) {int flags =get_default_free_blocks_flags (inode);
@@ -4128,7 +4154,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,struct ext4_extent newex, *ex, *ex2;struct ext4_sb_info *sbi =EXT4_SB (inode->i_sb);ext4_fsblk_t newblock =0 ; -int free_on_err =0 , err =0 , depth; +int free_on_err =0 , err =0 , depth, ret;unsigned int allocated =0 , offset =0 ;unsigned int allocated_clusters =0 ;struct ext4_allocation_request ar;
@@ -4189,9 +4215,13 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,if (!ext4_ext_is_uninitialized (ex)) goto out; - allocated =ext4_ext_handle_uninitialized_extents ( + ret =ext4_ext_handle_uninitialized_extents ( handle, inode, map, path, flags, allocated, newblock); +if (ret <0 ) + err = ret; +else + allocated = ret; goto out3; } }
fs/fs-writeback.c +22 -9
@@ -89,16 +89,29 @@ static inline struct inode *wb_inode(struct list_head *head)#define CREATE_TRACE_POINTS #include <trace/events/writeback.h> +static void bdi_wakeup_thread (struct backing_dev_info *bdi) +{ +spin_lock_bh (&bdi->wb_lock); +if (test_bit (BDI_registered, &bdi->state)) +mod_delayed_work (bdi_wq, &bdi->wb.dwork,0 ); +spin_unlock_bh (&bdi->wb_lock); +} +static void bdi_queue_work (struct backing_dev_info *bdi,struct wb_writeback_work *work) {trace_writeback_queue (bdi, work);spin_lock_bh (&bdi->wb_lock); +if (!test_bit (BDI_registered, &bdi->state)) { +if (work->done) +complete (work->done); + goto out_unlock; + }list_add_tail (&work->list, &bdi->work_list); -spin_unlock_bh (&bdi->wb_lock); -mod_delayed_work (bdi_wq, &bdi->wb.dwork,0 ); +out_unlock: +spin_unlock_bh (&bdi->wb_lock); } static void
@@ -114,7 +127,7 @@ __bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages, work =kzalloc (sizeof (*work),GFP_ATOMIC );if (!work) {trace_writeback_nowork (bdi); -mod_delayed_work (bdi_wq, &bdi->wb.dwork,0 ); +bdi_wakeup_thread (bdi);return ; }
@@ -161,7 +174,7 @@ void bdi_start_background_writeback(struct backing_dev_info *bdi)* writeback as soon as there is no other work to do. */ trace_writeback_wake_background (bdi); -mod_delayed_work (bdi_wq, &bdi->wb.dwork,0 ); +bdi_wakeup_thread (bdi); }/*
@@ -1017,7 +1030,7 @@ void bdi_writeback_workfn(struct work_struct *work) current->flags |=PF_SWAPWRITE ;if (likely (!current_is_workqueue_rescuer () || -list_empty (&bdi->bdi_list))) { + !test_bit (BDI_registered, &bdi->state))) {/* * The normal path. Keep writing back @bdi until its * work_list is empty. Note that this path is also taken
@@ -1039,10 +1052,10 @@ void bdi_writeback_workfn(struct work_struct *work)trace_writeback_pages_written (pages_written); } -if (!list_empty (&bdi->work_list) || - (wb_has_dirty_io (wb) && dirty_writeback_interval)) -queue_delayed_work (bdi_wq, &wb->dwork, -msecs_to_jiffies (dirty_writeback_interval *10 )); +if (!list_empty (&bdi->work_list)) +mod_delayed_work (bdi_wq, &wb->dwork,0 ); +else if (wb_has_dirty_io (wb) && dirty_writeback_interval) +bdi_wakeup_thread_delayed (bdi); current->flags &= ~PF_SWAPWRITE ; }
fs/jffs2/compr_rtime.c +2 -2
@@ -33,7 +33,7 @@ static int jffs2_rtime_compress(unsigned char *data_in,unsigned char *cpage_out, uint32_t *sourcelen, uint32_t *dstlen) { - short positions[256]; + unsigned short positions[256];int outpos =0 ;int pos=0 ;
@@ -74,7 +74,7 @@ static int jffs2_rtime_decompress(unsigned char *data_in,unsigned char *cpage_out, uint32_t srclen, uint32_t destlen) { - short positions[256]; + unsigned short positions[256];int outpos =0 ;int pos=0 ;
fs/jffs2/nodelist.h +1 -1
@@ -231,7 +231,7 @@ struct jffs2_tmp_dnode_infouint32_t version;uint32_t data_crc;uint32_t partial_crc; -uint16_t csize; +uint32_t csize;uint16_t overlapped; };
fs/jffs2/nodemgmt.c +10 -4
@@ -179,6 +179,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,spin_unlock (&c->erase_completion_lock);schedule (); +remove_wait_queue (&c->erase_wait, &wait); }else spin_unlock (&c->erase_completion_lock); }else if (ret)
@@ -211,20 +212,25 @@ out:int jffs2_reserve_space_gc (struct jffs2_sb_info *c,uint32_t minsize,uint32_t *len,uint32_t sumsize) { -int ret = -EAGAIN ; +int ret; minsize =PAD (minsize);jffs2_dbg (1 ,"%s(): Requested 0x%x bytes\n" , __func__, minsize); -spin_lock (&c->erase_completion_lock); -while (ret == -EAGAIN ) { +while (true) { +spin_lock (&c->erase_completion_lock); ret =jffs2_do_reserve_space (c, minsize, len, sumsize);if (ret) {jffs2_dbg (1 ,"%s(): looping, ret is %d\n" , __func__, ret); } +spin_unlock (&c->erase_completion_lock); + +if (ret == -EAGAIN ) +cond_resched (); +else +break ; } -spin_unlock (&c->erase_completion_lock);if (!ret) ret =jffs2_prealloc_raw_node_refs (c, c->nextblock,1 );
fs/xfs/xfs_da_btree.c +1 -1
@@ -1295,7 +1295,7 @@ xfs_da3_fixhashpath( node = blk->bp->b_addr; dp->d_ops->node_hdr_from_disk (&nodehdr, node); btree = dp->d_ops->node_tree_p (node); -if (be32_to_cpu (btree->hashval) == lasthash) +if (be32_to_cpu (btree[blk->index].hashval) == lasthash)break ; blk->hashval = lasthash; btree[blk->index].hashval =cpu_to_be32 (lasthash);
include/linux/backing-dev.h +1 -1
@@ -95,7 +95,7 @@ struct backing_dev_info {unsigned int max_ratio, max_prop_frac;struct bdi_writeback wb;/* default writeback info for this bdi */ -spinlock_t wb_lock;/* protects work_list */ +spinlock_t wb_lock;/* protects work_list & wb.dwork scheduling */ struct list_head work_list;
include/linux/tty.h +1 -1
@@ -202,7 +202,7 @@ struct tty_port {wait_queue_head_t delta_msr_wait;/* Modem status change */ unsigned long flags;/* TTY flags ASY_*/ unsigned char console:1, /* port is a console */ - low_latency:1; /* direct buffer flush */ + low_latency:1; /* optional: tune for latency */struct mutex mutex;/* Locking */ struct mutex buf_mutex;/* Buffer alloc lock */ unsigned char *xmit_buf;/* Optional buffer */
kernel/exit.c +13 -8
@@ -559,9 +559,6 @@ static void reparent_leader(struct task_struct *father, struct task_struct *p, struct list_head *dead) {list_move_tail (&p->sibling, &p->real_parent->children); - -if (p->exit_state ==EXIT_DEAD ) -return ;/* * If this is a threaded reparent there is no need to * notify anyone anything has happened.
@@ -569,9 +566,19 @@ static void reparent_leader(struct task_struct *father, struct task_struct *p,if (same_thread_group (p->real_parent, father))return ; -/* We don't want people slaying init. */ +/* +* We don't want people slaying init. +* +* Note: we do this even if it is EXIT_DEAD, wait_task_zombie() +* can change ->exit_state to EXIT_ZOMBIE. If this is the final +* state, do_notify_parent() was already called and ->exit_signal +* doesn't matter. +*/ p->exit_signal =SIGCHLD ; +if (p->exit_state ==EXIT_DEAD ) +return ; +/* If it has exited notify the new parent about this child's death. */ if (!p->ptrace && p->exit_state ==EXIT_ZOMBIE &&thread_group_empty (p)) {
@@ -783,6 +790,8 @@ void do_exit(long code)exit_shm (tsk);exit_files (tsk);exit_fs (tsk); +if (group_dead) +disassociate_ctty (1 );exit_task_namespaces (tsk);exit_task_work (tsk);check_stack_usage ();
@@ -798,13 +807,9 @@ void do_exit(long code)cgroup_exit (tsk,1 ); -if (group_dead) -disassociate_ctty (1 ); -module_put (task_thread_info (tsk)->exec_domain->module);proc_exit_connector (tsk); -/* * FIXME: do that only when needed, using sched_exit tracepoint */
kernel/pid_namespace.c +3 -1
@@ -318,7 +318,9 @@ static void *pidns_get(struct task_struct *task)struct pid_namespace *ns;rcu_read_lock (); - ns =get_pid_ns (task_active_pid_ns (task)); + ns =task_active_pid_ns (task); +if (ns) +get_pid_ns (ns);rcu_read_unlock ();return ns;
kernel/user_namespace.c +5 -6
@@ -152,7 +152,7 @@ static u32 map_id_range_down(struct uid_gid_map *map, u32 id, u32 count)/* Find the matching extent */ extents = map->nr_extents; -smp_read_barrier_depends (); +smp_rmb ();for (idx =0 ; idx < extents; idx++) { first = map->extent[idx].first; last = first + map->extent[idx].count -1 ;
@@ -176,7 +176,7 @@ static u32 map_id_down(struct uid_gid_map *map, u32 id)/* Find the matching extent */ extents = map->nr_extents; -smp_read_barrier_depends (); +smp_rmb ();for (idx =0 ; idx < extents; idx++) { first = map->extent[idx].first; last = first + map->extent[idx].count -1 ;
@@ -199,7 +199,7 @@ static u32 map_id_up(struct uid_gid_map *map, u32 id)/* Find the matching extent */ extents = map->nr_extents; -smp_read_barrier_depends (); +smp_rmb ();for (idx =0 ; idx < extents; idx++) { first = map->extent[idx].lower_first; last = first + map->extent[idx].count -1 ;
@@ -615,9 +615,8 @@ static ssize_t map_write(struct file *file, const char __user *buf,* were written before the count of the extents. * * To achieve this smp_wmb() is used on guarantee the write -* order and smp_read_barrier_depends() is guaranteed that we -* don't have crazy architectures returning stale data. -* +* order and smp_rmb() is guaranteed that we don't have crazy +* architectures returning stale data. */ mutex_lock (&id_map_mutex);
mm/backing-dev.c +12 -4
@@ -288,13 +288,19 @@ int bdi_has_dirty_io(struct backing_dev_info *bdi)* Note, we wouldn't bother setting up the timer, but this function is on the * fast-path (used by '__mark_inode_dirty()'), so we save few context switches * by delaying the wake-up. +* +* We have to be careful not to postpone flush work if it is scheduled for +* earlier. Thus we use queue_delayed_work(). */ void bdi_wakeup_thread_delayed (struct backing_dev_info *bdi) {unsigned long timeout; timeout =msecs_to_jiffies (dirty_writeback_interval *10 ); -mod_delayed_work (bdi_wq, &bdi->wb.dwork, timeout); +spin_lock_bh (&bdi->wb_lock); +if (test_bit (BDI_registered, &bdi->state)) +queue_delayed_work (bdi_wq, &bdi->wb.dwork, timeout); +spin_unlock_bh (&bdi->wb_lock); }/*
@@ -307,9 +313,6 @@ static void bdi_remove_from_list(struct backing_dev_info *bdi)spin_unlock_bh (&bdi_lock);synchronize_rcu_expedited (); - -/* bdi_list is now unused, clear it to mark @bdi dying */ -INIT_LIST_HEAD (&bdi->bdi_list); } int bdi_register(struct backing_dev_info *bdi, struct device *parent,
@@ -360,6 +363,11 @@ static void bdi_wb_shutdown(struct backing_dev_info *bdi)*/ bdi_remove_from_list (bdi); +/* Make sure nobody queues further work */ +spin_lock_bh (&bdi->wb_lock); +clear_bit (BDI_registered, &bdi->state); +spin_unlock_bh (&bdi->wb_lock); +/* * Drain work list and shutdown the delayed_work. At this point, * @bdi->bdi_list is empty telling bdi_Writeback_workfn() that @bdi
net/bluetooth/hci_event.c +7 -1
@@ -3596,7 +3596,13 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb)hci_send_cmd (hdev,HCI_OP_LE_LTK_REPLY ,sizeof (cp), &cp); -if (ltk->type &HCI_SMP_STK ) { +/* Ref. Bluetooth Core SPEC pages 1975 and 2004. STK is a +* temporary key used to encrypt a connection following +* pairing. It is used during the Encrypted Session Setup to +* distribute the keys. Later, security can be re-established +* using a distributed LTK. +*/ +if (ltk->type ==HCI_SMP_STK_SLAVE ) {list_del (<k->list);kfree (ltk); }
security/integrity/ima/ima.h +1 -1
@@ -27,7 +27,7 @@#include "../integrity.h" enum ima_show_type {IMA_SHOW_BINARY ,IMA_SHOW_BINARY_NO_FIELD_LEN , -IMA_SHOW_ASCII }; +IMA_SHOW_BINARY_OLD_STRING_FMT ,IMA_SHOW_ASCII };enum tpm_pcrs {TPM_PCR0 =0 ,TPM_PCR8 =8 };/* digest size for IMA, fits SHA1 or MD5 */
security/integrity/ima/ima_fs.c +2 -0
@@ -160,6 +160,8 @@ static int ima_measurements_show(struct seq_file *m, void *v)if (is_ima_template &&strcmp (field->field_id,"d" ) ==0 ) show =IMA_SHOW_BINARY_NO_FIELD_LEN ; +if (is_ima_template &&strcmp (field->field_id,"n" ) ==0 ) + show =IMA_SHOW_BINARY_OLD_STRING_FMT ; field->field_show (m, show, &e->template_data[i]); }return 0 ;
security/integrity/ima/ima_template_lib.c +7 -3
@@ -109,13 +109,16 @@ static void ima_show_template_data_binary(struct seq_file *m,enum data_formats datafmt, struct ima_field_data *field_data) { + u32 len = (show == IMA_SHOW_BINARY_OLD_STRING_FMT) ? +strlen (field_data->data) : field_data->len; +if (show !=IMA_SHOW_BINARY_NO_FIELD_LEN ) -ima_putc (m, &field_data->len,sizeof (u32)); +ima_putc (m, &len,sizeof (len)); -if (!field_data->len) +if (!len)return ; -ima_putc (m, field_data->data, field_data->len); +ima_putc (m, field_data->data, len); } static void ima_show_template_field_data(struct seq_file *m,
@@ -129,6 +132,7 @@ static void ima_show_template_field_data(struct seq_file *m,break ;case IMA_SHOW_BINARY :case IMA_SHOW_BINARY_NO_FIELD_LEN : +case IMA_SHOW_BINARY_OLD_STRING_FMT :ima_show_template_data_binary (m, show, datafmt, field_data);break ;default :
[ANNOUNCE] Linux 3.13.y.z extended stable support
In reply to Greg KHQuoted 3 lines · Greg KH
NOTE
This is the LAST 3.13.y release. It is now end-of-life. [...]
The Ubuntu kernel team will pick up stable maintenance where Greg KH left off with v3.13.11 (thanks, Greg!)...
The Ubuntu kernel team is pleased to announce that we will be providing extended stable support for the Linux 3.13 kernel until April 2016 as a third party effort maintained on our infrastructure.
Our linux-3.13.y{-queue,-review} stable branches will fork from v3.13.11 and will be published here:
git://kernel.ubuntu.com/ubuntu/linux.git
We will use the same stable request/review workflow and follow the standard upstream stable kernel rules. More details are available at
http://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
We welcome any feedback and contribution to this effort. We will be posting the first review cycle patch set in a week or two.
-Kamal Mostafa
Ubuntu Kernel Team, Canonical Ltd.