Skip to contentSkip to conversation

Linux 4.4.172

DISCUSSION Greg KH 1 participant 2 messages Jan 26, 2019 Stable branch

lore
Share & tools
lore

Greg KH

author maintainer
#0 lore raw

I'm announcing the release of the 4.4.172 kernel.

All users of the 4.4 kernel series must upgrade.

The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.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

------------

 Documentation/filesystems/proc.txt               |    4 
 Makefile                                         |    2 
 arch/arm64/include/asm/kvm_arm.h                 |    3 
 arch/arm64/kernel/head.S                         |    3 
 arch/arm64/kernel/perf_event.c                   |    1 
 arch/arm64/kvm/hyp.S                             |    2 
 arch/mips/Kconfig                                |    4 
 arch/mips/pci/msi-octeon.c                       |    4 
 arch/mips/sibyte/common/Makefile                 |    1 
 arch/mips/sibyte/common/dma.c                    |   14 +
 crypto/authenc.c                                 |   14 +
 crypto/authencesn.c                              |    2 
 drivers/base/bus.c                               |    7 
 drivers/block/loop.c                             |   79 +++++-----
 drivers/block/loop.h                             |    1 
 drivers/char/ipmi/ipmi_ssif.c                    |   25 ++-
 drivers/clk/imx/clk-imx6q.c                      |    6 
 drivers/cpuidle/cpuidle-pseries.c                |    8 -
 drivers/gpu/drm/drm_fb_helper.c                  |    7 
 drivers/md/dm-kcopyd.c                           |   19 +-
 drivers/md/dm-snap.c                             |   22 +++
 drivers/media/firewire/firedtv-avc.c             |    6 
 drivers/media/firewire/firedtv.h                 |    6 
 drivers/media/platform/vivid/vivid-kthread-cap.c |    5 
 drivers/media/platform/vivid/vivid-kthread-out.c |    5 
 drivers/media/platform/vivid/vivid-vid-common.c  |    2 
 drivers/media/usb/em28xx/em28xx-video.c          |    4 
 drivers/media/v4l2-core/videobuf2-core.c         |   14 +
 drivers/mfd/tps6586x.c                           |   24 +++
 drivers/mmc/host/atmel-mci.c                     |    3 
 drivers/net/ethernet/intel/e1000e/ptp.c          |   13 +
 drivers/net/ethernet/realtek/r8169.c             |    2 
 drivers/platform/x86/asus-wmi.c                  |    3 
 drivers/scsi/megaraid/megaraid_sas_fp.c          |    2 
 drivers/scsi/megaraid/megaraid_sas_fusion.c      |    2 
 drivers/scsi/sd.c                                |    6 
 drivers/target/target_core_spc.c                 |   17 +-
 drivers/tty/tty_ldsem.c                          |   10 +
 drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c  |    2 
 fs/btrfs/disk-io.c                               |    8 +
 fs/f2fs/checkpoint.c                             |  168 ++++++++++++-----------
 fs/f2fs/data.c                                   |  118 +++++++++-------
 fs/f2fs/dir.c                                    |   87 ++++++-----
 fs/f2fs/f2fs.h                                   |   77 ++++++++--
 fs/f2fs/file.c                                   |   21 ++
 fs/f2fs/inline.c                                 |  115 +++++++++++++++
 fs/f2fs/inode.c                                  |   68 ++++++++-
 fs/f2fs/node.c                                   |  103 ++++++++------
 fs/f2fs/node.h                                   |   77 ++++++----
 fs/f2fs/recovery.c                               |  165 +++++++++++-----------
 fs/f2fs/segment.c                                |   93 ++++++------
 fs/f2fs/segment.h                                |   48 +++++-
 fs/f2fs/super.c                                  |  134 +++++++++++++++---
 fs/jffs2/super.c                                 |    3 
 fs/ocfs2/localalloc.c                            |    9 -
 fs/proc/array.c                                  |    2 
 fs/pstore/ram_core.c                             |    5 
 fs/xfs/libxfs/xfs_attr.c                         |    9 +
 include/linux/backing-dev-defs.h                 |    8 +
 include/linux/f2fs_fs.h                          |    3 
 mm/page-writeback.c                              |   35 ++--
 net/bridge/br_netfilter_hooks.c                  |    2 
 net/can/gw.c                                     |   30 +++-
 net/core/skbuff.c                                |   11 -
 net/core/sock.c                                  |    1 
 net/ipv4/ip_sockglue.c                           |   12 -
 net/ipv6/af_inet6.c                              |   14 +
 net/ipv6/datagram.c                              |   11 -
 net/packet/af_packet.c                           |    4 
 net/sctp/ipv6.c                                  |    5 
 net/sctp/protocol.c                              |    4 
 net/sunrpc/rpcb_clnt.c                           |    8 +
 net/tipc/netlink_compat.c                        |   50 ++++++
 scripts/kconfig/zconf.l                          |    4 
 security/security.c                              |    7 
 security/selinux/ss/policydb.c                   |    3 
 security/yama/yama_lsm.c                         |    4 
 sound/firewire/bebob/bebob.c                     |    2 
 tools/perf/arch/x86/util/intel-pt.c              |   11 +
 tools/perf/util/parse-events.c                   |    2 
 tools/perf/util/svghelper.c                      |    2 
 81 files changed, 1334 insertions(+), 563 deletions(-)

Adrian Hunter (1):
perf intel-pt: Fix error with config term "pt=0"

Anders Roxell (2):
writeback: don't decrement wb->refcnt if !wb->bdi
arm64: perf: set suppress_bind_attrs flag to true

Arnaldo Carvalho de Melo (2):
perf svghelper: Fix unchecked usage of strncpy() perf parse-events: Fix unchecked usage of strncpy()

Arnd Bergmann (1):
mips: fix n32 compat_ipc_parse_version

Ben Hutchings (2):
f2fs: Add sanity_check_inode() function
media: em28xx: Fix misplaced reset of dev->v4l::field_count

Breno Leitao (1):
powerpc/pseries/cpuidle: Fix preempt warning

Brian Foster (1):

      mm/page-writeback.c: don't break integrity writeback on ->writepage() error

Chao Yu (17):
f2fs: clean up argument of recover_data
f2fs: fix to convert inline directory correctly
f2fs: factor out fsync inode entry operations
f2fs: fix inode cache leak
f2fs: fix to avoid reading out encrypted data in page cache
f2fs: avoid unneeded loop in build_sit_entries
f2fs: fix race condition in between free nid allocator/initializer
f2fs: clean up with is_valid_blkaddr()
f2fs: introduce and spread verify_blkaddr
f2fs: fix to do sanity check with secs_per_zone
f2fs: fix to do sanity check with user_block_count
f2fs: fix to do sanity check with node footer and iblocks
f2fs: fix to do sanity check with reserved blkaddr of inline inode
f2fs: fix to do sanity check with block address in main area
f2fs: fix to do sanity check with block address in main area v2
f2fs: fix to do sanity check with cp_pack_start_sum
f2fs: fix invalid memory access

Corey Minyard (1):
ipmi:ssif: Fix handling of multi-part return messages

Daniel Santos (1):
jffs2: Fix use of uninitialized delayed_work, lockdep breakage

