--- /dev/null
+From f5d07b9e98022d50720e38aa936fc11c67868ece Mon Sep 17 00:00:00 2001
+From: Aaron Ma <aaron.ma@canonical.com>
+Date: Fri, 19 Jan 2018 09:43:39 -0800
+Subject: Input: trackpoint - force 3 buttons if 0 button is reported
+
+From: Aaron Ma <aaron.ma@canonical.com>
+
+commit f5d07b9e98022d50720e38aa936fc11c67868ece upstream.
+
+Lenovo introduced trackpoint compatible sticks with minimum PS/2 commands.
+They supposed to reply with 0x02, 0x03, or 0x04 in response to the
+"Read Extended ID" command, so we would know not to try certain extended
+commands. Unfortunately even some trackpoints reporting the original IBM
+version (0x01 firmware 0x0e) now respond with incorrect data to the "Get
+Extended Buttons" command:
+
+ thinkpad_acpi: ThinkPad BIOS R0DET87W (1.87 ), EC unknown
+ thinkpad_acpi: Lenovo ThinkPad E470, model 20H1004SGE
+
+ psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 0/0
+
+Since there are no trackpoints without buttons, let's assume the trackpoint
+has 3 buttons when we get 0 response to the extended buttons query.
+
+Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
+Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196253
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/trackpoint.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/input/mouse/trackpoint.c
++++ b/drivers/input/mouse/trackpoint.c
+@@ -383,6 +383,9 @@ int trackpoint_detect(struct psmouse *ps
+ if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) {
+ psmouse_warn(psmouse, "failed to get extended button data, assuming 3 buttons\n");
+ button_info = 0x33;
++ } else if (!button_info) {
++ psmouse_warn(psmouse, "got 0 in extended button data, assuming 3 buttons\n");
++ button_info = 0x33;
+ }
+
+ psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);
--- /dev/null
+From 6793f1c450b1533a5e9c2493490de771d38b24f9 Mon Sep 17 00:00:00 2001
+From: Martin Brandenburg <martin@omnibond.com>
+Date: Thu, 25 Jan 2018 19:39:44 -0500
+Subject: orangefs: fix deadlock; do not write i_size in read_iter
+
+From: Martin Brandenburg <martin@omnibond.com>
+
+commit 6793f1c450b1533a5e9c2493490de771d38b24f9 upstream.
+
+After do_readv_writev, the inode cache is invalidated anyway, so i_size
+will never be read. It will be fetched from the server which will also
+know about updates from other machines.
+
+Fixes deadlock on 32-bit SMP.
+
+See https://marc.info/?l=linux-fsdevel&m=151268557427760&w=2
+
+Signed-off-by: Martin Brandenburg <martin@omnibond.com>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Mike Marshall <hubcap@omnibond.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/orangefs/file.c | 7 ++-----
+ fs/orangefs/orangefs-kernel.h | 11 -----------
+ 2 files changed, 2 insertions(+), 16 deletions(-)
+
+--- a/fs/orangefs/file.c
++++ b/fs/orangefs/file.c
+@@ -446,7 +446,7 @@ ssize_t orangefs_inode_read(struct inode
+ static ssize_t orangefs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
+ {
+ struct file *file = iocb->ki_filp;
+- loff_t pos = *(&iocb->ki_pos);
++ loff_t pos = iocb->ki_pos;
+ ssize_t rc = 0;
+
+ BUG_ON(iocb->private);
+@@ -485,9 +485,6 @@ static ssize_t orangefs_file_write_iter(
+ }
+ }
+
+- if (file->f_pos > i_size_read(file->f_mapping->host))
+- orangefs_i_size_write(file->f_mapping->host, file->f_pos);
+-
+ rc = generic_write_checks(iocb, iter);
+
+ if (rc <= 0) {
+@@ -501,7 +498,7 @@ static ssize_t orangefs_file_write_iter(
+ * pos to the end of the file, so we will wait till now to set
+ * pos...
+ */
+- pos = *(&iocb->ki_pos);
++ pos = iocb->ki_pos;
+
+ rc = do_readv_writev(ORANGEFS_IO_WRITE,
+ file,
+--- a/fs/orangefs/orangefs-kernel.h
++++ b/fs/orangefs/orangefs-kernel.h
+@@ -570,17 +570,6 @@ do { \
+ sys_attr.mask = ORANGEFS_ATTR_SYS_ALL_SETABLE; \
+ } while (0)
+
+-static inline void orangefs_i_size_write(struct inode *inode, loff_t i_size)
+-{
+-#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
+- inode_lock(inode);
+-#endif
+- i_size_write(inode, i_size);
+-#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
+- inode_unlock(inode);
+-#endif
+-}
+-
+ static inline void orangefs_set_timeout(struct dentry *dentry)
+ {
+ unsigned long time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000;