Linux 3.16.65
I'm announcing the release of the 3.16.65 kernel.
All users of the 3.16 kernel series should upgrade.
The updated 3.16.y git tree can be found at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.16.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git
The diff from 3.16.64 is attached to this message.
Ben.
------------
Documentation/filesystems/proc.txt | 1 - Documentation/vm/page_migration | 10 +- Documentation/vm/unevictable-lru.txt | 120 ++++----------------- Makefile | 2 +- arch/arm/kvm/arm.c | 23 ++-- arch/mips/Kconfig | 1 + arch/mips/bcm63xx/reset.c | 2 +- arch/mips/boot/compressed/calc_vmlinuz_load_addr.c | 7 +- arch/mips/include/asm/cpu-info.h | 2 +- arch/mips/include/asm/mmu.h | 2 +- arch/mips/include/asm/mmu_context.h | 8 +- arch/mips/include/asm/pgtable-64.h | 5 + arch/mips/include/uapi/asm/inst.h | 2 +- arch/mips/mm/c-r3k.c | 2 +- arch/powerpc/configs/g5_defconfig | 1 - arch/powerpc/configs/maple_defconfig | 1 - arch/powerpc/configs/pmac32_defconfig | 1 - arch/powerpc/configs/ppc64_defconfig | 1 - arch/powerpc/configs/ppc6xx_defconfig | 1 - arch/powerpc/kernel/signal_32.c | 38 +++++-- arch/powerpc/kernel/signal_64.c | 47 ++++++-- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/vmx.c | 6 +- arch/x86/pci/broadcom_bus.c | 4 +- crypto/crypto_user.c | 37 ++++--- crypto/pcrypt.c | 2 +- drivers/ata/sata_rcar.c | 4 +- drivers/block/swim3.c | 6 +- drivers/gpu/drm/i915/intel_ringbuffer.c | 40 ++++++- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- drivers/infiniband/hw/qib/qib_sdma.c | 4 +- drivers/input/keyboard/nomadik-ske-keypad.c | 2 +- drivers/misc/altera-stapl/altera.c | 3 +- drivers/misc/genwqe/card_utils.c | 2 +- drivers/misc/vexpress-syscfg.c | 2 +- drivers/net/ethernet/ibm/ibmveth.c | 6 +- drivers/net/ethernet/intel/igb/igb_main.c | 8 +- drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 +- drivers/net/hamradio/6pack.c | 24 ++--- drivers/net/vmxnet3/vmxnet3_drv.c | 6 +- drivers/net/vmxnet3/vmxnet3_int.h | 4 +- drivers/net/wireless/airo.c | 2 +- drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 +- drivers/net/wireless/b43/phy_common.c | 2 +- drivers/pinctrl/sh-pfc/pfc-r8a7740.c | 3 +- drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 6 +- drivers/pinctrl/sh-pfc/pfc-sh7264.c | 9 +- drivers/pinctrl/sh-pfc/pfc-sh7269.c | 2 +- drivers/pinctrl/sh-pfc/pfc-sh73a0.c | 1 + drivers/pinctrl/sh-pfc/pfc-sh7734.c | 20 ++-- drivers/power/olpc_battery.c | 4 +- drivers/s390/scsi/zfcp_aux.c | 6 +- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- drivers/tty/serial/imx.c | 2 +- drivers/tty/tty_ldsem.c | 10 ++ drivers/usb/class/cdc-acm.c | 10 ++ drivers/usb/class/cdc-acm.h | 1 + drivers/usb/host/r8a66597-hcd.c | 5 +- drivers/usb/serial/pl2303.c | 5 + drivers/usb/serial/pl2303.h | 5 + drivers/video/console/fbcon.c | 2 +- drivers/video/fbdev/core/fbmem.c | 8 +- fs/btrfs/btrfs_inode.h | 6 ++ fs/btrfs/delayed-inode.c | 2 + fs/btrfs/dev-replace.c | 2 + fs/btrfs/inode.c | 65 +++++++++-- fs/btrfs/tree-log.c | 16 +++ fs/ceph/caps.c | 1 - fs/cifs/sess.c | 22 ++-- fs/cifs/smb2maperror.c | 4 +- fs/cifs/smb2pdu.c | 11 +- fs/dlm/lock.c | 17 +-- fs/dlm/lockspace.c | 2 +- fs/ext4/ext4.h | 17 ++- fs/ext4/extents.c | 3 +- fs/ext4/ialloc.c | 2 +- fs/ext4/inline.c | 26 +++-- fs/ext4/inode.c | 61 +++++++---- fs/ext4/ioctl.c | 2 +- fs/ext4/namei.c | 4 +- fs/ext4/resize.c | 5 +- fs/ext4/super.c | 32 +++--- fs/ext4/xattr.c | 2 +- fs/f2fs/node.c | 4 +- include/linux/gpio/consumer.h | 2 +- include/linux/hugetlb.h | 14 +++ include/linux/mm.h | 6 ++ include/trace/events/ext4.h | 20 ++++ kernel/panic.c | 6 +- lib/string.c | 27 ++--- mm/hugetlb.c | 37 ++++++- mm/memory_hotplug.c | 46 +++----- mm/rmap.c | 92 +++++++++++----- net/9p/client.c | 21 ++++ net/sunrpc/auth_gss/svcauth_gss.c | 8 +- net/sunrpc/cache.c | 9 +- sound/core/pcm.c | 2 + sound/pci/emu10k1/emufx.c | 5 + sound/pci/hda/hda_tegra.c | 1 + sound/pci/rme9652/hdsp.c | 10 +- sound/synth/emux/emux_hwdep.c | 7 +- tools/lib/lockdep/include/liblockdep/rwlock.h | 6 +- tools/perf/builtin-help.c | 2 +- tools/perf/ui/tui/helpline.c | 2 +- tools/perf/util/parse-events.c | 2 +- tools/perf/util/pmu.c | 4 +- tools/perf/util/svghelper.c | 2 +- virt/kvm/kvm_main.c | 40 +++---- 108 files changed, 771 insertions(+), 460 deletions(-)
Anand Jain (1):
btrfs: dev-replace: go back to suspended state if target device is missing
Arnaldo Carvalho de Melo (4):
perf help: Remove needless use of strncpy()
perf svghelper: Fix unchecked usage of strncpy()
perf ui helpline: Use strlcpy() as a shorter form of strncpy() + explicit set nul perf parse-events: Fix unchecked usage of strncpy()
Bart Van Assche (1):
tools/lib/lockdep: Rename "trywlock" into "trywrlock"
Ben Hutchings (3):
perf pmu: Suppress potential format-truncation warning Revert "cifs: empty TargetInfo leads to crash on recovery" Linux 3.16.65
Breno Leitao (3):
powerpc/tm: Set MSR[TS] just prior to recheckpoint powerpc/tm: Unset MSR[TS] if not recheckpointing powerpc/tm: Limit TM code inside PPC_TRANSACTIONAL_MEM
Chris Wilson (1):
drm/i915/ringbuffer: Delay after EMIT_INVALIDATE for gen4/gen5
Christian Borntraeger (1):
genwqe: Fix size check
Christoffer Dall (1):
KVM: arm/arm64: Fix VMID alloc race by reverting to lock-less
Colin Ian King (3):
x86/PCI: Fix Broadcom CNB20LE unintended sign extension (redux)
pcrypt: use format specifier in kobject_add
altera-stapl: check for a null key before strcasecmp'ing it
Dan Carpenter (4):
wireless: airo: potential buffer overflow in sprintf()
misc: vexpress: Off by one in vexpress_syscfg_exec() IB/qib: Fix an error code in qib_sdma_verbs_send()
Input: nomadik-ske-keypad - fix a loop timeout test
Dmitry Monakhov (1):
ext4: ext4_inline_data_fiemap should respect callers argument
Dmitry Safonov (1):
tty/ldsem: Wake up readers after timed out down_write()
Dominique Martinet (1):
9p/net: put a lower bound on msize
Eric Biggers (1):
crypto: user - support incremental algorithm dumps
Eric Dumazet (1):
net/hamradio/6pack: use mod_timer() to rearm timers
Filipe Manana (2):
Btrfs: fix stale dir entries after unlink, inode eviction and fsync
Btrfs: fix fsync of files with multiple hard links in new directories
Finn Thain (1):
block/swim3: Fix -EBUSY error when re-opening device after unmount
Geert Uytterhoeven (10):
pinctrl: sh-pfc: r8a7740: Add missing REF125CK pin to gether_gmii group
pinctrl: sh-pfc: r8a7740: Add missing LCD0 marks to lcd0_data24_1 group
pinctrl: sh-pfc: r8a7791: Remove bogus ctrl marks from qspi_data4_b group
pinctrl: sh-pfc: r8a7791: Remove bogus marks from vin1_b_data18 group
pinctrl: sh-pfc: sh73a0: Add missing TO pin to tpu4_to3 group
pinctrl: sh-pfc: sh7734: Add missing IPSR11 field
pinctrl: sh-pfc: sh7264: Fix PFCR3 and PFCR0 register configuration
pinctrl: sh-pfc: sh7269: Add missing PCIOR0 field
pinctrl: sh-pfc: sh7734: Remove bogus IPSR10 value
pinctrl: sh-pfc: sh7734: Fix shifted values in IPSR10
Georgy A Bystrenin (1):
CIFS: Fix error mapping for SMB2_LOCK command which caused OFD lock problem
Gustavo A. R. Silva (4):
ALSA: emux: Fix potential Spectre v1 vulnerabilities
ALSA: pcm: Fix potential Spectre v1 vulnerability
ALSA: rme9652: Fix potential Spectre v1 vulnerability
ALSA: emu10k1: Fix potential Spectre v1 vulnerabilities
Huacai Chen (2):
MIPS: Ensure pmd_present() returns false after pmd_mknotpresent()
MIPS: Align kernel load address to 64KB
Hugh Dickins (2):
mm Documentation: undoc non-linear vmas
mm: rmap use pte lock not mmap_sem to set PageMlocked
Jia-Ju Bai (1):
usb: r8a66597: Fix a possible concurrency use-after-free bug in r8a66597_endpoint_disable()
Jim Mattson (2):
kvm: vmx: Set IA32_TSC_AUX for legacy mode guests
kvm: Disallow wraparound in kvm_gfn_to_hva_cache_init
Jiong Wang (1):
mips: bpf: fix encoding bug for mm_srlv32_op
Jonas Gorski (1):
MIPS: BCM63XX: fix switch core reset on BCM6368
Kai-Heng Feng (1):
igb: Fix an issue that PME is not enabled during runtime suspend
Krzysztof Kozlowski (1):
gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB
Kyle Roeschley (1):
ath6kl: Only use match sets when firmware supports it
Larry Finger (1):
b43: Fix error in cordic routine
Laurent Pinchart (1):
drm: rcar-du: Fix vblank initialization
Leon Romanovsky (1):
net/mlx5: Continue driver initialization despite debugfs failure
Lubomir Rintel (1):
power: supply: olpc_battery: correct the temperature units
Maciej W. Rozycki (1):
MIPS: SiByte: Enable ZONE_DMA32 for LittleSur
Macpaul Lin (1):
cdc-acm: fix abnormal DATA RX issue for Mediatek Preloader.
Maurizio Lombardi (1):
ext4: missing unlock/put_page() in ext4_try_to_write_inline_data()
Michael Ellerman (1):
powerpc/configs: Don't enable PPC_EARLY_DEBUG in defconfigs
Michal Hocko (2):
mm, memory_hotplug: do not clear numa_node association after hot_remove hwpoison, memory_hotplug: allow hwpoisoned pages to be offlined
Mike Kravetz (1):
mm: migration: fix migration of huge PMD shared pages
Noralf Trønnes (1):
fbdev: fbcon: Fix unregister crash when more than one framebuffer
Pan Bian (1):
f2fs: read page index before freeing
Paul Burton (1):
MIPS: Expand MIPS32 ASIDs to 64 bits
Pavel Shilovsky (1):
CIFS: Enable encryption during session setup phase
Peter Rosin (1):
fbdev: fbmem: behave better with small rotated displays and many CPUs
Rasmus Villemoes (1):
lib/string.c: remove duplicated function
Sameer Pujar (1):
ALSA: hda/tegra: clear pending irq handlers
Scott Chen (1):
USB: serial: pl2303: add ids for Hewlett-Packard HP POS pole displays
Sean Christopherson (1):
KVM: x86: Use jmp to invoke kvm_spurious_fault() from .fixup
Sergei Shtylyov (1):
sata_rcar: fix deferred probing
Sergey Senozhatsky (1):
panic: avoid deadlocks in re-entrant console drivers
Shivasharan S (1):
scsi: megaraid_sas: Use 63-bit DMA addressing
Shrikrishna Khare (1):
Driver: Vmxnet3: Fix regression caused by 5738a09
Stefan Agner (1):
serial: imx: fix error handling in console_setup
Steffen Maier (1):
scsi: zfcp: fix posting too many status read buffers leading to adapter shutdown
Theodore Ts'o (8):
ext4: include terminating u32 in size of xattr entries when expanding inodes
ext4: avoid declaring fs inconsistent due to invalid file handles
ext4: force inode writes when nfsd calls commit_metadata()
ext4: check for shutdown and r/o file system in ext4_write_inode()
ext4: make sure enough credits are reserved for dioread_nolock writes
ext4: fix a potential fiemap/page fault deadlock w/ inline_data
ext4: avoid kernel warning when writing the superblock to a dead device
ext4: fix special inode number checks in __ext4_iget()
Tyrel Datwyler (1):
ibmveth: fix DMA unmap error in ibmveth_xmit_start error path
Vasily Averin (6):
dlm: fixed memory leaks after failed ls_remove_names allocation
dlm: possible memory leak on error path in create_lkb()
dlm: lost put_lkb on error path in receive_convert() and receive_unlock()
dlm: memory leaks on error path in dlm_user_request()
sunrpc: fix cache_head leak due to queued request
sunrpc: use SVC_NET() in svcauth_gss_* functions
Yan, Zheng (1):
ceph: don't update importing cap's mseq when handing cap export
Yang Dongsheng (1):
Btrfs: fill ->last_trans for delayed inode in btrfs_fill_inode.
zhengbin (1):
9p/net: fix memory leak in p9_client_create
Documentation/filesystems/proc.txt +0 -1
@@ -429,7 +429,6 @@ flags associated with the particular virtual memory area in two letter encoded ac - area is accountable nr - swap space is not reserved for the area ht - area uses huge tlb pages - nl - non-linear mapping ar - architecture specific flag dd - do not include area into core dump sd - soft-dirty flag
Documentation/vm/page_migration +4 -6
@@ -99,12 +99,10 @@ is increased so that the page cannot be freed while page migration occurs. 4. The new page is prepped with some settings from the old page so that accesses to the new page will discover a page with the correct settings. -5. All the page table references to the page are converted - to migration entries or dropped (nonlinear vmas). - This decrease the mapcount of a page. If the resulting - mapcount is not zero then we do not migrate the page. - All user space processes that attempt to access the page - will now wait on the page lock. +5. All the page table references to the page are converted to migration + entries. This decreases the mapcount of a page. If the resulting + mapcount is not zero then we do not migrate the page. All user space + processes that attempt to access the page will now wait on the page lock. 6. The radix tree lock is taken. This will cause all processes trying to access the page via the mapping to block on the radix tree spinlock.
Documentation/vm/unevictable-lru.txt +19 -101
142 lines not on this page · raw message
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 16 -SUBLEVEL = 64 +SUBLEVEL = 65 EXTRAVERSION = NAME = Museum of Fishiegoodies
arch/arm/kvm/arm.c +11 -12
@@ -59,7 +59,7 @@ static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu);/* The VMID used in the VTTBR */ static atomic64_t kvm_vmid_gen =ATOMIC64_INIT (1 );static u8 kvm_next_vmid; -static DEFINE_RWLOCK (kvm_vmid_lock); +static DEFINE_SPINLOCK (kvm_vmid_lock);static bool vgic_present;
@@ -376,7 +376,9 @@ void force_vm_exit(const cpumask_t *mask)*/ static bool need_new_vmid_gen (struct kvm *kvm) { -return unlikely (kvm->arch.vmid_gen !=atomic64_read (&kvm_vmid_gen)); +u64 current_vmid_gen =atomic64_read (&kvm_vmid_gen); +smp_rmb ();/* Orders read of kvm_vmid_gen and kvm->arch.vmid */ +return unlikely (ACCESS_ONCE (kvm->arch.vmid_gen) != current_vmid_gen); }/**
@@ -391,16 +393,11 @@ static void update_vttbr(struct kvm *kvm) {phys_addr_t pgd_phys;u64 vmid; -bool new_gen; -read_lock (&kvm_vmid_lock); - new_gen =need_new_vmid_gen (kvm); -read_unlock (&kvm_vmid_lock); - -if (!new_gen) +if (!need_new_vmid_gen (kvm))return ; -write_lock (&kvm_vmid_lock); +spin_lock (&kvm_vmid_lock);/* * We need to re-check the vmid_gen here to ensure that if another vcpu
@@ -408,7 +405,7 @@ static void update_vttbr(struct kvm *kvm)* use the same vmid. */ if (!need_new_vmid_gen (kvm)) { -write_unlock (&kvm_vmid_lock); +spin_unlock (&kvm_vmid_lock);return ; }
@@ -431,7 +428,6 @@ static void update_vttbr(struct kvm *kvm)kvm_call_hyp (__kvm_flush_vm_context); } - kvm->arch.vmid_gen =atomic64_read (&kvm_vmid_gen); kvm->arch.vmid = kvm_next_vmid; kvm_next_vmid++;
@@ -441,7 +437,10 @@ static void update_vttbr(struct kvm *kvm) vmid = ((u64)(kvm->arch.vmid) <<VTTBR_VMID_SHIFT ) &VTTBR_VMID_MASK ; kvm->arch.vttbr = pgd_phys | vmid; -write_unlock (&kvm_vmid_lock); +smp_wmb (); +ACCESS_ONCE (kvm->arch.vmid_gen) =atomic64_read (&kvm_vmid_gen); + +spin_unlock (&kvm_vmid_lock); }static int kvm_vcpu_first_run_init (struct kvm_vcpu *vcpu)
arch/mips/Kconfig +1 -0
@@ -633,6 +633,7 @@ config SIBYTE_LITTLESUR select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_HIGHMEM select SYS_SUPPORTS_LITTLE_ENDIAN + select ZONE_DMA32 if 64BIT config SIBYTE_SENTOSA bool "Sibyte BCM91250E-Sentosa"
arch/mips/bcm63xx/reset.c +1 -1
@@ -119,7 +119,7 @@#define BCM6368_RESET_DSL 0#define BCM6368_RESET_SAR SOFTRESET_6368_SAR_MASK#define BCM6368_RESET_EPHY SOFTRESET_6368_EPHY_MASK -#define BCM6368_RESET_ENETSW 0 +#define BCM6368_RESET_ENETSW SOFTRESET_6368_ENETSW_MASK#define BCM6368_RESET_PCM SOFTRESET_6368_PCM_MASK#define BCM6368_RESET_MPI SOFTRESET_6368_MPI_MASK#define BCM6368_RESET_PCIE 0
arch/mips/boot/compressed/calc_vmlinuz_load_addr.c +4 -3
@@ -13,6 +13,7 @@#include <stdint.h> #include <stdio.h> #include <stdlib.h> +#include "../../../../include/linux/sizes.h" int main (int argc,char *argv[]) {
@@ -45,11 +46,11 @@ int main(int argc, char *argv[]) vmlinuz_load_addr = vmlinux_load_addr + vmlinux_size;/* -* Align with 16 bytes: "greater than that used for any standard data -* types by a MIPS compiler." -- See MIPS Run Linux (Second Edition). +* Align with 64KB: KEXEC needs load sections to be aligned to PAGE_SIZE, +* which may be as large as 64KB depending on the kernel configuration. */ - vmlinuz_load_addr += (16 - vmlinux_size %16 ); + vmlinuz_load_addr += (SZ_64K - vmlinux_size %SZ_64K );printf ("0x%llx\n" , vmlinuz_load_addr);
arch/mips/include/asm/cpu-info.h +1 -1
@@ -39,7 +39,7 @@ struct cache_desc {#define MIPS_CACHE_PINDEX 0x00000020/* Physically indexed cache */ struct cpuinfo_mips { -unsigned long asid_cache; +u64 asid_cache;/* * Capability and feature descriptor structure for MIPS CPU
arch/mips/include/asm/mmu.h +1 -1
@@ -2,7 +2,7 @@#define __ASM_MMU_Htypedef struct { -unsigned long asid[NR_CPUS ]; +u64 asid[NR_CPUS ];void *vdso; }mm_context_t ;
arch/mips/include/asm/mmu_context.h +3 -5
@@ -85,15 +85,15 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)* All unused by hardware upper bits will be considered * as a software asid extension. */ -#define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1))) -#define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1) +#define ASID_VERSION_MASK (~(u64)(ASID_MASK | (ASID_MASK - 1))) +#define ASID_FIRST_VERSION ((u64)(~ASID_VERSION_MASK) + 1)/* Normal, classic MIPS get_new_mmu_context */ static inline void get_new_mmu_context (struct mm_struct *mm,unsigned long cpu) {extern void kvm_local_flush_tlb_all (void ); -unsigned long asid =asid_cache (cpu); +u64 asid =asid_cache (cpu);if (! ((asid +=ASID_INC ) &ASID_MASK ) ) {if (cpu_has_vtag_icache)
@@ -103,8 +103,6 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)#else local_flush_tlb_all ();/* start new asid cycle */ #endif -if (!asid)/* fix version if needed */ - asid =ASID_FIRST_VERSION ; }cpu_context (cpu, mm) =asid_cache (cpu) = asid;
arch/mips/include/asm/pgtable-64.h +5 -0
@@ -189,6 +189,11 @@ static inline int pmd_bad(pmd_t pmd)static inline int pmd_present (pmd_t pmd) { +#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT +if (unlikely (pmd_val (pmd) & _PAGE_HUGE)) +return pmd_val (pmd) & _PAGE_PRESENT; +#endif +return pmd_val (pmd) != (unsigned long ) invalid_pte_table; }
arch/mips/include/uapi/asm/inst.h +1 -1
@@ -262,8 +262,8 @@ enum mm_32a_minor_op { mm_ext_op =0x02c , mm_pool32axf_op =0x03c , mm_srl32_op =0x040 , + mm_srlv32_op =0x050 , mm_sra_op =0x080 , - mm_srlv32_op =0x090 , mm_rotr_op =0x0c0 , mm_lwxs_op =0x118 , mm_addu32_op = 0x150,
arch/mips/mm/c-r3k.c +1 -1
@@ -244,7 +244,7 @@ static void r3k_flush_cache_page(struct vm_area_struct *vma,pmd_t *pmdp;pte_t *ptep; -pr_debug ("cpage[%08lx,%08lx]\n" , +pr_debug ("cpage[%08llx,%08lx]\n" ,cpu_context (smp_processor_id (), mm), addr);/* No ASID => no such page in the cache. */
arch/powerpc/configs/g5_defconfig +0 -1
@@ -283,7 +283,6 @@ CONFIG_DEBUG_MUTEXES=y CONFIG_LATENCYTOP=y CONFIG_SYSCTL_SYSCALL_CHECK=y CONFIG_BOOTX_TEXT=y -CONFIG_PPC_EARLY_DEBUG=y CONFIG_PPC_EARLY_DEBUG_BOOTX=y CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_TEST=m
arch/powerpc/configs/maple_defconfig +0 -1
@@ -137,7 +137,6 @@ CONFIG_DEBUG_STACK_USAGE=y CONFIG_XMON=y CONFIG_XMON_DEFAULT=y CONFIG_BOOTX_TEXT=y -CONFIG_PPC_EARLY_DEBUG=y CONFIG_PPC_EARLY_DEBUG_BOOTX=y CONFIG_CRYPTO_ECB=m CONFIG_CRYPTO_PCBC=m
arch/powerpc/configs/pmac32_defconfig +0 -1
@@ -349,7 +349,6 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y CONFIG_XMON=y CONFIG_XMON_DEFAULT=y CONFIG_BOOTX_TEXT=y -CONFIG_PPC_EARLY_DEBUG=y CONFIG_PPC_EARLY_DEBUG_BOOTX=y CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_PCBC=m
arch/powerpc/configs/ppc64_defconfig +0 -1
@@ -339,7 +339,6 @@ CONFIG_FTR_FIXUP_SELFTEST=y CONFIG_MSI_BITMAP_SELFTEST=y CONFIG_XMON=y CONFIG_BOOTX_TEXT=y -CONFIG_PPC_EARLY_DEBUG=y CONFIG_CRYPTO_TEST=m CONFIG_CRYPTO_PCBC=m CONFIG_CRYPTO_HMAC=y
arch/powerpc/configs/ppc6xx_defconfig +0 -1
@@ -1261,7 +1261,6 @@ CONFIG_DEBUG_STACKOVERFLOW=y CONFIG_DEBUG_STACK_USAGE=y CONFIG_XMON=y CONFIG_BOOTX_TEXT=y -CONFIG_PPC_EARLY_DEBUG=y CONFIG_PPC_EARLY_DEBUG_BOOTX=y CONFIG_KEYS=y CONFIG_KEYS_DEBUG_PROC_KEYS=y
arch/powerpc/kernel/signal_32.c +32 -6
@@ -882,7 +882,23 @@ static long restore_tm_user_regs(struct pt_regs *regs,/* If TM bits are set to the reserved value, it's an invalid context */ if (MSR_TM_RESV (msr_hi))return 1 ; -/* Pull in the MSR TM bits from the user context */ + +/* +* Disabling preemption, since it is unsafe to be preempted +* with MSR[TS] set without recheckpointing. +*/ +preempt_disable (); + +/* +* CAUTION: +* After regs->MSR[TS] being updated, make sure that get_user(), +* put_user() or similar functions are *not* called. These +* functions can generate page faults which will cause the process +* to be de-scheduled with MSR[TS] set but without calling +* tm_recheckpoint(). This can cause a bug. +* +* Pull in the MSR TM bits from the user context +*/ regs->msr = (regs->msr & ~MSR_TS_MASK ) | (msr_hi &MSR_TS_MASK );/* Now, recheckpoint. This loads up all of the checkpointed (older) * registers, including FP and V[S]Rs. After recheckpointing, the
@@ -906,6 +922,8 @@ static long restore_tm_user_regs(struct pt_regs *regs, }#endif +preempt_enable (); +return 0 ; }#endif
@@ -1228,11 +1246,11 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, struct pt_regs *regs) {struct rt_sigframe __user *rt_sf; +int tm_restore =0 ;#ifdef CONFIG_PPC_TRANSACTIONAL_MEM struct ucontext __user *uc_transact;unsigned long msr_hi;unsigned long tmp; -int tm_restore =0 ;#endif /* Always make any pending restarted system calls return -EINTR */ current_thread_info ()->restart_block.fn = do_no_restart_syscall;
@@ -1266,11 +1284,19 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8, goto bad; } } -if (!tm_restore) -/* Fall through, for non-TM restore */ +if (!tm_restore) { +/* +* Unset regs->msr because ucontext MSR TS is not +* set, and recheckpoint was not called. This avoid +* hitting a TM Bad thing at RFID +*/ + regs->msr &= ~MSR_TS_MASK ; + } +/* Fall through, for non-TM restore */ #endif -if (do_setcontext (&rt_sf->uc, regs,1 )) - goto bad; +if (!tm_restore) +if (do_setcontext (&rt_sf->uc, regs,1 )) + goto bad;/* * It's not clear whether or why it is desirable to save the
arch/powerpc/kernel/signal_64.c +39 -8
72 lines not on this page · raw message
arch/x86/include/asm/kvm_host.h +1 -1
@@ -1041,7 +1041,7 @@ asmlinkage void kvm_spurious_fault(void);"cmpb $0, kvm_rebooting \n\t" \"jne 668b \n\t" \ __ASM_SIZE(push) " $666b \n\t" \ -"call kvm_spurious_fault \n\t" \ +"jmp kvm_spurious_fault \n\t" \".popsection \n\t" \ _ASM_EXTABLE(666b ,667b )
arch/x86/kvm/vmx.c +3 -3
@@ -2077,9 +2077,6 @@ static void setup_msrs(struct vcpu_vmx *vmx) index =__find_msr_index (vmx,MSR_CSTAR );if (index >=0 )move_msr_up (vmx, index, save_nmsrs++); - index =__find_msr_index (vmx,MSR_TSC_AUX ); -if (index >=0 && vmx->rdtscp_enabled) -move_msr_up (vmx, index, save_nmsrs++);/* * MSR_STAR is only needed on long mode guests, and only * if efer.sce is enabled.
@@ -2092,6 +2089,9 @@ static void setup_msrs(struct vcpu_vmx *vmx) index =__find_msr_index (vmx,MSR_EFER );if (index >=0 &&update_transition_efer (vmx, index))move_msr_up (vmx, index, save_nmsrs++); + index =__find_msr_index (vmx,MSR_TSC_AUX ); +if (index >=0 && vmx->rdtscp_enabled) +move_msr_up (vmx, index, save_nmsrs++); vmx->save_nmsrs = save_nmsrs;
arch/x86/pci/broadcom_bus.c +2 -2
@@ -50,8 +50,8 @@ static void __init cnb20le_res(u8 bus, u8 slot, u8 func) word1 =read_pci_config_16 (bus, slot, func,0xc0 ); word2 =read_pci_config_16 (bus, slot, func,0xc2 );if (word1 != word2) { - res.start = (word1 <<16 ) |0x0000 ; - res.end = (word2 <<16 ) |0xffff ; + res.start = ((resource_size_t ) word1 <<16 ) |0x0000 ; + res.end = ((resource_size_t ) word2 <<16 ) |0xffff ; res.flags =IORESOURCE_MEM ;update_res (info, res.start, res.end, res.flags,0 ); }
crypto/crypto_user.c +20 -17
@@ -226,30 +226,33 @@ static int crypto_report(struct sk_buff *in_skb, struct nlmsghdr *in_nlh,static int crypto_dump_report (struct sk_buff *skb,struct netlink_callback *cb) { -struct crypto_alg *alg; +const size_t start_pos = cb->args[0 ]; +size_t pos =0 ;struct crypto_dump_info info; -int err; - -if (cb->args[0 ]) - goto out; - - cb->args[0 ] =1 ; +struct crypto_alg *alg; +int res; info.in_skb = cb->skb; info.out_skb = skb; info.nlmsg_seq = cb->nlh->nlmsg_seq; info.nlmsg_flags =NLM_F_MULTI ; +down_read (&crypto_alg_sem);list_for_each_entry (alg, &crypto_alg_list, cra_list) { - err =crypto_report_alg (alg, &info); -if (err) - goto out_err; +if (pos >= start_pos) { + res =crypto_report_alg (alg, &info); +if (res == -EMSGSIZE ) +break ; +if (res) + goto out; + } + pos++; } - + cb->args[0 ] = pos; + res = skb->len; out: -return skb->len; -out_err: -return err; +up_read (&crypto_alg_sem); +return res; }static int crypto_dump_report_done (struct netlink_callback *cb)
@@ -478,7 +481,7 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)if ((type == (CRYPTO_MSG_GETALG -CRYPTO_MSG_BASE ) && (nlh->nlmsg_flags &NLM_F_DUMP ))) {struct crypto_alg *alg; -u16 dump_alloc =0 ; +unsigned long dump_alloc =0 ;if (link->dump ==NULL )return -EINVAL ;
@@ -486,16 +489,16 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)down_read (&crypto_alg_sem);list_for_each_entry (alg, &crypto_alg_list, cra_list) dump_alloc +=CRYPTO_REPORT_MAXSIZE ; +up_read (&crypto_alg_sem); {struct netlink_dump_control c = { .dump = link->dump, .done = link->done, - .min_dump_alloc = dump_alloc, + .min_dump_alloc =min (dump_alloc,65535UL ), }; err =netlink_dump_start (crypto_nlsk, skb, nlh, &c); } -up_read (&crypto_alg_sem);return err; }
crypto/pcrypt.c +1 -1
@@ -440,7 +440,7 @@ static int pcrypt_sysfs_add(struct padata_instance *pinst, const char *name)int ret; pinst->kobj.kset = pcrypt_kset; - ret =kobject_add (&pinst->kobj,NULL , name); + ret =kobject_add (&pinst->kobj,NULL ,"%s" , name);if (!ret)kobject_uevent (&pinst->kobj,KOBJ_ADD );
drivers/ata/sata_rcar.c +3 -1
@@ -874,7 +874,9 @@ static int sata_rcar_probe(struct platform_device *pdev)int ret =0 ; irq =platform_get_irq (pdev,0 ); -if (irq <=0 ) +if (irq <0 ) +return irq; +if (!irq)return -EINVAL ; priv = devm_kzalloc(&pdev->dev, sizeof(struct sata_rcar_priv),
drivers/block/swim3.c +5 -1
@@ -1027,7 +1027,11 @@ static void floppy_release(struct gendisk *disk, fmode_t mode)struct swim3 __iomem *sw = fs->swim3;mutex_lock (&swim3_mutex); -if (fs->ref_count >0 && --fs->ref_count ==0 ) { +if (fs->ref_count >0 ) + --fs->ref_count; +else if (fs->ref_count ==-1 ) + fs->ref_count =0 ; +if (fs->ref_count ==0 ) {swim3_action (fs,MOTOR_OFF );out_8 (&sw->control_bic,0xff );swim3_select (fs,RELAX );
drivers/gpu/drm/i915/intel_ringbuffer.c +38 -2
@@ -103,6 +103,7 @@ gen4_render_ring_flush(struct intel_engine_cs *ring,struct drm_device *dev = ring->dev;u32 cmd;int ret; +int i;/* * read/write caches:
@@ -142,12 +143,47 @@ gen4_render_ring_flush(struct intel_engine_cs *ring, (IS_G4X(dev) || IS_GEN5(dev))) cmd |=MI_INVALIDATE_ISP ; - ret =intel_ring_begin (ring,2 ); + i =2 ; +if (invalidate_domains &I915_GEM_DOMAIN_INSTRUCTION ) + i +=20 ; + + ret =intel_ring_begin (ring, i);if (ret)return ret;intel_ring_emit (ring, cmd); -intel_ring_emit (ring,MI_NOOP ); + +/* +* A random delay to let the CS invalidate take effect? Without this +* delay, the GPU relocation path fails as the CS does not see +* the updated contents. Just as important, if we apply the flushes +* to the EMIT_FLUSH branch (i.e. immediately after the relocation +* write and before the invalidate on the next batch), the relocations +* still fail. This implies that is a delay following invalidation +* that is required to reset the caches as opposed to a delay to +* ensure the memory is written. +*/ +if (invalidate_domains &I915_GEM_DOMAIN_INSTRUCTION ) { +intel_ring_emit (ring,GFX_OP_PIPE_CONTROL (4 ) | +PIPE_CONTROL_QW_WRITE ); +intel_ring_emit (ring, ring->scratch.gtt_offset | +PIPE_CONTROL_GLOBAL_GTT ); +intel_ring_emit (ring,0 ); +intel_ring_emit (ring,0 ); + +for (i =0 ; i <12 ; i++) +intel_ring_emit (ring,MI_FLUSH ); + +intel_ring_emit (ring,GFX_OP_PIPE_CONTROL (4 ) | +PIPE_CONTROL_QW_WRITE ); +intel_ring_emit (ring, ring->scratch.gtt_offset | +PIPE_CONTROL_GLOBAL_GTT ); +intel_ring_emit (ring,0 ); +intel_ring_emit (ring,0 ); + } + +intel_ring_emit (ring, cmd); +intel_ring_advance (ring);return 0 ;
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1 -1
@@ -89,7 +89,7 @@ static int rcar_du_load(struct drm_device *dev, unsigned long flags) }/* vblank handling */ - ret =drm_vblank_init (dev, (1 << rcdu->num_crtcs) -1 ); + ret =drm_vblank_init (dev, rcdu->num_crtcs);if (ret <0 ) {dev_err (&pdev->dev,"failed to initialize vblank\n" ); goto done;
drivers/infiniband/hw/qib/qib_sdma.c +3 -1
@@ -597,8 +597,10 @@ int qib_sdma_verbs_send(struct qib_pportdata *ppd, dw = (len +3 ) >>2 ; addr =dma_map_single (&ppd->dd->pcidev->dev, sge->vaddr, dw <<2 ,DMA_TO_DEVICE ); -if (dma_mapping_error (&ppd->dd->pcidev->dev, addr)) +if (dma_mapping_error (&ppd->dd->pcidev->dev, addr)) { + ret = -ENOMEM ; goto unmap; + } sdmadesc[0 ] =0 ;make_sdma_desc (ppd, sdmadesc, (u64 ) addr, dw, dwoffset);/* SDmaUseLargeBuf has to be set in every descriptor */
drivers/input/keyboard/nomadik-ske-keypad.c +1 -1
@@ -100,7 +100,7 @@ static int __init ske_keypad_chip_init(struct ske_keypad *keypad)while ((readl (keypad->reg_base +SKE_RIS ) !=0x00000000 ) && timeout--)cpu_relax (); -if (!timeout) +if (timeout ==-1 )return -EINVAL ;/*
drivers/misc/altera-stapl/altera.c +1 -2
@@ -2176,8 +2176,7 @@ static int altera_get_note(u8 *p, s32 program_size, key_ptr = &p[note_strings +get_unaligned_be32 ( &p[note_table + (8 * i)])]; -if ((strnicmp (key, key_ptr,strlen (key_ptr)) ==0 ) && - (key !=NULL )) { +if (key && !strncasecmp (key, key_ptr,strlen (key_ptr))) { status =0 ; value_ptr = &p[note_strings +
drivers/misc/genwqe/card_utils.c +1 -1
@@ -206,7 +206,7 @@ u32 genwqe_crc32(u8 *buff, size_t len, u32 init)void *__genwqe_alloc_consistent (struct genwqe_dev *cd,size_t size,dma_addr_t *dma_handle) { -if (get_order (size) >MAX_ORDER ) +if (get_order (size) >=MAX_ORDER )return NULL ;return pci_alloc_consistent (cd->pci_dev, size, dma_handle);
drivers/misc/vexpress-syscfg.c +1 -1
@@ -61,7 +61,7 @@ static int vexpress_syscfg_exec(struct vexpress_syscfg_func *func,int tries;long timeout; -if (WARN_ON (index > func->num_templates)) +if (WARN_ON (index >= func->num_templates))return -EINVAL ; command =readl (syscfg->base +SYS_CFGCTRL );
drivers/net/ethernet/ibm/ibmveth.c +5 -1
@@ -1059,11 +1059,15 @@ static netdev_tx_t ibmveth_start_xmit(struct sk_buff *skb, map_failed_frags: last = i+1 ; -for (i =0 ; i < last; i++) +for (i =1 ; i < last; i++)dma_unmap_page (&adapter->vdev->dev, descs[i].fields.address, descs[i].fields.flags_len &IBMVETH_BUF_LEN_MASK ,DMA_TO_DEVICE ); +dma_unmap_single (&adapter->vdev->dev, + descs[0 ].fields.address, + descs[0 ].fields.flags_len &IBMVETH_BUF_LEN_MASK , +DMA_TO_DEVICE ); map_failed:if (!firmware_has_feature (FW_FEATURE_CMO ))netdev_err (netdev,"tx: unable to map xmit buffer\n" );
drivers/net/ethernet/intel/igb/igb_main.c +5 -3
@@ -7419,9 +7419,11 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,igb_clear_interrupt_scheme (adapter);#ifdef CONFIG_PM - retval =pci_save_state (pdev); -if (retval) -return retval; +if (!runtime) { + retval =pci_save_state (pdev); +if (retval) +return retval; + }#endif status =rd32 (E1000_STATUS );
drivers/net/ethernet/mellanox/mlx5/core/main.c +3 -3
@@ -313,9 +313,9 @@ int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev)INIT_LIST_HEAD (&priv->pgdir_list);spin_lock_init (&priv->mkey_lock); - priv->dbg_root =debugfs_create_dir (dev_name (&pdev->dev), mlx5_debugfs_root); -if (!priv->dbg_root) -return -ENOMEM ; +if (mlx5_debugfs_root) + priv->dbg_root = +debugfs_create_dir (pci_name (pdev), mlx5_debugfs_root); err =pci_enable_device (pdev);if (err) {
drivers/net/hamradio/6pack.c +6 -18
@@ -551,12 +551,7 @@ static void resync_tnc(unsigned long channel)/* Start resync timer again -- the TNC might be still absent */ - -del_timer (&sp->resync_t); - sp->resync_t.data = (unsigned long ) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies +SIXP_RESYNC_TIMEOUT ; -add_timer (&sp->resync_t); +mod_timer (&sp->resync_t, jiffies +SIXP_RESYNC_TIMEOUT ); }static inline int tnc_init (struct sixpack *sp)
@@ -567,11 +562,7 @@ static inline int tnc_init(struct sixpack *sp) sp->tty->ops->write (sp->tty, &inbyte,1 ); -del_timer (&sp->resync_t); - sp->resync_t.data = (unsigned long ) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies +SIXP_RESYNC_TIMEOUT ; -add_timer (&sp->resync_t); +mod_timer (&sp->resync_t, jiffies +SIXP_RESYNC_TIMEOUT );return 0 ; }
@@ -654,6 +645,8 @@ static int sixpack_open(struct tty_struct *tty) sp->tx_t.data = (unsigned long ) sp;init_timer (&sp->resync_t); + sp->resync_t.function = resync_tnc; + sp->resync_t.data = (unsigned long ) sp;spin_unlock_bh (&sp->lock);
@@ -947,13 +940,8 @@ static void decode_prio_command(struct sixpack *sp, unsigned char cmd)/* if the state byte has been received, the TNC is present, so the resync timer can be reset. */ -if (sp->tnc_state ==TNC_IN_SYNC ) { -del_timer (&sp->resync_t); - sp->resync_t.data = (unsigned long ) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies +SIXP_INIT_RESYNC_TIMEOUT ; -add_timer (&sp->resync_t); - } +if (sp->tnc_state ==TNC_IN_SYNC ) +mod_timer (&sp->resync_t, jiffies +SIXP_INIT_RESYNC_TIMEOUT ); sp->status1 = cmd &SIXP_PRIO_DATA_MASK ; }
drivers/net/vmxnet3/vmxnet3_drv.c +3 -3
@@ -1308,9 +1308,9 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, goto rcd_done; } new_dma_addr =dma_map_page (&adapter->pdev->dev, - rbi->page, -0 ,PAGE_SIZE , -PCI_DMA_FROMDEVICE ); + new_page, +0 ,PAGE_SIZE , +PCI_DMA_FROMDEVICE );if (dma_mapping_error (&adapter->pdev->dev, new_dma_addr)) {put_page (new_page);
drivers/net/vmxnet3/vmxnet3_int.h +2 -2
@@ -69,12 +69,12 @@/* * Version numbers */ -#define VMXNET3_DRIVER_VERSION_STRING "1.2.2.0-k" +#define VMXNET3_DRIVER_VERSION_STRING "1.2.3.0-k"/* Each byte of this 32-bit integer encodes a version number in * VMXNET3_DRIVER_VERSION_STRING. */ -#define VMXNET3_DRIVER_VERSION_NUM 0x01020200 +#define VMXNET3_DRIVER_VERSION_NUM 0x01020300#if defined(CONFIG_PCI_MSI )/* RSS only makes sense if MSI-X is supported. */
drivers/net/wireless/airo.c +1 -1
@@ -5469,7 +5469,7 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {we have to add a spin lock... */ rc =readBSSListRid (ai, doLoseSync, &BSSList_rid);while (rc ==0 && BSSList_rid.index !=cpu_to_le16 (0xffff )) { - ptr += sprintf(ptr, "%pM %*s rssi = %d", + ptr += sprintf(ptr, "%pM %.*s rssi = %d", BSSList_rid.bssid, (int)BSSList_rid.ssidLen, BSSList_rid.ssid,
drivers/net/wireless/ath/ath6kl/cfg80211.c +1 -1
@@ -930,7 +930,7 @@ static int ath6kl_set_probed_ssids(struct ath6kl *ar,else ssid_list[i].flag =ANY_SSID_FLAG ; -if (n_match_ssid ==0 ) +if (ar->wiphy->max_match_sets !=0 && n_match_ssid ==0 ) ssid_list[i].flag |=MATCH_SSID_FLAG ; }
drivers/net/wireless/b43/phy_common.c +1 -1
@@ -596,7 +596,7 @@ struct b43_c32 b43_cordic(int theta)u8 i;s32 tmp;s8 signx =1 ; -u32 angle =0 ; +s32 angle =0 ;struct b43_c32 ret = { .i =39797 , .q =0 , };while (theta > (180 <<16 ))
drivers/pinctrl/sh-pfc/pfc-r8a7740.c +2 -1
@@ -1987,7 +1987,7 @@ static const unsigned int gether_gmii_pins[] = {*/ 185 ,186 ,187 ,188 ,189 ,190 ,191 ,192 ,174 ,161 ,204 ,171 ,170 ,169 ,168 ,167 ,166 ,173 ,172 ,176 ,184 ,183 ,203 , - 205, 163, 206, 207, + 205, 163, 206, 207, 158, };static const unsigned int gether_gmii_mux[] = { ET_ERXD0_MARK, ET_ERXD1_MARK, ET_ERXD2_MARK, ET_ERXD3_MARK,
@@ -2159,6 +2159,7 @@ static const unsigned int lcd0_data24_1_mux[] = {LCD0_D0_MARK ,LCD0_D1_MARK ,LCD0_D2_MARK ,LCD0_D3_MARK ,LCD0_D4_MARK ,LCD0_D5_MARK ,LCD0_D6_MARK ,LCD0_D7_MARK ,LCD0_D8_MARK ,LCD0_D9_MARK ,LCD0_D10_MARK ,LCD0_D11_MARK , +LCD0_D12_MARK ,LCD0_D13_MARK ,LCD0_D14_MARK ,LCD0_D15_MARK ,LCD0_D16_MARK ,LCD0_D17_MARK ,LCD0_D18_PORT163_MARK ,LCD0_D19_PORT162_MARK ,LCD0_D20_PORT161_MARK ,LCD0_D21_PORT158_MARK , LCD0_D22_PORT160_MARK, LCD0_D23_PORT159_MARK,
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +1 -5
@@ -2656,8 +2656,7 @@ static const unsigned int qspi_data4_b_pins[] = { RCAR_GP_PIN(6, 4), };static const unsigned int qspi_data4_b_mux[] = { -SPCLK_B_MARK ,MOSI_IO0_B_MARK ,MISO_IO1_B_MARK , -IO2_B_MARK ,IO3_B_MARK ,SSL_B_MARK , +MOSI_IO0_B_MARK ,MISO_IO1_B_MARK ,IO2_B_MARK ,IO3_B_MARK , };/* - SCIF0 ------------------------------------------------------------------ */ static const unsigned int scif0_data_pins[] = {
@@ -3786,17 +3785,14 @@ static const unsigned int vin1_b_data18_pins[] = { };static const unsigned int vin1_b_data18_mux[] = {/* B */ -VI1_DATA0_B_MARK ,VI1_DATA1_B_MARK ,VI1_DATA2_B_MARK ,VI1_DATA3_B_MARK ,VI1_DATA4_B_MARK ,VI1_DATA5_B_MARK ,VI1_DATA6_B_MARK ,VI1_DATA7_B_MARK ,/* G */ -VI1_G0_B_MARK ,VI1_G1_B_MARK ,VI1_G2_B_MARK ,VI1_G3_B_MARK ,VI1_G4_B_MARK ,VI1_G5_B_MARK ,VI1_G6_B_MARK ,VI1_G7_B_MARK ,/* R */ -VI1_R0_B_MARK ,VI1_R1_B_MARK ,VI1_R2_B_MARK ,VI1_R3_B_MARK ,VI1_R4_B_MARK ,VI1_R5_B_MARK ,VI1_R6_B_MARK ,VI1_R7_B_MARK ,
drivers/pinctrl/sh-pfc/pfc-sh7264.c +7 -2
@@ -1716,6 +1716,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = { }, { PINMUX_CFG_REG("PFCR3", 0xfffe38a8, 16, 4) { +0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , +0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , +0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,PF12MD_000 ,PF12MD_001 ,0 ,PF12MD_011 ,PF12MD_100 ,PF12MD_101 ,0 ,0 , 0, 0, 0, 0, 0, 0, 0, 0 }
@@ -1759,8 +1762,10 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,PF1MD_000 ,PF1MD_001 ,PF1MD_010 ,PF1MD_011 ,PF1MD_100 ,PF1MD_101 ,0 ,0 , -0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 - } +0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , +PF0MD_000 ,PF0MD_001 ,PF0MD_010 ,PF0MD_011 , +PF0MD_100 ,PF0MD_101 ,0 ,0 , + 0, 0, 0, 0, 0, 0, 0, 0 } }, { PINMUX_CFG_REG("PFIOR0", 0xfffe38b2, 16, 1) {
drivers/pinctrl/sh-pfc/pfc-sh7269.c +1 -1
@@ -2119,7 +2119,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = { }, { PINMUX_CFG_REG("PCIOR0", 0xfffe3852, 16, 1) { -0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , +0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,PC8_IN ,PC8_OUT ,PC7_IN ,PC7_OUT , PC6_IN, PC6_OUT,
drivers/pinctrl/sh-pfc/pfc-sh73a0.c +1 -0
@@ -2676,6 +2676,7 @@ static const unsigned int tpu4_to2_mux[] = { };static const unsigned int tpu4_to3_pins[] = {/* TO */ +PIN_NUMBER (6 ,26 ), };static const unsigned int tpu4_to3_mux[] = {TPU4TO3_MARK ,
drivers/pinctrl/sh-pfc/pfc-sh7734.c +10 -10
@@ -2218,31 +2218,31 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {/* IP10_22 [1] */ FN_CAN_CLK_A ,FN_RX4_D ,/* IP10_21_19 [3] */ -FN_AUDIO_CLKOUT ,FN_TX1_E ,FN_HRTS0_C ,FN_FSE_B , -FN_LCD_M_DISP_B ,0 ,0 ,0 , +FN_AUDIO_CLKOUT ,FN_TX1_E ,0 ,FN_HRTS0_C ,FN_FSE_B , +FN_LCD_M_DISP_B ,0 ,0 ,/* IP10_18_16 [3] */ -FN_AUDIO_CLKC ,FN_SCK1_E ,FN_HCTS0_C ,FN_FRB_B , -FN_LCD_VEPWC_B ,0 ,0 ,0 , +FN_AUDIO_CLKC ,FN_SCK1_E ,0 ,FN_HCTS0_C ,FN_FRB_B , +FN_LCD_VEPWC_B ,0 ,0 ,/* IP10_15 [1] */ FN_AUDIO_CLKB_A ,FN_LCD_CLK_B ,/* IP10_14_12 [3] */ FN_AUDIO_CLKA_A ,FN_VI1_CLK_B ,FN_SCK1_D ,FN_IECLK_B ,FN_LCD_FLM_B ,0 ,0 ,0 ,/* IP10_11_9 [3] */ -FN_SSI_SDATA3 ,FN_VI1_7_B ,FN_HTX0_C ,FN_FWE_B , -FN_LCD_CL2_B ,0 ,0 ,0 , +FN_SSI_SDATA3 ,FN_VI1_7_B ,0 ,FN_HTX0_C ,FN_FWE_B , +FN_LCD_CL2_B ,0 ,0 ,/* IP10_8_6 [3] */ -FN_SSI_SDATA2 ,FN_VI1_6_B ,FN_HRX0_C ,FN_FRE_B , -FN_LCD_CL1_B ,0 ,0 ,0 , +FN_SSI_SDATA2 ,FN_VI1_6_B ,0 ,FN_HRX0_C ,FN_FRE_B , +FN_LCD_CL1_B ,0 ,0 ,/* IP10_5_3 [3] */ FN_SSI_WS23 ,FN_VI1_5_B ,FN_TX1_D ,FN_HSCK0_C ,FN_FALE_B , -FN_LCD_DON_B ,0 ,0 ,0 , +FN_LCD_DON_B ,0 ,0 ,/* IP10_2_0 [3] */ FN_SSI_SCK23 ,FN_VI1_4_B ,FN_RX1_D ,FN_FCLE_B , FN_LCD_DATA15_B, 0, 0, 0 } }, { PINMUX_CFG_REG_VAR("IPSR11", 0xFFFC0048, 32, - 3, 1, 2, 2, 2, 3, 3, 1, 2, 3, 3, 1, 1, 1, 1) { + 3, 1, 2, 3, 2, 2, 3, 3, 1, 2, 3, 3, 1, 1, 1, 1) {/* IP11_31_29 [3] */ 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , /* IP11_28 [1] */
drivers/power/olpc_battery.c +2 -2
@@ -425,14 +425,14 @@ static int olpc_bat_get_property(struct power_supply *psy,if (ret)return ret; - val->intval = (s16 )be16_to_cpu (ec_word) *100 /256 ; + val->intval = (s16 )be16_to_cpu (ec_word) *10 /256 ;break ;case POWER_SUPPLY_PROP_TEMP_AMBIENT : ret =olpc_ec_cmd (EC_AMB_TEMP ,NULL ,0 , (void *)&ec_word,2 );if (ret)return ret; - val->intval = (int )be16_to_cpu (ec_word) *100 /256 ; + val->intval = (int )be16_to_cpu (ec_word) *10 /256 ;break ;case POWER_SUPPLY_PROP_CHARGE_COUNTER : ret =olpc_ec_cmd (EC_BAT_ACR ,NULL ,0 , (void *)&ec_word,2 );
drivers/s390/scsi/zfcp_aux.c +3 -3
@@ -275,16 +275,16 @@ static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter)*/ int zfcp_status_read_refill (struct zfcp_adapter *adapter) { -while (atomic_read (&adapter->stat_miss) >0 ) +while (atomic_add_unless (&adapter->stat_miss,-1 ,0 ))if (zfcp_fsf_status_read (adapter->qdio)) { +atomic_inc (&adapter->stat_miss);/* undo add -1 */ if (atomic_read (&adapter->stat_miss) >= adapter->stat_read_buf_num) {zfcp_erp_adapter_reopen (adapter,0 ,"axsref1" );return 1 ; }break ; - }else -atomic_dec (&adapter->stat_miss); + }return 0 ; }
drivers/scsi/megaraid/megaraid_sas_base.c +1 -1
@@ -4592,7 +4592,7 @@ megasas_set_dma_mask(struct pci_dev *pdev)* All our contollers are capable of performing 64-bit DMA */ if (IS_DMA64 ) { -if (pci_set_dma_mask (pdev,DMA_BIT_MASK (64 )) !=0 ) { +if (pci_set_dma_mask (pdev,DMA_BIT_MASK (63 )) !=0 ) {if (pci_set_dma_mask (pdev,DMA_BIT_MASK (32 )) !=0 ) goto fail_set_dma_mask;
drivers/tty/serial/imx.c +1 -1
@@ -1777,7 +1777,7 @@ imx_console_setup(struct console *co, char *options) retval =clk_prepare (sport->clk_per);if (retval) -clk_disable_unprepare (sport->clk_ipg); +clk_unprepare (sport->clk_ipg); error_console:return retval;
drivers/tty/tty_ldsem.c +10 -0
@@ -306,6 +306,16 @@ down_write_failed(struct ld_semaphore *sem, long count, long timeout)if (!locked)ldsem_atomic_update (-LDSEM_WAIT_BIAS , sem);list_del (&waiter.list); + +/* +* In case of timeout, wake up every reader who gave the right of way +* to writer. Prevent separation readers into two groups: +* one that helds semaphore and another that sleeps. +* (in case of no contention with a writer) +*/ +if (!locked &&list_empty (&sem->write_wait)) +__ldsem_wake_readers (sem); +raw_spin_unlock_irq (&sem->wait_lock);__set_task_state (tsk,TASK_RUNNING );
drivers/usb/class/cdc-acm.c +10 -0
@@ -499,6 +499,13 @@ static int acm_tty_install(struct tty_driver *driver, struct tty_struct *tty)if (retval) goto error_init_termios; +/* +* Suppress initial echoing for some devices which might send data +* immediately after acm driver has been installed. +*/ +if (acm->quirks &DISABLE_ECHO ) + tty->termios.c_lflag &= ~ECHO ; + tty->driver_data = acm;return 0 ;
@@ -1690,6 +1697,9 @@ static const struct usb_device_id acm_ids[] = { { USB_DEVICE(0x0e8d, 0x0003), /* FIREFLY, MediaTek Inc; [email protected] */ .driver_info =NO_UNION_NORMAL ,/* has no union descriptor */ }, + { USB_DEVICE(0x0e8d, 0x2000), /* MediaTek Inc Preloader */ + .driver_info = DISABLE_ECHO, /* DISABLE ECHO in termios flag */ + }, { USB_DEVICE(0x0e8d, 0x3329), /* MediaTek Inc GPS */ .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ },
drivers/usb/class/cdc-acm.h +1 -0
@@ -135,3 +135,4 @@ struct acm {#define QUIRK_CONTROL_LINE_STATE BIT(6)#define CLEAR_HALT_CONDITIONS BIT(7)#define SEND_ZERO_PACKET BIT(8) +#define DISABLE_ECHO BIT(9)
drivers/usb/host/r8a66597-hcd.c +4 -1
@@ -1990,6 +1990,8 @@ static int r8a66597_urb_dequeue(struct usb_hcd *hcd, struct urb *urb,static void r8a66597_endpoint_disable (struct usb_hcd *hcd,struct usb_host_endpoint *hep) +__acquires(r8a66597->lock) +__releases(r8a66597->lock) {struct r8a66597 *r8a66597 =hcd_to_r8a66597 (hcd);struct r8a66597_pipe *pipe = (struct r8a66597_pipe *)hep->hcpriv;
@@ -2002,13 +2004,14 @@ static void r8a66597_endpoint_disable(struct usb_hcd *hcd,return ; pipenum = pipe->info.pipenum; +spin_lock_irqsave (&r8a66597->lock, flags);if (pipenum ==0 ) {kfree (hep->hcpriv); hep->hcpriv =NULL ; +spin_unlock_irqrestore (&r8a66597->lock, flags);return ; } -spin_lock_irqsave (&r8a66597->lock, flags);pipe_stop (r8a66597, pipe);pipe_irq_disable (r8a66597, pipenum);disable_irq_empty (r8a66597, pipenum);
drivers/usb/serial/pl2303.c +5 -0
@@ -85,9 +85,14 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(YCCABLE_VENDOR_ID, YCCABLE_PRODUCT_ID) }, { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LD220TA_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LD960_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LD960TA_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LCM960_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LM920_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LM940_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_TD620_PRODUCT_ID) }, { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) }, { USB_DEVICE(ZEAGLE_VENDOR_ID, ZEAGLE_N2ITION3_PRODUCT_ID) }, { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) },
drivers/usb/serial/pl2303.h +5 -0
@@ -122,10 +122,15 @@/* Hewlett-Packard POS Pole Displays */ #define HP_VENDOR_ID 0x03f0 +#define HP_LM920_PRODUCT_ID 0x026b +#define HP_TD620_PRODUCT_ID 0x0956#define HP_LD960_PRODUCT_ID 0x0b39#define HP_LCM220_PRODUCT_ID 0x3139#define HP_LCM960_PRODUCT_ID 0x3239#define HP_LD220_PRODUCT_ID 0x3524 +#define HP_LD220TA_PRODUCT_ID 0x4349 +#define HP_LD960TA_PRODUCT_ID 0x4439 +#define HP_LM940_PRODUCT_ID 0x5039/* Cressi Edy (diving computer) PC interface */ #define CRESSI_VENDOR_ID 0x04b8
drivers/video/console/fbcon.c +1 -1
@@ -3019,7 +3019,7 @@ static int fbcon_fb_unbind(int idx)for (i = first_fb_vc; i <= last_fb_vc; i++) {if (con2fb_map[i] != idx && con2fb_map[i] !=-1 ) { - new_idx = i; + new_idx = con2fb_map[i];break ; } }
drivers/video/fbdev/core/fbmem.c +6 -2
@@ -433,7 +433,9 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, image->dx += image->width +8 ; } }else if (rotate ==FB_ROTATE_UD ) { -for (x =0 ; x < num; x++) { +u32 dx = image->dx; + +for (x =0 ; x < num && image->dx <= dx; x++) { info->fbops->fb_imageblit (info, image); image->dx -= image->width +8 ; }
@@ -445,7 +447,9 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, image->dy += image->height +8 ; } }else if (rotate ==FB_ROTATE_CCW ) { -for (x =0 ; x < num; x++) { +u32 dy = image->dy; + +for (x =0 ; x < num && image->dy <= dy; x++) { info->fbops->fb_imageblit (info, image); image->dy -= image->height +8 ; }
fs/btrfs/btrfs_inode.h +6 -0
@@ -143,6 +143,12 @@ struct btrfs_inode {*/ u64 last_unlink_trans; +/* +* Track the transaction id of the last transaction used to create a +* hard link for the inode. This is used by the log tree (fsync). +*/ +u64 last_link_trans; +/* * Number of bytes outstanding that are going to need csums. This is * used in ENOSPC accounting.
fs/btrfs/delayed-inode.c +2 -0
@@ -1801,6 +1801,8 @@ int btrfs_fill_inode(struct inode *inode, u32 *rdev)set_nlink (inode,btrfs_stack_inode_nlink (inode_item));inode_set_bytes (inode,btrfs_stack_inode_nbytes (inode_item));BTRFS_I (inode)->generation =btrfs_stack_inode_generation (inode_item); +BTRFS_I (inode)->last_trans =btrfs_stack_inode_transid (inode_item); + inode->i_version =btrfs_stack_inode_sequence (inode_item); inode->i_rdev =0 ; *rdev =btrfs_stack_inode_rdev (inode_item);
fs/btrfs/dev-replace.c +2 -0
@@ -782,6 +782,8 @@ int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info)btrfs_info (fs_info,"cannot continue dev_replace, tgtdev is missing" );btrfs_info (fs_info,"you may cancel the operation after 'mount -o degraded'" ); + dev_replace->replace_state = +BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED ;btrfs_dev_replace_unlock (dev_replace);return 0 ; }
fs/btrfs/inode.c +57 -8
94 lines not on this page · raw message
fs/btrfs/tree-log.c +16 -0
@@ -4430,6 +4430,22 @@ static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans, goto end_trans; } +/* +* If a new hard link was added to the inode in the current transaction +* and its link count is now greater than 1, we need to fallback to a +* transaction commit, otherwise we can end up not logging all its new +* parents for all the hard links. Here just from the dentry used to +* fsync, we can not visit the ancestor inodes for all the other hard +* links to figure out if any is new, so we fallback to a transaction +* commit (instead of adding a lot of complexity of scanning a btree, +* since this scenario is not a common use case). +*/ +if (inode->i_nlink >1 && +BTRFS_I (inode)->last_link_trans > last_committed) { + ret = -EMLINK ; + goto end_trans; + } + inode_only =LOG_INODE_EXISTS ;while (1 ) {if (!parent || !parent->d_inode || sb != parent->d_inode->i_sb)
fs/ceph/caps.c +0 -1
@@ -2830,7 +2830,6 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex, tcap->cap_id = t_cap_id; tcap->seq = t_seq -1 ; tcap->issue_seq = t_seq -1 ; - tcap->mseq = t_mseq; tcap->issued |= issued; tcap->implemented |= issued;if (cap == ci->i_auth_cap)
fs/cifs/sess.c +10 -12
@@ -343,13 +343,12 @@ void build_ntlmssp_negotiate_blob(unsigned char *pbuffer,/* BB is NTLMV2 session security format easier to use here? */ flags =NTLMSSP_NEGOTIATE_56 |NTLMSSP_REQUEST_TARGET |NTLMSSP_NEGOTIATE_128 |NTLMSSP_NEGOTIATE_UNICODE | -NTLMSSP_NEGOTIATE_NTLM |NTLMSSP_NEGOTIATE_EXTENDED_SEC ; -if (ses->server->sign) { +NTLMSSP_NEGOTIATE_NTLM |NTLMSSP_NEGOTIATE_EXTENDED_SEC | +NTLMSSP_NEGOTIATE_SEAL ; +if (ses->server->sign) flags |=NTLMSSP_NEGOTIATE_SIGN ; -if (!ses->server->session_estab || - ses->ntlmssp->sesskey_per_smbsess) - flags |=NTLMSSP_NEGOTIATE_KEY_XCH ; - } +if (!ses->server->session_estab || ses->ntlmssp->sesskey_per_smbsess) + flags |=NTLMSSP_NEGOTIATE_KEY_XCH ; sec_blob->NegotiateFlags =cpu_to_le32 (flags);
@@ -412,13 +411,12 @@ int build_ntlmssp_auth_blob(unsigned char **pbuffer, flags =NTLMSSP_NEGOTIATE_56 |NTLMSSP_REQUEST_TARGET |NTLMSSP_NEGOTIATE_TARGET_INFO |NTLMSSP_NEGOTIATE_128 |NTLMSSP_NEGOTIATE_UNICODE | -NTLMSSP_NEGOTIATE_NTLM |NTLMSSP_NEGOTIATE_EXTENDED_SEC ; -if (ses->server->sign) { +NTLMSSP_NEGOTIATE_NTLM |NTLMSSP_NEGOTIATE_EXTENDED_SEC | +NTLMSSP_NEGOTIATE_SEAL ; +if (ses->server->sign) flags |=NTLMSSP_NEGOTIATE_SIGN ; -if (!ses->server->session_estab || - ses->ntlmssp->sesskey_per_smbsess) - flags |=NTLMSSP_NEGOTIATE_KEY_XCH ; - } +if (!ses->server->session_estab || ses->ntlmssp->sesskey_per_smbsess) + flags |=NTLMSSP_NEGOTIATE_KEY_XCH ; tmp = *pbuffer +sizeof (AUTHENTICATE_MESSAGE ); sec_blob->NegotiateFlags =cpu_to_le32 (flags);
fs/cifs/smb2maperror.c +2 -2
@@ -377,8 +377,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = { {STATUS_NONEXISTENT_EA_ENTRY, -EIO, "STATUS_NONEXISTENT_EA_ENTRY"}, {STATUS_NO_EAS_ON_FILE, -ENODATA, "STATUS_NO_EAS_ON_FILE"}, {STATUS_EA_CORRUPT_ERROR, -EIO, "STATUS_EA_CORRUPT_ERROR"}, - {STATUS_FILE_LOCK_CONFLICT, -EIO, "STATUS_FILE_LOCK_CONFLICT"}, - {STATUS_LOCK_NOT_GRANTED, -EIO, "STATUS_LOCK_NOT_GRANTED"}, + {STATUS_FILE_LOCK_CONFLICT, -EACCES, "STATUS_FILE_LOCK_CONFLICT"}, + {STATUS_LOCK_NOT_GRANTED, -EACCES, "STATUS_LOCK_NOT_GRANTED"}, {STATUS_DELETE_PENDING, -ENOENT, "STATUS_DELETE_PENDING"}, {STATUS_CTL_FILE_NOT_SUPPORTED, -ENOSYS, "STATUS_CTL_FILE_NOT_SUPPORTED"},
fs/cifs/smb2pdu.c +1 -10
@@ -608,7 +608,6 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,*/ kfree (ses->auth_key.response); ses->auth_key.response =NULL ; - ses->auth_key.len =0 ;/* * If memory allocation is successful, caller of this function
@@ -765,11 +764,8 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,if (!rc) {mutex_lock (&server->srv_mutex); -if (server->sign && server->ops->generate_signingkey) { +if (server->ops->generate_signingkey) { rc = server->ops->generate_signingkey (ses); -kfree (ses->auth_key.response); - ses->auth_key.response =NULL ; - ses->auth_key.len =0 ;if (rc) {cifs_dbg (FYI ,"SMB3 session key generation failed\n" );
@@ -791,11 +787,6 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, } keygen_exit: -if (!server->sign) { -kfree (ses->auth_key.response); - ses->auth_key.response =NULL ; - ses->auth_key.len =0 ; - }kfree (ses->ntlmssp);return rc;
fs/dlm/lock.c +10 -7
@@ -1210,6 +1210,7 @@ static int create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret)if (rv <0 ) {log_error (ls,"create_lkb idr error %d" , rv); +dlm_free_lkb (lkb);return rv; }
@@ -4177,6 +4178,7 @@ static int receive_convert(struct dlm_ls *ls, struct dlm_message *ms) (unsigned long long )lkb->lkb_recover_seq, ms->m_header.h_nodeid, ms->m_lkid); error = -ENOENT ; +dlm_put_lkb (lkb); goto fail; }
@@ -4230,6 +4232,7 @@ static int receive_unlock(struct dlm_ls *ls, struct dlm_message *ms) lkb->lkb_id, lkb->lkb_remid, ms->m_header.h_nodeid, ms->m_lkid); error = -ENOENT ; +dlm_put_lkb (lkb); goto fail; }
@@ -5792,20 +5795,20 @@ int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua, goto out; } } - -/* After ua is attached to lkb it will be freed by dlm_free_lkb(). -When DLM_IFL_USER is set, the dlm knows that this is a userspace -lock and that lkb_astparam is the dlm_user_args structure. */ - error =set_lock_args (mode, &ua->lksb, flags, namelen, timeout_cs, fake_astfn, ua, fake_bastfn, &args); - lkb->lkb_flags |=DLM_IFL_USER ; -if (error) { +kfree (ua->lksb.sb_lvbptr); + ua->lksb.sb_lvbptr =NULL ; +kfree (ua);__put_lkb (ls, lkb); goto out; } +/* After ua is attached to lkb it will be freed by dlm_free_lkb(). +When DLM_IFL_USER is set, the dlm knows that this is a userspace +lock and that lkb_astparam is the dlm_user_args structure. */ + lkb->lkb_flags |=DLM_IFL_USER ; error =request_lock (ls, lkb, name, namelen, &args);switch (error) {
fs/dlm/lockspace.c +1 -1
@@ -673,11 +673,11 @@ static int new_lockspace(const char *name, const char *cluster,kfree (ls->ls_recover_buf); out_lkbidr:idr_destroy (&ls->ls_lkbidr); + out_rsbtbl:for (i =0 ; i <DLM_REMOVE_NAMES_MAX ; i++) {if (ls->ls_remove_names[i])kfree (ls->ls_remove_names[i]); } - out_rsbtbl:vfree (ls->ls_rsbtbl); out_lsfree:if (do_unreg)
fs/ext4/ext4.h +14 -3
@@ -2165,8 +2165,19 @@ int do_journal_get_write_access(handle_t *handle,#define FALL_BACK_TO_NONDELALLOC 1#define CONVERT_INLINE_DATA 2 -extern struct inode *ext4_iget (struct super_block *,unsigned long ); -extern struct inode *ext4_iget_normal (struct super_block *,unsigned long ); +typedef enum { +EXT4_IGET_NORMAL =0 , +EXT4_IGET_SPECIAL =0x0001 ,/* OK to iget a system inode */ +EXT4_IGET_HANDLE =0x0002 /* Inode # is from a handle */ +}ext4_iget_flags ; + +extern struct inode *__ext4_iget (struct super_block *sb,unsigned long ino, +ext4_iget_flags flags,const char *function, +unsigned int line); + +#define ext4_iget (sb, ino, flags) \ + __ext4_iget((sb), (ino), (flags), __func__, __LINE__) +extern int ext4_write_inode (struct inode *,struct writeback_control *);extern int ext4_setattr (struct dentry *,struct iattr *); extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry,
@@ -2701,7 +2712,7 @@ extern struct buffer_head *ext4_get_first_inline_block(struct inode *inode, int *retval);extern int ext4_inline_data_fiemap (struct inode *inode,struct fiemap_extent_info *fieinfo, -int *has_inline); +int *has_inline,__u64 start,__u64 len);extern void ext4_inline_data_truncate (struct inode *inode,int *has_inline);extern int ext4_convert_inline_data (struct inode *inode);
fs/ext4/extents.c +2 -1
@@ -5153,7 +5153,8 @@ int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,if (ext4_has_inline_data (inode)) {int has_inline =1 ; - error =ext4_inline_data_fiemap (inode, fieinfo, &has_inline); + error =ext4_inline_data_fiemap (inode, fieinfo, &has_inline, + start, len);if (has_inline)return error;
fs/ext4/ialloc.c +1 -1
@@ -1094,7 +1094,7 @@ struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino)if (!ext4_test_bit (bit, bitmap_bh->b_data)) goto bad_orphan; - inode =ext4_iget (sb, ino); + inode =ext4_iget (sb, ino,EXT4_IGET_NORMAL );if (IS_ERR (inode)) { err =PTR_ERR (inode); ext4_error(sb, "couldn't read orphan inode %lu (err %d)",
fs/ext4/inline.c +18 -8
@@ -704,8 +704,11 @@ int ext4_try_to_write_inline_data(struct address_space *mapping,if (!PageUptodate (page)) { ret =ext4_read_inline_page (inode, page); -if (ret <0 ) +if (ret <0 ) { +unlock_page (page); +put_page (page); goto out_up_read; + } } ret =1 ;
@@ -1813,11 +1816,12 @@ int ext4_destroy_inline_data(handle_t *handle, struct inode *inode)int ext4_inline_data_fiemap (struct inode *inode,struct fiemap_extent_info *fieinfo, -int *has_inline) +int *has_inline,__u64 start,__u64 len) {__u64 physical =0 ; -__u64 length; -__u32 flags =FIEMAP_EXTENT_DATA_INLINE |FIEMAP_EXTENT_LAST ; +__u64 inline_len; +__u32 flags =FIEMAP_EXTENT_DATA_INLINE |FIEMAP_EXTENT_NOT_ALIGNED | +FIEMAP_EXTENT_LAST ;int error =0 ;struct ext4_iloc iloc;
@@ -1826,6 +1830,13 @@ int ext4_inline_data_fiemap(struct inode *inode, *has_inline =0 ; goto out; } + inline_len =min_t (size_t,ext4_get_inline_size (inode), +i_size_read (inode)); +if (start >= inline_len) + goto out; +if (start + len < inline_len) + inline_len = start + len; + inline_len -= start; error =ext4_get_inode_loc (inode, &iloc);if (error)
@@ -1834,14 +1845,13 @@ int ext4_inline_data_fiemap(struct inode *inode, physical = (__u64 )iloc.bh->b_blocknr << inode->i_sb->s_blocksize_bits; physical += (char *)ext4_raw_inode (&iloc) - iloc.bh->b_data; physical += offsetof(struct ext4_inode , i_block); - length =i_size_read (inode); -if (physical) - error =fiemap_fill_next_extent (fieinfo,0 , physical, - length, flags);brelse (iloc.bh); out:up_read (&EXT4_I (inode)->xattr_sem); +if (physical) + error =fiemap_fill_next_extent (fieinfo, start, physical, + inline_len, flags);return (error <0 ? error :0 ); }
fs/ext4/inode.c +42 -19
135 lines not on this page · raw message
fs/ext4/ioctl.c +1 -1
@@ -127,7 +127,7 @@ static long swap_inode_boot_loader(struct super_block *sb, !inode_owner_or_capable(inode) || !capable(CAP_SYS_ADMIN))return -EPERM ; - inode_bl =ext4_iget (sb,EXT4_BOOT_LOADER_INO ); + inode_bl =ext4_iget (sb,EXT4_BOOT_LOADER_INO ,EXT4_IGET_SPECIAL );if (IS_ERR (inode_bl))return PTR_ERR (inode_bl); ei_bl =EXT4_I (inode_bl);
fs/ext4/namei.c +2 -2
@@ -1439,7 +1439,7 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi dentry);return ERR_PTR (-EIO ); } - inode =ext4_iget_normal (dir->i_sb, ino); + inode =ext4_iget (dir->i_sb, ino,EXT4_IGET_NORMAL );if (inode ==ERR_PTR (-ESTALE )) { EXT4_ERROR_INODE(dir, "deleted inode referenced: %u",
@@ -1472,7 +1472,7 @@ struct dentry *ext4_get_parent(struct dentry *child)return ERR_PTR (-EIO ); } -return d_obtain_alias (ext4_iget_normal (child->d_inode->i_sb, ino)); +return d_obtain_alias (ext4_iget (child->d_inode->i_sb, ino,EXT4_IGET_NORMAL )); }/*
fs/ext4/resize.c +3 -2
@@ -1609,7 +1609,7 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input) "No reserved GDT blocks, can't resize");return -EPERM ; } - inode =ext4_iget (sb,EXT4_RESIZE_INO ); + inode =ext4_iget (sb,EXT4_RESIZE_INO ,EXT4_IGET_SPECIAL );if (IS_ERR (inode)) {ext4_warning (sb,"Error opening resize inode" );return PTR_ERR (inode);
@@ -1936,7 +1936,8 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count) }if (!resize_inode) - resize_inode =ext4_iget (sb,EXT4_RESIZE_INO ); + resize_inode =ext4_iget (sb,EXT4_RESIZE_INO , +EXT4_IGET_SPECIAL );if (IS_ERR (resize_inode)) {ext4_warning (sb,"Error opening resize inode" );return PTR_ERR (resize_inode);
fs/ext4/super.c +17 -15
@@ -1013,20 +1013,11 @@ static struct inode *ext4_nfs_get_inode(struct super_block *sb, {struct inode *inode; -if (ino <EXT4_FIRST_INO (sb) && ino !=EXT4_ROOT_INO ) -return ERR_PTR (-ESTALE ); -if (ino >le32_to_cpu (EXT4_SB (sb)->s_es->s_inodes_count)) -return ERR_PTR (-ESTALE ); - -/* iget isn't really right if the inode is currently unallocated!! -* -* ext4_read_inode will return a bad_inode if the inode had been -* deleted, so we should be safe. -* +/* * Currently we don't know the generation for parent directory, so * a generation of 0 means "accept any" */ - inode =ext4_iget_normal (sb, ino); + inode =ext4_iget (sb, ino,EXT4_IGET_HANDLE );if (IS_ERR (inode))return ERR_CAST (inode);if (generation && inode->i_generation != generation) {
@@ -1051,6 +1042,16 @@ static struct dentry *ext4_fh_to_parent(struct super_block *sb, struct fid *fid, ext4_nfs_get_inode); } +static int ext4_nfs_commit_metadata (struct inode *inode) +{ +struct writeback_control wbc = { + .sync_mode =WB_SYNC_ALL + }; + +trace_ext4_nfs_commit_metadata (inode); +return ext4_write_inode (inode, &wbc); +} +/* * Try to release metadata pages (indirect blocks, directories) which are * mapped via the block device. Since these pages could have journal heads
@@ -1171,6 +1172,7 @@ static const struct export_operations ext4_export_ops = { .fh_to_dentry = ext4_fh_to_dentry, .fh_to_parent = ext4_fh_to_parent, .get_parent = ext4_get_parent, + .commit_metadata = ext4_nfs_commit_metadata, };enum {
@@ -4221,7 +4223,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)* so we can safely mount the rest of the filesystem now. */ - root =ext4_iget (sb,EXT4_ROOT_INO ); + root =ext4_iget (sb,EXT4_ROOT_INO ,EXT4_IGET_SPECIAL );if (IS_ERR (root)) {ext4_msg (sb,KERN_ERR ,"get root inode failed" ); ret =PTR_ERR (root);
@@ -4456,7 +4458,7 @@ static journal_t *ext4_get_journal(struct super_block *sb,* things happen if we iget() an unused inode, as the subsequent * iput() will try to delete it. */ - journal_inode =ext4_iget (sb, journal_inum); + journal_inode =ext4_iget (sb, journal_inum,EXT4_IGET_SPECIAL );if (IS_ERR (journal_inode)) {ext4_msg (sb,KERN_ERR ,"no journal found" );return NULL ;
@@ -4710,7 +4712,7 @@ static int ext4_commit_super(struct super_block *sb, int sync)BUFFER_TRACE (sbh,"marking dirty" );ext4_superblock_csum_set (sb);lock_buffer (sbh); -if (buffer_write_io_error (sbh)) { +if (buffer_write_io_error (sbh) || !buffer_uptodate (sbh)) {/* * Oh, dear. A previous attempt to write the * superblock failed. This could happen because the
@@ -5396,7 +5398,7 @@ static int ext4_quota_enable(struct super_block *sb, int type, int format_id,if (!qf_inums[type])return -EPERM ; - qf_inode =ext4_iget (sb, qf_inums[type]); + qf_inode =ext4_iget (sb, qf_inums[type],EXT4_IGET_SPECIAL );if (IS_ERR (qf_inode)) {ext4_error (sb,"Bad quota inode # %lu" , qf_inums[type]);return PTR_ERR (qf_inode);
fs/ext4/xattr.c +1 -1
@@ -1340,7 +1340,7 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize, end = (void *)raw_inode +EXT4_SB (inode->i_sb)->s_inode_size; min_offs = end - base; last = entry; - total_ino =sizeof (struct ext4_xattr_ibody_header ); + total_ino =sizeof (struct ext4_xattr_ibody_header ) +sizeof (u32); error =xattr_check_inode (inode, header, end);if (error)
fs/f2fs/node.c +3 -1
@@ -509,6 +509,7 @@ static void truncate_node(struct dnode_of_data *dn) {struct f2fs_sb_info *sbi =F2FS_SB (dn->inode->i_sb);struct node_info ni; +pgoff_t index;get_node_info (sbi, dn->nid, &ni);if (dn->inode->i_blocks ==0 ) {
@@ -532,10 +533,11 @@ static void truncate_node(struct dnode_of_data *dn)clear_node_page_dirty (dn->node_page);F2FS_SET_SB_DIRT (sbi); + index = dn->node_page->index;f2fs_put_page (dn->node_page,1 );invalidate_mapping_pages (NODE_MAPPING (sbi), - dn->node_page->index, dn->node_page->index); + index, index); dn->node_page =NULL ;trace_f2fs_truncate_node (dn->inode, dn->nid, ni.blk_addr);
include/linux/gpio/consumer.h +1 -1
@@ -245,7 +245,7 @@ static inline int gpiod_to_irq(const struct gpio_desc *desc)static inline struct gpio_desc *gpio_to_desc (unsigned gpio) { -return ERR_PTR (-EINVAL ); +return NULL ; }static inline int desc_to_gpio (const struct gpio_desc *desc) {
include/linux/hugetlb.h +14 -0
@@ -97,6 +97,8 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz);pte_t *huge_pte_offset (struct mm_struct *mm,unsigned long addr);int huge_pmd_unshare (struct mm_struct *mm,unsigned long *addr,pte_t *ptep); +void adjust_range_if_pmd_sharing_possible (struct vm_area_struct *vma, +unsigned long *start,unsigned long *end);struct page *follow_huge_addr (struct mm_struct *mm,unsigned long address,int write); struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
@@ -124,6 +126,18 @@ static inline unsigned long hugetlb_total_pages(void)return 0 ; } +static inline int huge_pmd_unshare (struct mm_struct *mm,unsigned long *addr, +pte_t *ptep) +{ +return 0 ; +} + +static inline void adjust_range_if_pmd_sharing_possible ( +struct vm_area_struct *vma, +unsigned long *start,unsigned long *end) +{ +} +#define follow_hugetlb_page (m,v,p,vs,a,b,i,w) ({ BUG(); 0; })#define follow_huge_addr (mm, addr, write) ERR_PTR(-EINVAL)#define copy_hugetlb_page_range (src, dst, vma) ({ BUG(); 0; })
include/linux/mm.h +6 -0
@@ -1947,6 +1947,12 @@ static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm,return vma; } +static inline bool range_in_vma (struct vm_area_struct *vma, +unsigned long start,unsigned long end) +{ +return (vma && vma->vm_start <= start && end <= vma->vm_end); +} +#ifdef CONFIG_MMU pgprot_t vm_get_page_prot (unsigned long vm_flags);#else
include/trace/events/ext4.h +20 -0
@@ -195,6 +195,26 @@ TRACE_EVENT(ext4_drop_inode, (unsigned long) __entry->ino, __entry->drop) ); +TRACE_EVENT (ext4_nfs_commit_metadata, + TP_PROTO(struct inode *inode), + +TP_ARGS (inode), + +TP_STRUCT__entry ( + __field( dev_t, dev ) +__field ( ino_t, ino ) + ), + +TP_fast_assign ( + __entry->dev = inode->i_sb->s_dev; + __entry->ino = inode->i_ino; + ), + +TP_printk ("dev %d,%d ino %lu" , +MAJOR (__entry->dev),MINOR (__entry->dev), + (unsigned long ) __entry->ino) +); + TRACE_EVENT(ext4_mark_inode_dirty, TP_PROTO(struct inode *inode, unsigned long IP),
kernel/panic.c +5 -1
@@ -13,6 +13,7 @@#include <linux/kmsg_dump.h> #include <linux/kallsyms.h> #include <linux/notifier.h> +#include <linux/vt_kern.h> #include <linux/module.h> #include <linux/random.h> #include <linux/ftrace.h>
@@ -178,7 +179,10 @@ void panic(const char *fmt, ...)*/ crash_kexec (NULL ); -bust_spinlocks (0 ); +#ifdef CONFIG_VT +unblank_screen (); +#endif +console_unblank ();/* * We may have ended up stopping the CPU holding the lock (in
lib/string.c +10 -17
@@ -31,14 +31,14 @@#include <asm/word-at-a-time.h> #include <asm/page.h> -#ifndef __HAVE_ARCH_STRNICMP +#ifndef __HAVE_ARCH_STRNCASECMP/** -* strnicmp - Case insensitive, length-limited string comparison +* strncasecmp - Case insensitive, length-limited string comparison * @s1: One string * @s2: The other string * @len: the maximum number of characters to compare */ -int strnicmp (const char *s1,const char *s2,size_t len) +int strncasecmp (const char *s1,const char *s2,size_t len) {/* Yes, Virginia, it had better be unsigned */ unsigned char c1, c2;
@@ -60,6 +60,13 @@ int strnicmp(const char *s1, const char *s2, size_t len) } while (--len);return (int )c1 - (int )c2; } +EXPORT_SYMBOL (strncasecmp); +#endif +#ifndef __HAVE_ARCH_STRNICMP +int strnicmp (const char *s1,const char *s2,size_t len) +{ +return strncasecmp (s1, s2, len); +}EXPORT_SYMBOL (strnicmp);#endif
@@ -77,20 +84,6 @@ int strcasecmp(const char *s1, const char *s2)EXPORT_SYMBOL (strcasecmp);#endif -#ifndef __HAVE_ARCH_STRNCASECMP -int strncasecmp (const char *s1,const char *s2,size_t n) -{ -int c1, c2; - -do { - c1 =tolower (*s1++); - c2 =tolower (*s2++); - }while ((--n >0 ) && c1 == c2 && c1 !=0 ); -return c1 - c2; -} -EXPORT_SYMBOL (strncasecmp); -#endif -#ifndef __HAVE_ARCH_STRCPY/** * strcpy - Copy a %NUL terminated string
mm/hugetlb.c +35 -2
@@ -3657,12 +3657,40 @@ static int vma_shareable(struct vm_area_struct *vma, unsigned long addr)/* * check on proper vm_flags and page table alignment */ -if (vma->vm_flags &VM_MAYSHARE && - vma->vm_start <= base && end <= vma->vm_end) +if (vma->vm_flags &VM_MAYSHARE &&range_in_vma (vma, base, end))return 1 ;return 0 ; } +/* +* Determine if start,end range within vma could be mapped by shared pmd. +* If yes, adjust start and end to cover range associated with possible +* shared pmd mappings. +*/ +void adjust_range_if_pmd_sharing_possible (struct vm_area_struct *vma, +unsigned long *start,unsigned long *end) +{ +unsigned long check_addr = *start; + +if (!(vma->vm_flags &VM_MAYSHARE )) +return ; + +for (check_addr = *start; check_addr < *end; check_addr +=PUD_SIZE ) { +unsigned long a_start = check_addr &PUD_MASK ; +unsigned long a_end = a_start +PUD_SIZE ; + +/* +* If sharing is possible, adjust start/end if necessary. +*/ +if (range_in_vma (vma, a_start, a_end)) { +if (a_start < *start) + *start = a_start; +if (a_end > *end) + *end = a_end; + } + } +} +/* * Search for a shareable pmd page for hugetlb. In any case calls pmd_alloc() * and returns the corresponding pte. While this is not necessary for the
@@ -3751,6 +3779,11 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud) {return NULL ; } + +void adjust_range_if_pmd_sharing_possible (struct vm_area_struct *vma, +unsigned long *start,unsigned long *end) +{ +}#define want_pmd_share () (0)#endif /* CONFIG_ARCH_WANT_HUGE_PMD_SHARE */
mm/memory_hotplug.c +17 -29
70 lines not on this page · raw message
mm/rmap.c +67 -25
120 lines not on this page · raw message
net/9p/client.c +21 -0
@@ -155,6 +155,12 @@ static int parse_opts(char *opts, struct p9_client *clnt) ret = r;continue ; } +if (option <4096 ) { +p9_debug (P9_DEBUG_ERROR , +"msize should be at least 4k\n" ); + ret = -EINVAL ; +continue ; + } clnt->msize = option;break ;case Opt_trans:
@@ -980,10 +986,18 @@ static int p9_client_version(struct p9_client *c)else if (!strncmp (version,"9P2000" ,6 )) c->proto_version = p9_proto_legacy;else { +p9_debug (P9_DEBUG_ERROR , +"server returned an unknown version: %s\n" , version); err = -EREMOTEIO ; goto error; } +if (msize <4096 ) { +p9_debug (P9_DEBUG_ERROR , +"server returned a msize < 4096: %d\n" , msize); + err = -EREMOTEIO ; + goto error; + }if (msize < c->msize) c->msize = msize;
@@ -1048,6 +1062,13 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)if (clnt->msize > clnt->trans_mod->maxsize) clnt->msize = clnt->trans_mod->maxsize; +if (clnt->msize <4096 ) { +p9_debug (P9_DEBUG_ERROR , +"Please specify a msize of at least 4k\n" ); + err = -EINVAL ; + goto close_trans; + } + err =p9_client_version (clnt);if (err) goto close_trans;
net/sunrpc/auth_gss/svcauth_gss.c +4 -4
@@ -1103,7 +1103,7 @@ static int svcauth_gss_legacy_init(struct svc_rqst *rqstp,struct kvec *resv = &rqstp->rq_res.head[0 ];struct rsi *rsip, rsikey;int ret; -struct sunrpc_net *sn =net_generic (rqstp->rq_xprt->xpt_net, sunrpc_net_id); +struct sunrpc_net *sn =net_generic (SVC_NET (rqstp), sunrpc_net_id);memset (&rsikey,0 ,sizeof (rsikey)); ret = gss_read_verf(gc, argv, authp,
@@ -1214,7 +1214,7 @@ static int svcauth_gss_proxy_init(struct svc_rqst *rqstp,uint64_t handle;int status;int ret; -struct net *net = rqstp->rq_xprt->xpt_net; +struct net *net =SVC_NET (rqstp);struct sunrpc_net *sn =net_generic (net, sunrpc_net_id);memset (&ud,0 ,sizeof (ud));
@@ -1404,7 +1404,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)__be32 *rpcstart;__be32 *reject_stat = resv->iov_base + resv->iov_len;int ret; -struct sunrpc_net *sn =net_generic (rqstp->rq_xprt->xpt_net, sunrpc_net_id); +struct sunrpc_net *sn =net_generic (SVC_NET (rqstp), sunrpc_net_id);dprintk ("RPC: svcauth_gss: argv->iov_len = %zd\n" , argv->iov_len);
@@ -1692,7 +1692,7 @@ svcauth_gss_release(struct svc_rqst *rqstp)struct rpc_gss_wire_cred *gc = &gsd->clcred;struct xdr_buf *resbuf = &rqstp->rq_res;int stat = -EINVAL ; -struct sunrpc_net *sn =net_generic (rqstp->rq_xprt->xpt_net, sunrpc_net_id); +struct sunrpc_net *sn =net_generic (SVC_NET (rqstp), sunrpc_net_id);if (gc->gc_proc !=RPC_GSS_PROC_DATA ) goto out;
net/sunrpc/cache.c +8 -1
@@ -50,6 +50,10 @@ static void cache_init(struct cache_head *h) h->last_refresh = now; } +static void cache_fresh_locked (struct cache_head *head,time_t expiry); +static void cache_fresh_unlocked (struct cache_head *head, +struct cache_detail *detail); +struct cache_head *sunrpc_cache_lookup (struct cache_detail *detail,struct cache_head *key,int hash) {
@@ -94,6 +98,7 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail, *hp = tmp->next; tmp->next =NULL ; detail->entries --; +cache_fresh_locked (tmp,0 ); freeme = tmp;break ; }
@@ -109,8 +114,10 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,cache_get (new);write_unlock (&detail->hash_lock); -if (freeme) +if (freeme) { +cache_fresh_unlocked (freeme, detail);cache_put (freeme, detail); + }return new; }EXPORT_SYMBOL_GPL (sunrpc_cache_lookup);
sound/core/pcm.c +2 -0
@@ -25,6 +25,7 @@#include <linux/time.h> #include <linux/mutex.h> #include <linux/device.h> +#include <linux/nospec.h> #include <sound/core.h> #include <sound/minors.h> #include <sound/pcm.h>
@@ -126,6 +127,7 @@ static int snd_pcm_control_ioctl(struct snd_card *card,return -EFAULT ;if (stream <0 || stream >1 )return -EINVAL ; + stream =array_index_nospec (stream,2 );if (get_user (subdevice, &info->subdevice))return -EFAULT ;mutex_lock (®ister_mutex);
sound/pci/emu10k1/emufx.c +5 -0
@@ -36,6 +36,7 @@#include <linux/init.h> #include <linux/mutex.h> #include <linux/moduleparam.h> +#include <linux/nospec.h> #include <sound/core.h> #include <sound/tlv.h>
@@ -1001,6 +1002,8 @@ static int snd_emu10k1_ipcm_poke(struct snd_emu10k1 *emu,if (ipcm->substream >=EMU10K1_FX8010_PCM_COUNT )return -EINVAL ; + ipcm->substream =array_index_nospec (ipcm->substream, +EMU10K1_FX8010_PCM_COUNT );if (ipcm->channels >32 )return -EINVAL ; pcm = &emu->fx8010.pcm[ipcm->substream];
@@ -1047,6 +1050,8 @@ static int snd_emu10k1_ipcm_peek(struct snd_emu10k1 *emu,if (ipcm->substream >=EMU10K1_FX8010_PCM_COUNT )return -EINVAL ; + ipcm->substream =array_index_nospec (ipcm->substream, +EMU10K1_FX8010_PCM_COUNT ); pcm = &emu->fx8010.pcm[ipcm->substream];mutex_lock (&emu->fx8010.lock);spin_lock_irq (&emu->reg_lock);
sound/pci/hda/hda_tegra.c +1 -0
@@ -261,6 +261,7 @@ static int hda_tegra_suspend(struct device *dev)snd_hda_suspend (chip->bus);azx_stop_chip (chip); +synchronize_irq (chip->irq);azx_enter_link_reset (chip);hda_tegra_disable_clocks (hda);
sound/pci/rme9652/hdsp.c +6 -4
@@ -29,6 +29,7 @@#include <linux/module.h> #include <linux/math64.h> #include <linux/vmalloc.h> +#include <linux/nospec.h> #include <sound/core.h> #include <sound/control.h>
@@ -4129,15 +4130,16 @@ static int snd_hdsp_channel_info(struct snd_pcm_substream *substream, struct snd_pcm_channel_info *info) {struct hdsp *hdsp =snd_pcm_substream_chip (substream); -int mapped_channel; +unsigned int channel = info->channel; -if (snd_BUG_ON (info->channel >= hdsp->max_channels)) +if (snd_BUG_ON (channel >= hdsp->max_channels))return -EINVAL ; + channel =array_index_nospec (channel, hdsp->max_channels); -if ((mapped_channel = hdsp->channel_map[info->channel]) <0 ) +if (hdsp->channel_map[channel] <0 )return -EINVAL ; - info->offset = mapped_channel *HDSP_CHANNEL_BUFFER_BYTES ; + info->offset = hdsp->channel_map[channel] *HDSP_CHANNEL_BUFFER_BYTES ; info->first =0 ; info->step =32 ;return 0 ;
sound/synth/emux/emux_hwdep.c +5 -2
@@ -22,9 +22,9 @@#include <sound/core.h> #include <sound/hwdep.h> #include <asm/uaccess.h> +#include <linux/nospec.h> #include "emux_voice.h" -#define TMP_CLIENT_ID 0x1001/*
@@ -66,13 +66,16 @@ snd_emux_hwdep_misc_mode(struct snd_emux *emu, void __user *arg)return -EFAULT ;if (info.mode <0 || info.mode >=EMUX_MD_END )return -EINVAL ; + info.mode =array_index_nospec (info.mode,EMUX_MD_END );if (info.port <0 ) {for (i =0 ; i < emu->num_ports; i++) emu->portptrs[i]->ctrls[info.mode] = info.value; }else { -if (info.port < emu->num_ports) +if (info.port < emu->num_ports) { + info.port =array_index_nospec (info.port, emu->num_ports); emu->portptrs[info.port]->ctrls[info.mode] = info.value; + } }return 0 ; }
tools/lib/lockdep/include/liblockdep/rwlock.h +3 -3
@@ -59,10 +59,10 @@ static inline int liblockdep_pthread_rwlock_tryrdlock(liblockdep_pthread_rwlock_return pthread_rwlock_tryrdlock (&lock->rwlock) ==0 ?1 :0 ; } -static inline int liblockdep_pthread_rwlock_trywlock (liblockdep_pthread_rwlock_t *lock) +static inline int liblockdep_pthread_rwlock_trywrlock (liblockdep_pthread_rwlock_t *lock) {lock_acquire (&lock->dep_map,0 ,1 ,0 ,1 ,NULL , (unsigned long )_RET_IP_); -return pthread_rwlock_trywlock (&lock->rwlock) ==0 ?1 :0 ; +return pthread_rwlock_trywrlock (&lock->rwlock) ==0 ?1 :0 ; }static inline int liblockdep_rwlock_destroy (liblockdep_pthread_rwlock_t *lock)
@@ -78,7 +78,7 @@ static inline int liblockdep_rwlock_destroy(liblockdep_pthread_rwlock_t *lock)#define pthread_rwlock_unlock liblockdep_pthread_rwlock_unlock#define pthread_rwlock_wrlock liblockdep_pthread_rwlock_wrlock#define pthread_rwlock_tryrdlock liblockdep_pthread_rwlock_tryrdlock -#define pthread_rwlock_trywlock liblockdep_pthread_rwlock_trywlock +#define pthread_rwlock_trywrlock liblockdep_pthread_rwlock_trywrlock#define pthread_rwlock_destroy liblockdep_rwlock_destroy#endif
tools/perf/builtin-help.c +1 -1
@@ -166,7 +166,7 @@ static void add_man_viewer(const char *name)while (*p) p = &((*p)->next); *p =zalloc (sizeof (**p) + len +1 ); -strncpy ((*p)->name, name, len); +strcpy ((*p)->name, name); }static int supported_man_viewer (const char *name,size_t len)
tools/perf/ui/tui/helpline.c +1 -1
@@ -22,7 +22,7 @@ static void tui_helpline__push(const char *msg)SLsmg_set_color (0 );SLsmg_write_nstring ((char *)msg, SLtt_Screen_Cols);SLsmg_refresh (); -strncpy (ui_helpline__current, msg, sz)[sz -1 ] ='\0' ; +strlcpy (ui_helpline__current, msg, sz); }static int tui_helpline__show (const char *format,va_list ap)
tools/perf/util/parse-events.c +1 -1
@@ -1217,7 +1217,7 @@ static void print_symbol_events(const char *event_glob, unsigned type,if (strlen (syms->alias))snprintf (name,MAX_NAME_LEN ,"%s OR %s" , syms->symbol, syms->alias);else -strncpy (name, syms->symbol,MAX_NAME_LEN ); +strlcpy (name, syms->symbol,MAX_NAME_LEN );printf (" %-50s [%s]\n" , name, event_type_descriptors[type]);
tools/perf/util/pmu.c +2 -2
@@ -107,7 +107,7 @@ static int perf_pmu__parse_scale(struct perf_pmu_alias *alias, char *dir, char *char path[PATH_MAX ];const char *lc; -snprintf (path,PATH_MAX ,"%s/%s.scale" , dir, name); +scnprintf (path,PATH_MAX ,"%s/%s.scale" , dir, name); fd =open (path,O_RDONLY );if (fd ==-1 )
@@ -150,7 +150,7 @@ static int perf_pmu__parse_unit(struct perf_pmu_alias *alias, char *dir, char *nssize_t sret;int fd; -snprintf (path,PATH_MAX ,"%s/%s.unit" , dir, name); +scnprintf (path,PATH_MAX ,"%s/%s.unit" , dir, name); fd =open (path,O_RDONLY );if (fd ==-1 )
tools/perf/util/svghelper.c +1 -1
@@ -257,7 +257,7 @@ static char *cpu_model(void)if (file) {while (fgets (buf,255 , file)) {if (strstr (buf,"model name" )) { -strncpy (cpu_m, &buf[13 ],255 ); +strlcpy (cpu_m, &buf[13 ],255 );break ; } }
virt/kvm/kvm_main.c +21 -19
@@ -1555,31 +1555,33 @@ int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc,gfn_t end_gfn = (gpa + len -1 ) >>PAGE_SHIFT ;gfn_t nr_pages_needed = end_gfn - start_gfn +1 ;gfn_t nr_pages_avail; +int r = start_gfn <= end_gfn ?0 : -EINVAL ; ghc->gpa = gpa; ghc->generation = slots->generation; ghc->len = len; - ghc->memslot =gfn_to_memslot (kvm, start_gfn); - ghc->hva =gfn_to_hva_many (ghc->memslot, start_gfn,NULL ); -if (!kvm_is_error_hva (ghc->hva) && nr_pages_needed <=1 ) { + ghc->hva =KVM_HVA_ERR_BAD ; + +/* +* If the requested region crosses two memslots, we still +* verify that the entire region is valid here. +*/ +while (!r && start_gfn <= end_gfn) { + ghc->memslot =gfn_to_memslot (kvm, start_gfn); + ghc->hva =gfn_to_hva_many (ghc->memslot, start_gfn, + &nr_pages_avail); +if (kvm_is_error_hva (ghc->hva)) + r = -EFAULT ; + start_gfn += nr_pages_avail; + } + +/* Use the slow path for cross page reads and writes. */ +if (!r && nr_pages_needed ==1 ) ghc->hva += offset; - }else { -/* -* If the requested region crosses two memslots, we still -* verify that the entire region is valid here. -*/ -while (start_gfn <= end_gfn) { - ghc->memslot =gfn_to_memslot (kvm, start_gfn); - ghc->hva =gfn_to_hva_many (ghc->memslot, start_gfn, - &nr_pages_avail); -if (kvm_is_error_hva (ghc->hva)) -return -EFAULT ; - start_gfn += nr_pages_avail; - } -/* Use the slow path for cross page reads and writes. */ +else ghc->memslot =NULL ; - } -return 0 ; + +return r; }EXPORT_SYMBOL_GPL (kvm_gfn_to_hva_cache_init);