Daniel Vetter (1):
sysfs: Disable lockdep for driver bind/unbind files

Darrick J. Wong (1):
xfs: don't fail when converting shortform attr to long form during ATTR_REPLACE

David Ahern (2):
ipv6: Consider sk_bound_dev_if when binding a socket to a v4 mapped address
ipv6: Take rcu_read_lock in __inet6_bind for mapped addresses

David Disseldorp (1):
scsi: target: use consistent left-aligned ASCII INQUIRY data

Dmitry Safonov (1):
tty/ldsem: Wake up readers after timed out down_write()

Eric Biggers (1):
crypto: authenc - fix parsing key with misaligned rta_len

Eric Dumazet (2):
ipv6: fix kernel-infoleak in ipv6_local_error()
net: speed up skb_rbtree_purge()

Greg Kroah-Hartman (1):

      Linux 4.4.172

Gwendal Grignou (1):
proc: Remove empty line in /proc/self/status

Hans Verkuil (3):
media: vivid: fix error handling of kthread_run
media: vivid: set min width/height to a value > 0
media: vb2: vb2_mmap: move lock up

Harsh Jain (1):
crypto: authencesn - Avoid twice completion call in decrypt path

Ivan Mironov (2):
scsi: sd: Fix cache_type_store()
drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock

J. Bruce Fields (1):
sunrpc: handle ENOMEM in rpcb_getport_async

Jaegeuk Kim (12):
f2fs: cover more area with nat_tree_lock
f2fs: give -EINVAL for norecovery and rw mount
f2fs: remove an obsolete variable
f2fs: use crc and cp version to determine roll-forward recovery
f2fs: put directory inodes before checkpoint in roll-forward recovery
f2fs: fix to determine start_cp_addr by sbi->cur_cp_pack
f2fs: detect wrong layout
f2fs: free meta pages if sanity check for ckpt is failed
f2fs: return error during fill_super
f2fs: sanity check on sit entry
f2fs: enhance sanity_check_raw_super() to avoid potential overflow
f2fs: fix missing up_read

James Morris (1):
LSM: Check for NULL cred-security on free

Jan Kara (2):
loop: Fold __loop_release into loop_release
loop: Get rid of loop_index_mutex

Jason Gunthorpe (1):
packet: Do not leak dev refcounts on error exit

JianJhen Chen (1):
net: bridge: fix a bug on using a neighbour cache entry without checking its state

Joel Fernandes (Google) (1):
pstore/ram: Do not treat empty buffers as valid

Jonas Danielsson (1):
mmc: atmel-mci: do not assume idle after atmci_request_end

Jonathan Hunter (1):
mfd: tps6586x: Handle interrupts on suspend

Josef Bacik (1):
btrfs: wait on ordered extents on abort cleanup

João Paulo Rechi Vita (1):
platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey

Junxiao Bi (1):
ocfs2: fix panic due to unrecovered local alloc

Kai-Heng Feng (1):
r8169: Add support for new Realtek Ethernet

Kees Cook (1):
Yama: Check for pid death before checking ancestry

Lucas Stach (1):
clk: imx6q: reset exclusive gates on init

Maciej W. Rozycki (1):
MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur

Mark Rutland (2):
arm64/kvm: consistently handle host HCR_EL2 flags
arm64: Don't trap host pointer auth use to EL2

Martin Blumenstingl (1):
f2fs: fix validation of the block count in sanity_check_raw_super

Masahiro Yamada (2):
kconfig: fix file name and line number of warn_ignored_character()
kconfig: fix memory leak when EOF is encountered in quotation

Mauro Carvalho Chehab (1):
media: vb2: be sure to unlock mutex on errors

Michal Hocko (1):
mm, proc: be more verbose about unstable VMA flags in /proc/<pid>/smaps

Miroslav Lichvar (1):
e1000e: allow non-monotonic SYSTIM readings

Nathan Chancellor (1):
media: firewire: Fix app_info parameter type in avc_ca{,_app}_info

Nikos Tsironis (2):
dm kcopyd: Fix bug causing workqueue stalls
dm snapshot: Fix excessive memory usage and workqueue stalls

Oliver Hartkopp (1):
can: gw: ensure DLC boundaries after CAN frame modification

Qian Cai (1):
scsi: megaraid: fix out-of-bound array accesses

Shawn Lin (1):
f2fs: move sanity checking of cp into get_valid_checkpoint

Stephen Smalley (1):
selinux: fix GPF on invalid policy

Takashi Sakamoto (1):
ALSA: bebob: fix model-id of unit for Apogee Ensemble

Tetsuo Handa (2):
block/loop: Use global lock for ioctl() operation.
loop: Fix double mutex_unlock(&loop_ctl_mutex) in loop_control_ioctl()

Tiezhu Yang (1):
f2fs: introduce get_checkpoint_version for cleanup

Vlad Tsyrklevich (1):
omap2fb: Fix stack memory disclosure

Willem de Bruijn (1):
ip: on queued skb use skb_header_pointer instead of pskb_may_pull

Xin Long (1):
sctp: allocate sctp_sockaddr_entry with kzalloc

Ying Xue (5):
tipc: fix uninit-value in tipc_nl_compat_link_reset_stats
tipc: fix uninit-value in tipc_nl_compat_bearer_enable
tipc: fix uninit-value in tipc_nl_compat_link_set
tipc: fix uninit-value in tipc_nl_compat_name_table_dump
tipc: fix uninit-value in tipc_nl_compat_doit

YunQiang Su (1):
Disable MSI also when pcie-octeon.pcie_disable on

Yunlei He (2):
f2fs: not allow to write illegal blkaddr
f2fs: check blkaddr more accuratly before issue a bio

yupeng (1):
net: call sk_dst_reset when set SO_DONTROUTE

author maintainer
#1 lore raw
Documentation/filesystems/proc.txt +3 -1
index 6d2689ebf824..5b87946a53a3 100644
@@ -466,7 +466,9 @@ manner. The codes are the following:
 
 Note that there is no guarantee that every flag and associated mnemonic will
 be present in all further kernel releases. Things get changed, the flags may
-be vanished or the reverse -- new added.
+be vanished or the reverse -- new added. Interpretation of their meaning
+might change in future as well. So each consumer of these flags has to
+follow each specific kernel version for the exact semantic.
 
 This file is only present if the CONFIG_MMU kernel configuration option is
 enabled.
Makefile +1 -1
index c6b680faedd8..2aa8db459a74 100644
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 4
-SUBLEVEL = 171
+SUBLEVEL = 172
 EXTRAVERSION =
 NAME = Blurry Fish Butt
 
arch/arm64/include/asm/kvm_arm.h +3 -0
index ef8e13d379cb..d7e7cf56e8d6 100644
@@ -23,6 +23,8 @@
 #include <asm/types.h>
 
 /* Hyp Configuration Register (HCR) bits */
+#define HCR_API		(UL(1) << 41)
+#define HCR_APK		(UL(1) << 40)
 #define HCR_ID		(UL(1) << 33)
 #define HCR_CD		(UL(1) << 32)
 #define HCR_RW_SHIFT	31
