From: Greg Kroah-Hartman Date: Fri, 26 Jan 2018 09:36:37 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.4.114~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8eb59d3e2108f8eb8869a7ff738c7b5af7f6a86d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: input-trackpoint-force-3-buttons-if-0-button-is-reported.patch orangefs-fix-deadlock-do-not-write-i_size-in-read_iter.patch --- diff --git a/queue-4.9/input-trackpoint-force-3-buttons-if-0-button-is-reported.patch b/queue-4.9/input-trackpoint-force-3-buttons-if-0-button-is-reported.patch new file mode 100644 index 00000000000..5e8958dc047 --- /dev/null +++ b/queue-4.9/input-trackpoint-force-3-buttons-if-0-button-is-reported.patch @@ -0,0 +1,45 @@ +From f5d07b9e98022d50720e38aa936fc11c67868ece Mon Sep 17 00:00:00 2001 +From: Aaron Ma +Date: Fri, 19 Jan 2018 09:43:39 -0800 +Subject: Input: trackpoint - force 3 buttons if 0 button is reported + +From: Aaron Ma + +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 +Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196253 +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + 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); diff --git a/queue-4.9/orangefs-fix-deadlock-do-not-write-i_size-in-read_iter.patch b/queue-4.9/orangefs-fix-deadlock-do-not-write-i_size-in-read_iter.patch new file mode 100644 index 00000000000..63b8779a131 --- /dev/null +++ b/queue-4.9/orangefs-fix-deadlock-do-not-write-i_size-in-read_iter.patch @@ -0,0 +1,78 @@ +From 6793f1c450b1533a5e9c2493490de771d38b24f9 Mon Sep 17 00:00:00 2001 +From: Martin Brandenburg +Date: Thu, 25 Jan 2018 19:39:44 -0500 +Subject: orangefs: fix deadlock; do not write i_size in read_iter + +From: Martin Brandenburg + +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 +Cc: Al Viro +Cc: Mike Marshall +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + 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; diff --git a/queue-4.9/series b/queue-4.9/series index 59514c5206d..e5d28602263 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -25,3 +25,5 @@ fs-fcntl-f_setown-avoid-undefined-behaviour.patch scsi-libiscsi-fix-shifting-of-did_requeue-host-byte.patch revert-module-add-retpoline-tag-to-vermagic.patch mm-fix-100-cpu-kswapd-busyloop-on-unreclaimable-nodes.patch +input-trackpoint-force-3-buttons-if-0-button-is-reported.patch +orangefs-fix-deadlock-do-not-write-i_size-in-read_iter.patch