@@ -81,6 +83,7 @@
 			 HCR_AMO | HCR_SWIO | HCR_TIDCP | HCR_RW)
 #define HCR_VIRT_EXCP_MASK (HCR_VA | HCR_VI | HCR_VF)
 #define HCR_INT_OVERRIDE   (HCR_FMO | HCR_IMO)
+#define HCR_HOST_NVHE_FLAGS (HCR_RW | HCR_API | HCR_APK)
 
 
 /* Hyp System Control Register (SCTLR_EL2) bits */
arch/arm64/kernel/head.S +2 -1
index d019c3a58cc2..0382eba4bf7b 100644
@@ -30,6 +30,7 @@
 #include <asm/cache.h>
 #include <asm/cputype.h>
 #include <asm/kernel-pgtable.h>
+#include <asm/kvm_arm.h>
 #include <asm/memory.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/pgtable.h>
@@ -464,7 +465,7 @@ CPU_LE(	bic	x0, x0, #(3 << 24)	)	// Clear the EE and E0E bits for EL1
 	ret
 
 	/* Hyp configuration. */
-2:	mov	x0, #(1 << 31)			// 64-bit EL1
+2:	mov_q	x0, HCR_HOST_NVHE_FLAGS
 	msr	hcr_el2, x0
 
 	/* Generic timers. */
arch/arm64/kernel/perf_event.c +1 -0
index 62d3dc60ca09..e99a0ed7e66b 100644
@@ -670,6 +670,7 @@ static struct platform_driver armv8_pmu_driver = {
 	.driver		= {
 		.name	= "armv8-pmu",
 		.of_match_table = armv8_pmu_of_device_ids,
+		.suppress_bind_attrs = true,
 	},
 	.probe		= armv8_pmu_device_probe,
 };
arch/arm64/kvm/hyp.S +1 -1
index 86c289832272..8d3da858c257 100644
@@ -494,7 +494,7 @@
 .endm
 
 .macro deactivate_traps
-	mov	x2, #HCR_RW
+	mov_q	x2, HCR_HOST_NVHE_FLAGS
 	msr	hcr_el2, x2
 	msr	hstr_el2, xzr
 
arch/mips/Kconfig +4 -0
index 8b0424abc84c..333ea0389adb 100644
@@ -760,6 +760,7 @@ config SIBYTE_SWARM
 	select SYS_SUPPORTS_HIGHMEM
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 	select ZONE_DMA32 if 64BIT
+	select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI
 
 config SIBYTE_LITTLESUR
 	bool "Sibyte BCM91250C2-LittleSur"
@@ -782,6 +783,7 @@ config SIBYTE_SENTOSA
 	select SYS_HAS_CPU_SB1
 	select SYS_SUPPORTS_BIG_ENDIAN
 	select SYS_SUPPORTS_LITTLE_ENDIAN
+	select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI
 
 config SIBYTE_BIGSUR
 	bool "Sibyte BCM91480B-BigSur"
@@ -795,6 +797,7 @@ config SIBYTE_BIGSUR
 	select SYS_SUPPORTS_HIGHMEM
 	select SYS_SUPPORTS_LITTLE_ENDIAN
 	select ZONE_DMA32 if 64BIT
+	select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI
 
 config SNI_RM
 	bool "SNI RM200/300/400"
@@ -2972,6 +2975,7 @@ config MIPS32_O32
 config MIPS32_N32
 	bool "Kernel support for n32 binaries"
 	depends on 64BIT
+	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
 	select COMPAT
 	select MIPS32_COMPAT
 	select SYSVIPC_COMPAT if SYSVIPC
arch/mips/pci/msi-octeon.c +3 -1
index 2a5bb849b10e..288b58b00dc8 100644
@@ -369,7 +369,9 @@ int __init octeon_msi_initialize(void)
 	int irq;
 	struct irq_chip *msi;
 
-	if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
+	if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_INVALID) {
+		return 0;
+	} else if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
 		msi_rcv_reg[0] = CVMX_PEXP_NPEI_MSI_RCV0;
 		msi_rcv_reg[1] = CVMX_PEXP_NPEI_MSI_RCV1;
 		msi_rcv_reg[2] = CVMX_PEXP_NPEI_MSI_RCV2;
arch/mips/sibyte/common/Makefile +1 -0
index b3d6bf23a662..3ef3fb658136 100644
@@ -1,4 +1,5 @@
 obj-y := cfe.o
+obj-$(CONFIG_SWIOTLB)			+= dma.o
 obj-$(CONFIG_SIBYTE_BUS_WATCHER)	+= bus_watcher.o
 obj-$(CONFIG_SIBYTE_CFE_CONSOLE)	+= cfe_console.o
 obj-$(CONFIG_SIBYTE_TBPROF)		+= sb_tbprof.o
arch/mips/sibyte/common/dma.c new file +14 -0
new file mode 100644
index 000000000000..eb47a94f3583
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *	DMA support for Broadcom SiByte platforms.
+ *
+ *	Copyright (c) 2018  Maciej W. Rozycki
+ */
+
+#include <linux/swiotlb.h>
+#include <asm/bootinfo.h>
+
+void __init plat_swiotlb_setup(void)
+{
+	swiotlb_init(1);
+}
crypto/authenc.c +11 -3
index b7290c5b1eaa..5c25005ff398 100644
@@ -58,14 +58,22 @@ int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key,
 		return -EINVAL;
 	if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM)
 		return -EINVAL;
-	if (RTA_PAYLOAD(rta) < sizeof(*param))
+
+	/*
+	 * RTA_OK() didn't align the rtattr's payload when validating that it
+	 * fits in the buffer.  Yet, the keys should start on the next 4-byte
+	 * aligned boundary.  To avoid confusion, require that the rtattr
+	 * payload be exactly the param struct, which has a 4-byte aligned size.
+	 */
+	if (RTA_PAYLOAD(rta) != sizeof(*param))
 		return -EINVAL;
+	BUILD_BUG_ON(sizeof(*param) % RTA_ALIGNTO);
 
 	param = RTA_DATA(rta);
 	keys->enckeylen = be32_to_cpu(param->enckeylen);
 
-	key += RTA_ALIGN(rta->rta_len);
-	keylen -= RTA_ALIGN(rta->rta_len);
+	key += rta->rta_len;
+	keylen -= rta->rta_len;
 
 	if (keylen < keys->enckeylen)
 		return -EINVAL;
crypto/authencesn.c +1 -1
index fa0c4567f697..5fdf3e532310 100644
@@ -276,7 +276,7 @@ static void authenc_esn_verify_ahash_done(struct crypto_async_request *areq,
 	struct aead_request *req = areq->data;
 
 	err = err ?: crypto_authenc_esn_decrypt_tail(req, 0);
-	aead_request_complete(req, err);
+	authenc_esn_request_complete(req, err);
 }
 
 static int crypto_authenc_esn_decrypt(struct aead_request *req)
drivers/base/bus.c +5 -2
index 0346e46e2871..ecca4ae248e0 100644
@@ -33,6 +33,9 @@ static struct kset *system_kset;
 
 #define to_drv_attr(_attr) container_of(_attr, struct driver_attribute, attr)
 
+#define DRIVER_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \
+	struct driver_attribute driver_attr_##_name =		\
+		__ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store)
 
 static int __must_check bus_rescan_devices_helper(struct device *dev,
 						void *data);
@@ -198,7 +201,7 @@ static ssize_t unbind_store(struct device_driver *drv, const char *buf,
 	bus_put(bus);
 	return err;
 }
-static DRIVER_ATTR_WO(unbind);
+static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, S_IWUSR, NULL, unbind_store);
 
 /*
  * Manually attach a device to a driver.
@@ -234,7 +237,7 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf,
 	bus_put(bus);
 	return err;
 }
-static DRIVER_ATTR_WO(bind);
+static DRIVER_ATTR_IGNORE_LOCKDEP(bind, S_IWUSR, NULL, bind_store);
 
 static ssize_t show_drivers_autoprobe(struct bus_type *bus, char *buf)
 {
drivers/block/loop.c +38 -41

218 lines not on this page · raw message

drivers/block/loop.h +0 -1
index 60f0fd2c0c65..a923e74495ce 100644
@@ -55,7 +55,6 @@ struct loop_device {
 
 	spinlock_t		lo_lock;
 	int			lo_state;
-	struct mutex		lo_ctl_mutex;
 	struct kthread_worker	worker;
 	struct task_struct	*worker_task;
 	bool			use_dio;
drivers/char/ipmi/ipmi_ssif.c +17 -8
index 7a2e23d6bfdd..b2da2382d544 100644
@@ -637,8 +637,9 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
 
 		/* Remove the multi-part read marker. */
 		len -= 2;
+		data += 2;
 		for (i = 0; i < len; i++)
-			ssif_info->data[i] = data[i+2];
+			ssif_info->data[i] = data[i];
 		ssif_info->multi_len = len;
 		ssif_info->multi_pos = 1;
 
@@ -666,8 +667,19 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
 		}
 
 		blocknum = data[0];
+		len--;
+		data++;
+
+		if (blocknum != 0xff && len != 31) {
+		    /* All blocks but the last must have 31 data bytes. */
+			result = -EIO;
+			if (ssif_info->ssif_debug & SSIF_DEBUG_MSG)
+				pr_info("Received middle message <31\n");
 
-		if (ssif_info->multi_len + len - 1 > IPMI_MAX_MSG_LENGTH) {
+			goto continue_op;
+		}
+
+		if (ssif_info->multi_len + len > IPMI_MAX_MSG_LENGTH) {
 			/* Received message too big, abort the operation. */
 			result = -E2BIG;
 			if (ssif_info->ssif_debug & SSIF_DEBUG_MSG)
@@ -676,16 +688,14 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
 			goto continue_op;
 		}
 
-		/* Remove the blocknum from the data. */
-		len--;
 		for (i = 0; i < len; i++)
-			ssif_info->data[i + ssif_info->multi_len] = data[i + 1];
+			ssif_info->data[i + ssif_info->multi_len] = data[i];
 		ssif_info->multi_len += len;
 		if (blocknum == 0xff) {
 			/* End of read */
 			len = ssif_info->multi_len;
 			data = ssif_info->data;
-		} else if (blocknum + 1 != ssif_info->multi_pos) {
+		} else if (blocknum != ssif_info->multi_pos) {
 			/*
 			 * Out of sequence block, just abort.  Block
 			 * numbers start at zero for the second block,
@@ -713,6 +723,7 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
 		}
 	}
 
+ continue_op:
 	if (result < 0) {
 		ssif_inc_stat(ssif_info, receive_errors);
 	} else {
@@ -720,8 +731,6 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
 		ssif_inc_stat(ssif_info, received_message_parts);
 	}
 
-
- continue_op:
 	if (ssif_info->ssif_debug & SSIF_DEBUG_STATE)
 		pr_info(PFX "DONE 1: state = %d, result=%d.\n",
 			ssif_info->ssif_state, result);
drivers/clk/imx/clk-imx6q.c +5 -1
index a0df83e6b84b..46c05c9a9354 100644
@@ -239,8 +239,12 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
 	 * lvds1_gate and lvds2_gate are pseudo-gates.  Both can be
 	 * independently configured as clock inputs or outputs.  We treat
 	 * the "output_enable" bit as a gate, even though it's really just
-	 * enabling clock output.
+	 * enabling clock output. Initially the gate bits are cleared, as
+	 * otherwise the exclusive configuration gets locked in the setup done
+	 * by software running before the clock driver, with no way to change
+	 * it.
 	 */
+	writel(readl(base + 0x160) & ~0x3c00, base + 0x160);
 	clk[IMX6QDL_CLK_LVDS1_GATE] = imx_clk_gate_exclusive("lvds1_gate", "lvds1_sel", base + 0x160, 10, BIT(12));
 	clk[IMX6QDL_CLK_LVDS2_GATE] = imx_clk_gate_exclusive("lvds2_gate", "lvds2_sel", base + 0x160, 11, BIT(13));
 
drivers/cpuidle/cpuidle-pseries.c +7 -1
index 07135e009d8b..601a6c3acc7f 100644
@@ -240,7 +240,13 @@ static int pseries_idle_probe(void)
 		return -ENODEV;
 
 	if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
-		if (lppaca_shared_proc(get_lppaca())) {
+		/*
+		 * Use local_paca instead of get_lppaca() since
+		 * preemption is not disabled, and it is not required in
+		 * fact, since lppaca_ptr does not need to be the value
+		 * associated to the current CPU, it can be from any CPU.
+		 */
+		if (lppaca_shared_proc(local_paca->lppaca_ptr)) {
 			cpuidle_state_table = shared_states;
 			max_idle_state = ARRAY_SIZE(shared_states);
 		} else {
drivers/gpu/drm/drm_fb_helper.c +6 -1
index 5ad036741b99..e449f22c8f29 100644
@@ -1109,9 +1109,14 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
 	struct drm_framebuffer *fb = fb_helper->fb;
 	int depth;
 
-	if (var->pixclock != 0 || in_dbg_master())
+	if (in_dbg_master())
 		return -EINVAL;
 
+	if (var->pixclock != 0) {
+		DRM_DEBUG("fbdev emulation doesn't support changing the pixel clock, value of pixclock is ignored\n");
+		var->pixclock = 0;
+	}
+
 	/* Need to resize the fb object !!! */
 	if (var->bits_per_pixel > fb->bits_per_pixel ||
 	    var->xres > fb->width || var->yres > fb->height ||
drivers/md/dm-kcopyd.c +14 -5
index 54c308e6704f..04248394843e 100644
@@ -55,15 +55,17 @@ struct dm_kcopyd_client {
 	struct dm_kcopyd_throttle *throttle;
 
 /*
- * We maintain three lists of jobs:
+ * We maintain four lists of jobs:
  *
  * i)   jobs waiting for pages
  * ii)  jobs that have pages, and are waiting for the io to be issued.
- * iii) jobs that have completed.
+ * iii) jobs that don't need to do any IO and just run a callback
+ * iv) jobs that have completed.
  *
- * All three of these are protected by job_lock.
+ * All four of these are protected by job_lock.
  */
 	spinlock_t job_lock;
+	struct list_head callback_jobs;
 	struct list_head complete_jobs;
 	struct list_head io_jobs;
 	struct list_head pages_jobs;
@@ -583,6 +585,7 @@ static void do_work(struct work_struct *work)
 	struct dm_kcopyd_client *kc = container_of(work,
 					struct dm_kcopyd_client, kcopyd_work);
 	struct blk_plug plug;
+	unsigned long flags;
 
 	/*
 	 * The order that these are called is *very* important.
@@ -591,6 +594,10 @@ static void do_work(struct work_struct *work)
 	 * list.  io jobs call wake when they complete and it all
 	 * starts again.
 	 */
+	spin_lock_irqsave(&kc->job_lock, flags);
+	list_splice_tail_init(&kc->callback_jobs, &kc->complete_jobs);
+	spin_unlock_irqrestore(&kc->job_lock, flags);
+
 	blk_start_plug(&plug);
 	process_jobs(&kc->complete_jobs, kc, run_complete_job);
 	process_jobs(&kc->pages_jobs, kc, run_pages_job);
@@ -608,7 +615,7 @@ static void dispatch_job(struct kcopyd_job *job)
 	struct dm_kcopyd_client *kc = job->kc;
 	atomic_inc(&kc->nr_jobs);
 	if (unlikely(!job->source.count))
-		push(&kc->complete_jobs, job);
+		push(&kc->callback_jobs, job);
 	else if (job->pages == &zero_page_list)
 		push(&kc->io_jobs, job);
 	else
@@ -795,7 +802,7 @@ void dm_kcopyd_do_callback(void *j, int read_err, unsigned long write_err)
 	job->read_err = read_err;
 	job->write_err = write_err;
 
-	push(&kc->complete_jobs, job);
+	push(&kc->callback_jobs, job);
 	wake(kc);
 }
 EXPORT_SYMBOL(dm_kcopyd_do_callback);
@@ -825,6 +832,7 @@ struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *thro
 		return ERR_PTR(-ENOMEM);
 
 	spin_lock_init(&kc->job_lock);
+	INIT_LIST_HEAD(&kc->callback_jobs);
 	INIT_LIST_HEAD(&kc->complete_jobs);
 	INIT_LIST_HEAD(&kc->io_jobs);
 	INIT_LIST_HEAD(&kc->pages_jobs);
@@ -874,6 +882,7 @@ void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc)
 	/* Wait for completion of all jobs submitted by this client. */
 	wait_event(kc->destroyq, !atomic_read(&kc->nr_jobs));
 
+	BUG_ON(!list_empty(&kc->callback_jobs));
 	BUG_ON(!list_empty(&kc->complete_jobs));
 	BUG_ON(!list_empty(&kc->io_jobs));
 	BUG_ON(!list_empty(&kc->pages_jobs));
drivers/md/dm-snap.c +22 -0
index e108deebbaaa..5d3797728b9c 100644
@@ -19,6 +19,7 @@
 #include <linux/vmalloc.h>
 #include <linux/log2.h>
 #include <linux/dm-kcopyd.h>
+#include <linux/semaphore.h>
 
 #include "dm.h"
 
@@ -105,6 +106,9 @@ struct dm_snapshot {
 	/* The on disk metadata handler */
 	struct dm_exception_store *store;
 
+	/* Maximum number of in-flight COW jobs. */
+	struct semaphore cow_count;
+
 	struct dm_kcopyd_client *kcopyd_client;
 
 	/* Wait for events based on state_bits */
@@ -145,6 +149,19 @@ struct dm_snapshot {
 #define RUNNING_MERGE          0
 #define SHUTDOWN_MERGE         1
 
+/*
+ * Maximum number of chunks being copied on write.
+ *
+ * The value was decided experimentally as a trade-off between memory
+ * consumption, stalling the kernel's workqueues and maintaining a high enough
+ * throughput.
+ */
+#define DEFAULT_COW_THRESHOLD 2048
+
+static int cow_threshold = DEFAULT_COW_THRESHOLD;
+module_param_named(snapshot_cow_threshold, cow_threshold, int, 0644);
+MODULE_PARM_DESC(snapshot_cow_threshold, "Maximum number of chunks being copied on write");
+
 DECLARE_DM_KCOPYD_THROTTLE_WITH_MODULE_PARM(snapshot_copy_throttle,
 		"A percentage of time allocated for copy on write");
 
@@ -1190,6 +1207,8 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		goto bad_hash_tables;
 	}
 
+	sema_init(&s->cow_count, (cow_threshold > 0) ? cow_threshold : INT_MAX);
+
 	s->kcopyd_client = dm_kcopyd_client_create(&dm_kcopyd_throttle);
 	if (IS_ERR(s->kcopyd_client)) {
 		r = PTR_ERR(s->kcopyd_client);
@@ -1563,6 +1582,7 @@ static void copy_callback(int read_err, unsigned long write_err, void *context)
 		}
 		list_add(&pe->out_of_order_entry, lh);
 	}
+	up(&s->cow_count);
 }
 
 /*
@@ -1586,6 +1606,7 @@ static void start_copy(struct dm_snap_pending_exception *pe)
 	dest.count = src.count;
 
 	/* Hand over to kcopyd */
+	down(&s->cow_count);
 	dm_kcopyd_copy(s->kcopyd_client, &src, 1, &dest, 0, copy_callback, pe);
 }
 
@@ -1606,6 +1627,7 @@ static void start_full_bio(struct dm_snap_pending_exception *pe,
 	pe->full_bio_end_io = bio->bi_end_io;
 	pe->full_bio_private = bio->bi_private;
 
+	down(&s->cow_count);
 	callback_data = dm_kcopyd_prepare_callback(s->kcopyd_client,
 						   copy_callback, pe);
 
drivers/media/firewire/firedtv-avc.c +4 -2
index 251a556112a9..280b5ffea592 100644
@@ -968,7 +968,8 @@ static int get_ca_object_length(struct avc_response_frame *r)
 	return r->operand[7];
 }
 
-int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len)
+int avc_ca_app_info(struct firedtv *fdtv, unsigned char *app_info,
+		    unsigned int *len)
 {
 	struct avc_command_frame *c = (void *)fdtv->avc_data;
 	struct avc_response_frame *r = (void *)fdtv->avc_data;
@@ -1009,7 +1010,8 @@ out:
 	return ret;
 }
 
-int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len)
+int avc_ca_info(struct firedtv *fdtv, unsigned char *app_info,
+		unsigned int *len)
 {
 	struct avc_command_frame *c = (void *)fdtv->avc_data;
 	struct avc_response_frame *r = (void *)fdtv->avc_data;
drivers/media/firewire/firedtv.h +4 -2
index 345d1eda8c05..5b18a08c6285 100644
@@ -124,8 +124,10 @@ int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
 		    struct dvb_diseqc_master_cmd *diseqcmd);
 void avc_remote_ctrl_work(struct work_struct *work);
 int avc_register_remote_control(struct firedtv *fdtv);
-int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
-int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
+int avc_ca_app_info(struct firedtv *fdtv, unsigned char *app_info,
+		    unsigned int *len);
+int avc_ca_info(struct firedtv *fdtv, unsigned char *app_info,
+		unsigned int *len);
 int avc_ca_reset(struct firedtv *fdtv);
 int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length);
 int avc_ca_get_time_date(struct firedtv *fdtv, int *interval);
drivers/media/platform/vivid/vivid-kthread-cap.c +4 -1
index 83cc6d3b4784..81ba454a6d95 100644
@@ -863,8 +863,11 @@ int vivid_start_generating_vid_cap(struct vivid_dev *dev, bool *pstreaming)
 			"%s-vid-cap", dev->v4l2_dev.name);
 
 	if (IS_ERR(dev->kthread_vid_cap)) {
+		int err = PTR_ERR(dev->kthread_vid_cap);
+
+		dev->kthread_vid_cap = NULL;
 		v4l2_err(&dev->v4l2_dev, "kernel_thread() failed\n");
-		return PTR_ERR(dev->kthread_vid_cap);
+		return err;
 	}
 	*pstreaming = true;
 	vivid_grab_controls(dev, true);
drivers/media/platform/vivid/vivid-kthread-out.c +4 -1
index c2c46dcdbe95..2c5dbdcb576a 100644
@@ -248,8 +248,11 @@ int vivid_start_generating_vid_out(struct vivid_dev *dev, bool *pstreaming)
 			"%s-vid-out", dev->v4l2_dev.name);
 
 	if (IS_ERR(dev->kthread_vid_out)) {
+		int err = PTR_ERR(dev->kthread_vid_out);
+
+		dev->kthread_vid_out = NULL;
 		v4l2_err(&dev->v4l2_dev, "kernel_thread() failed\n");
-		return PTR_ERR(dev->kthread_vid_out);
+		return err;
 	}
 	*pstreaming = true;
 	vivid_grab_controls(dev, true);
drivers/media/platform/vivid/vivid-vid-common.c +1 -1
index 1678b730dba2..2e82f520a869 100644
@@ -33,7 +33,7 @@ const struct v4l2_dv_timings_cap vivid_dv_timings_cap = {
 	.type = V4L2_DV_BT_656_1120,
 	/* keep this initialization for compatibility with GCC < 4.4.6 */
 	.reserved = { 0 },
-	V4L2_INIT_BT_TIMINGS(0, MAX_WIDTH, 0, MAX_HEIGHT, 14000000, 775000000,
+	V4L2_INIT_BT_TIMINGS(16, MAX_WIDTH, 16, MAX_HEIGHT, 14000000, 775000000,
 		V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
 		V4L2_DV_BT_STD_CVT | V4L2_DV_BT_STD_GTF,
 		V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_INTERLACED)
drivers/media/usb/em28xx/em28xx-video.c +2 -2
index 6cfcdcea27e0..873948e429e8 100644
@@ -930,6 +930,8 @@ int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count)
 
 	em28xx_videodbg("%s\n", __func__);
 
+	dev->v4l2->field_count = 0;
+
 	/* Make sure streaming is not already in progress for this type
 	   of filehandle (e.g. video, vbi) */
 	rc = res_get(dev, vq->type);
@@ -1149,8 +1151,6 @@ static void em28xx_ctrl_notify(struct v4l2_ctrl *ctrl, void *priv)
 {
 	struct em28xx *dev = priv;
 
-	dev->v4l2->field_count = 0;
-
 	/*
 	 * In the case of non-AC97 volume controls, we still need
 	 * to do some setups at em28xx, in order to mute/unmute
drivers/media/v4l2-core/videobuf2-core.c +10 -4
index 8ce9c63dfc59..e0041fcfa783 100644
@@ -1976,9 +1976,13 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma)
 			return -EINVAL;
 		}
 	}
+
+	mutex_lock(&q->mmap_lock);
+
 	if (vb2_fileio_is_active(q)) {
 		dprintk(1, "mmap: file io in progress\n");
-		return -EBUSY;
+		ret = -EBUSY;
+		goto unlock;
 	}
 
 	/*
@@ -1986,7 +1990,7 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma)
 	 */
 	ret = __find_plane_by_offset(q, off, &buffer, &plane);
 	if (ret)
-		return ret;
+		goto unlock;
 
 	vb = q->bufs[buffer];
 
@@ -1999,11 +2003,13 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma)
 	if (length < (vma->vm_end - vma->vm_start)) {
 		dprintk(1,
 			"MMAP invalid, as it would overflow buffer length\n");
-		return -EINVAL;
+		ret = -EINVAL;
+		goto unlock;
 	}
 
-	mutex_lock(&q->mmap_lock);
 	ret = call_memop(vb, mmap, vb->planes[plane].mem_priv, vma);
+
+unlock:
 	mutex_unlock(&q->mmap_lock);
 	if (ret)
 		return ret;
drivers/mfd/tps6586x.c +24 -0
index 5628a6b5b19b..c5c320efc7b4 100644
@@ -594,6 +594,29 @@ static int tps6586x_i2c_remove(struct i2c_client *client)
 	return 0;
 }
 
+static int __maybe_unused tps6586x_i2c_suspend(struct device *dev)
+{
+	struct tps6586x *tps6586x = dev_get_drvdata(dev);
+
+	if (tps6586x->client->irq)
+		disable_irq(tps6586x->client->irq);
+
+	return 0;
+}
+
+static int __maybe_unused tps6586x_i2c_resume(struct device *dev)
+{
+	struct tps6586x *tps6586x = dev_get_drvdata(dev);
+
+	if (tps6586x->client->irq)
+		enable_irq(tps6586x->client->irq);
+
+	return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(tps6586x_pm_ops, tps6586x_i2c_suspend,
+			 tps6586x_i2c_resume);
+
 static const struct i2c_device_id tps6586x_id_table[] = {
 	{ "tps6586x", 0 },
 	{ },
@@ -604,6 +627,7 @@ static struct i2c_driver tps6586x_driver = {
 	.driver	= {
 		.name	= "tps6586x",
 		.of_match_table = of_match_ptr(tps6586x_of_match),
+		.pm	= &tps6586x_pm_ops,
 	},
 	.probe		= tps6586x_i2c_probe,
 	.remove		= tps6586x_i2c_remove,
drivers/mmc/host/atmel-mci.c +2 -1
index bf62e429f7fc..98be9eb3184b 100644
@@ -1840,13 +1840,14 @@ static void atmci_tasklet_func(unsigned long priv)
 			}
 
 			atmci_request_end(host, host->mrq);
-			state = STATE_IDLE;
+			goto unlock; /* atmci_request_end() sets host->state */
 			break;
 		}
 	} while (state != prev_state);
 
 	host->state = state;
 
+unlock:
 	spin_unlock(&host->lock);
 }
 
drivers/net/ethernet/intel/e1000e/ptp.c +10 -3
index 25a0ad5102d6..855cf8c15c8a 100644
@@ -111,10 +111,14 @@ static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 	struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
 						     ptp_clock_info);
 	unsigned long flags;
-	u64 ns;
+	u64 cycles, ns;
 
 	spin_lock_irqsave(&adapter->systim_lock, flags);
-	ns = timecounter_read(&adapter->tc);
+
+	/* Use timecounter_cyc2time() to allow non-monotonic SYSTIM readings */
+	cycles = adapter->cc.read(&adapter->cc);
+	ns = timecounter_cyc2time(&adapter->tc, cycles);
+
 	spin_unlock_irqrestore(&adapter->systim_lock, flags);
 
 	*ts = ns_to_timespec64(ns);
@@ -170,9 +174,12 @@ static void e1000e_systim_overflow_work(struct work_struct *work)
 						     systim_overflow_work.work);
 	struct e1000_hw *hw = &adapter->hw;
 	struct timespec64 ts;
+	u64 ns;
 
-	adapter->ptp_clock_info.gettime64(&adapter->ptp_clock_info, &ts);
+	/* Update the timecounter */
+	ns = timecounter_read(&adapter->tc);
 
+	ts = ns_to_timespec64(ns);
 	e_dbg("SYSTIM overflow check at %lld.%09lu\n",
 	      (long long) ts.tv_sec, ts.tv_nsec);
 
drivers/net/ethernet/realtek/r8169.c +2 -0
index 93543e176829..8f40e121f7d4 100644
@@ -324,6 +324,8 @@ enum cfg_version {
 };
 
 static const struct pci_device_id rtl8169_pci_tbl[] = {
+	{ PCI_VDEVICE(REALTEK,	0x2502), RTL_CFG_1 },
+	{ PCI_VDEVICE(REALTEK,	0x2600), RTL_CFG_1 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8129), 0, 0, RTL_CFG_0 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8136), 0, 0, RTL_CFG_2 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8161), 0, 0, RTL_CFG_1 },
drivers/platform/x86/asus-wmi.c +2 -1
index f96f7b865267..7c1defaef3f5 100644
@@ -2084,7 +2084,8 @@ static int asus_wmi_add(struct platform_device *pdev)
 		err = asus_wmi_backlight_init(asus);
 		if (err && err != -ENODEV)
 			goto fail_backlight;
-	}
+	} else
+		err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL);
 
 	status = wmi_install_notify_handler(asus->driver->event_guid,
 					    asus_wmi_notify, asus);
drivers/scsi/megaraid/megaraid_sas_fp.c +1 -1
index 741509b35617..14f32c114c55 100644
@@ -1273,7 +1273,7 @@ void mr_update_load_balance_params(struct MR_DRV_RAID_MAP_ALL *drv_map,
 
 	for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES_EXT; ldCount++) {
 		ld = MR_TargetIdToLdGet(ldCount, drv_map);
-		if (ld >= MAX_LOGICAL_DRIVES_EXT) {
+		if (ld >= MAX_LOGICAL_DRIVES_EXT - 1) {
 			lbInfo[ldCount].loadBalanceFlag = 0;
 			continue;
 		}
drivers/scsi/megaraid/megaraid_sas_fusion.c +1 -1
index 213944ed64d9..3d3bfa814093 100644
@@ -1758,7 +1758,7 @@ static void megasas_build_ld_nonrw_fusion(struct megasas_instance *instance,
 		device_id < instance->fw_supported_vd_count)) {
 
 		ld = MR_TargetIdToLdGet(device_id, local_map_ptr);
-		if (ld >= instance->fw_supported_vd_count)
+		if (ld >= instance->fw_supported_vd_count - 1)
 			fp_possible = 0;
 
 		raid = MR_LdRaidGet(ld, local_map_ptr);
drivers/scsi/sd.c +6 -0
index 6fffb73766de..ec80a0077ace 100644
@@ -207,6 +207,12 @@ cache_type_store(struct device *dev, struct device_attribute *attr,
 	sp = buffer_data[0] & 0x80 ? 1 : 0;
 	buffer_data[0] &= ~0x80;
 
+	/*
+	 * Ensure WP, DPOFUA, and RESERVED fields are cleared in
+	 * received mode parameter buffer before doing MODE SELECT.
+	 */
+	data.device_specific = 0;
+
 	if (scsi_mode_select(sdp, 1, sp, 8, buffer_data, len, SD_TIMEOUT,
 			     SD_MAX_RETRIES, &data, &sshdr)) {
 		if (scsi_sense_valid(&sshdr))
drivers/target/target_core_spc.c +12 -5
index 9413e1a949e5..5af4d6a03d6e 100644
@@ -108,12 +108,17 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)
 
 	buf[7] = 0x2; /* CmdQue=1 */
 
-	memcpy(&buf[8], "LIO-ORG ", 8);
-	memset(&buf[16], 0x20, 16);
+	/*
+	 * ASCII data fields described as being left-aligned shall have any
+	 * unused bytes at the end of the field (i.e., highest offset) and the
+	 * unused bytes shall be filled with ASCII space characters (20h).
+	 */
+	memset(&buf[8], 0x20, 8 + 16 + 4);
+	memcpy(&buf[8], "LIO-ORG", sizeof("LIO-ORG") - 1);
 	memcpy(&buf[16], dev->t10_wwn.model,
-	       min_t(size_t, strlen(dev->t10_wwn.model), 16));
+	       strnlen(dev->t10_wwn.model, 16));
 	memcpy(&buf[32], dev->t10_wwn.revision,
-	       min_t(size_t, strlen(dev->t10_wwn.revision), 4));
+	       strnlen(dev->t10_wwn.revision, 4));
 	buf[4] = 31; /* Set additional length to 31 */
 
 	return 0;
@@ -251,7 +256,9 @@ check_t10_vend_desc:
 	buf[off] = 0x2; /* ASCII */
 	buf[off+1] = 0x1; /* T10 Vendor ID */
 	buf[off+2] = 0x0;
-	memcpy(&buf[off+4], "LIO-ORG", 8);
+	/* left align Vendor ID and pad with spaces */
+	memset(&buf[off+4], 0x20, 8);
+	memcpy(&buf[off+4], "LIO-ORG", sizeof("LIO-ORG") - 1);
 	/* Extra Byte for NULL Terminator */
 	id_len++;
 	/* Identifier Length */
drivers/tty/tty_ldsem.c +10 -0
index ad7eba5ca380..34234c233851 100644
@@ -307,6 +307,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/video/fbdev/omap2/omapfb/omapfb-ioctl.c +2 -0
index 34ab4f950f0a..0c1c34ff40a9 100644
@@ -609,6 +609,8 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
 
 	int r = 0;
 
+	memset(&p, 0, sizeof(p));
+
 	switch (cmd) {
 	case OMAPFB_SYNC_GFX:
 		DBG("ioctl SYNC_GFX\n");
fs/btrfs/disk-io.c +8 -0
index f80a0af68736..78722aaffecd 100644
@@ -4111,6 +4111,14 @@ static void btrfs_destroy_all_ordered_extents(struct btrfs_fs_info *fs_info)
 		spin_lock(&fs_info->ordered_root_lock);
 	}
 	spin_unlock(&fs_info->ordered_root_lock);
+
+	/*
+	 * We need this here because if we've been flipped read-only we won't
+	 * get sync() from the umount, so we need to make sure any ordered
+	 * extents that haven't had their dirty pages IO start writeout yet
+	 * actually get run and error out properly.
+	 */
+	btrfs_wait_ordered_roots(fs_info, -1);
 }
 
 static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
fs/f2fs/checkpoint.c +89 -79

288 lines not on this page · raw message

fs/f2fs/data.c +73 -45

184 lines not on this page · raw message

fs/f2fs/dir.c +46 -41

149 lines not on this page · raw message

fs/f2fs/f2fs.h +60 -17

167 lines not on this page · raw message

fs/f2fs/file.c +17 -4
index 01eed94b01ea..96bfd9f0ea02 100644
@@ -305,13 +305,13 @@ static pgoff_t __get_first_dirty_index(struct address_space *mapping,
 	return pgofs;
 }
 
-static bool __found_offset(block_t blkaddr, pgoff_t dirty, pgoff_t pgofs,
-							int whence)
+static bool __found_offset(struct f2fs_sb_info *sbi, block_t blkaddr,
+				pgoff_t dirty, pgoff_t pgofs, int whence)
 {
 	switch (whence) {
 	case SEEK_DATA:
 		if ((blkaddr == NEW_ADDR && dirty == pgofs) ||
-			(blkaddr != NEW_ADDR && blkaddr != NULL_ADDR))
+			is_valid_data_blkaddr(sbi, blkaddr))
 			return true;
 		break;
 	case SEEK_HOLE:
@@ -374,7 +374,15 @@ static loff_t f2fs_seek_block(struct file *file, loff_t offset, int whence)
 			block_t blkaddr;
 			blkaddr = datablock_addr(dn.node_page, dn.ofs_in_node);
 
-			if (__found_offset(blkaddr, dirty, pgofs, whence)) {
+			if (__is_valid_data_blkaddr(blkaddr) &&
+				!f2fs_is_valid_blkaddr(F2FS_I_SB(inode),
+						blkaddr, DATA_GENERIC)) {
+				f2fs_put_dnode(&dn);
+				goto fail;
+			}
+
+			if (__found_offset(F2FS_I_SB(inode), blkaddr, dirty,
+							pgofs, whence)) {
 				f2fs_put_dnode(&dn);
 				goto found;
 			}
@@ -466,6 +474,11 @@ int truncate_data_blocks_range(struct dnode_of_data *dn, int count)
 
 		dn->data_blkaddr = NULL_ADDR;
 		set_data_blkaddr(dn);
+
+		if (__is_valid_data_blkaddr(blkaddr) &&
+			!f2fs_is_valid_blkaddr(sbi, blkaddr, DATA_GENERIC))
+			continue;
+
 		invalidate_blocks(sbi, blkaddr);
 		if (dn->ofs_in_node == 0 && IS_INODE(dn->node_page))
 			clear_inode_flag(F2FS_I(dn->inode),
fs/f2fs/inline.c +114 -1

139 lines not on this page · raw message

fs/f2fs/inode.c +63 -5

101 lines not on this page · raw message

fs/f2fs/node.c +62 -41

236 lines not on this page · raw message

fs/f2fs/node.h +49 -28

95 lines not on this page · raw message

fs/f2fs/recovery.c +87 -78

330 lines not on this page · raw message

fs/f2fs/segment.c +50 -43

148 lines not on this page · raw message

fs/f2fs/segment.h +37 -11

90 lines not on this page · raw message

fs/f2fs/super.c +115 -19

83 lines not on this page · raw message

fs/jffs2/super.c +2 -1
index 1544f530ccd0..023e7f32ee1b 100644

Lines of this file are not shown. View the raw message.

fs/ocfs2/localalloc.c +7 -2
index 0a4457fb0711..85111d740c9d 100644

Lines of this file are not shown. View the raw message.

fs/proc/array.c +1 -1
index cb71cbae606d..60cbaa821164 100644

Lines of this file are not shown. View the raw message.

fs/pstore/ram_core.c +5 -0
index bd21795ce657..679d75a864d0 100644

Lines of this file are not shown. View the raw message.

fs/xfs/libxfs/xfs_attr.c +8 -1
index fb9636cc927c..5d8d12746e6e 100644

Lines of this file are not shown. View the raw message.

include/linux/backing-dev-defs.h +8 -0
index a307c37c2e6c..072501a0ac86 100644

Lines of this file are not shown. View the raw message.

include/linux/f2fs_fs.h +3 -0
index 3d6e6ce44c5c..520fd854e7b3 100644

Lines of this file are not shown. View the raw message.

mm/page-writeback.c +21 -14
index 3309dbda7ffa..0bc7fa21db85 100644

Lines of this file are not shown. View the raw message.

net/bridge/br_netfilter_hooks.c +1 -1
index 55dcb2b20b59..6def85d75b1d 100644

Lines of this file are not shown. View the raw message.

net/can/gw.c +27 -3
index 77c8af4047ef..81650affa3fa 100644

Lines of this file are not shown. View the raw message.

net/core/skbuff.c +7 -4
index 9703924ed071..8a57bbaf7452 100644

Lines of this file are not shown. View the raw message.

net/core/sock.c +1 -0
index 9fb1c073d0c4..8aa4a5f89572 100644

Lines of this file are not shown. View the raw message.

net/ipv4/ip_sockglue.c +5 -7
index 3f8caf7d19b8..1ea36bf778e6 100644

Lines of this file are not shown. View the raw message.

net/ipv6/af_inet6.c +13 -1
index 637a0e41b0aa..d6f2dab28d14 100644

Lines of this file are not shown. View the raw message.

net/ipv6/datagram.c +5 -6
index 9f6e57ded338..27cdf543c539 100644

Lines of this file are not shown. View the raw message.

net/packet/af_packet.c +2 -2
index 0f50977ed53b..753b2837318d 100644

Lines of this file are not shown. View the raw message.

net/sctp/ipv6.c +1 -4
index 7dffc97a953c..9fa0b0dc3868 100644

Lines of this file are not shown. View the raw message.

net/sctp/protocol.c +1 -3
index dc030efa4447..9f2f3c48b7b6 100644

Lines of this file are not shown. View the raw message.

net/sunrpc/rpcb_clnt.c +8 -0
index cf5770d8f49a..c89626b2afff 100644

Lines of this file are not shown. View the raw message.

net/tipc/netlink_compat.c +49 -1

50 lines not on this page · raw message

scripts/kconfig/zconf.l +3 -1
index c410d257da06..0c7800112ff5 100644

Lines of this file are not shown. View the raw message.

security/security.c +7 -0
index 46f405ce6b0f..0dde287db5c5 100644

Lines of this file are not shown. View the raw message.

security/selinux/ss/policydb.c +2 -1
index 992a31530825..965a55eacaba 100644

Lines of this file are not shown. View the raw message.

security/yama/yama_lsm.c +3 -1
index cb6ed10816d4..0a8808954bd8 100644

Lines of this file are not shown. View the raw message.

sound/firewire/bebob/bebob.c +1 -1
index 091290d1f3ea..1898fa4228ad 100644

Lines of this file are not shown. View the raw message.

tools/perf/arch/x86/util/intel-pt.c +11 -0
index c53f78767568..df21da796fa7 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/parse-events.c +1 -1
index e81dfb2e239c..9351738df703 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/svghelper.c +1 -1
index eec6c1149f44..132878d4847a 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.