]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.5-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 May 2016 23:56:28 +0000 (16:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 May 2016 23:56:28 +0000 (16:56 -0700)
added patches:
btrfs-cleaner_kthread-doesn-t-need-explicit-freeze.patch
btrfs-fix-memory-leak-of-fs_info-in-block-group-cache.patch
megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch
sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch
thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch
unbreak-allmodconfig-kconfig_allconfig.patch

queue-4.5/btrfs-cleaner_kthread-doesn-t-need-explicit-freeze.patch [new file with mode: 0644]
queue-4.5/btrfs-fix-memory-leak-of-fs_info-in-block-group-cache.patch [new file with mode: 0644]
queue-4.5/megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch [new file with mode: 0644]
queue-4.5/series
queue-4.5/sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch [new file with mode: 0644]
queue-4.5/thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch [new file with mode: 0644]
queue-4.5/unbreak-allmodconfig-kconfig_allconfig.patch [new file with mode: 0644]

diff --git a/queue-4.5/btrfs-cleaner_kthread-doesn-t-need-explicit-freeze.patch b/queue-4.5/btrfs-cleaner_kthread-doesn-t-need-explicit-freeze.patch
new file mode 100644 (file)
index 0000000..986e3f5
--- /dev/null
@@ -0,0 +1,40 @@
+From 838fe1887765f4cc679febea60d87d2a06bd300e Mon Sep 17 00:00:00 2001
+From: Jiri Kosina <jkosina@suse.cz>
+Date: Tue, 15 Mar 2016 11:28:54 +0100
+Subject: btrfs: cleaner_kthread() doesn't need explicit freeze
+
+From: Jiri Kosina <jkosina@suse.cz>
+
+commit 838fe1887765f4cc679febea60d87d2a06bd300e upstream.
+
+cleaner_kthread() is not marked freezable, and therefore calling
+try_to_freeze() in its context is a pointless no-op.
+
+In addition to that, as has been clearly demonstrated by 80ad623edd2d
+("Revert "btrfs: clear PF_NOFREEZE in cleaner_kthread()"), it's perfectly
+valid / legal for cleaner_kthread() to stay scheduled out in an arbitrary
+place during suspend (in that particular example that was waiting for
+reading of extent pages), so there is no need to leave any traces of
+freezer in this kthread.
+
+Fixes: 80ad623edd2d ("Revert "btrfs: clear PF_NOFREEZE in cleaner_kthread()")
+Fixes: 696249132158 ("btrfs: clear PF_NOFREEZE in cleaner_kthread()")
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/disk-io.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/btrfs/disk-io.c
++++ b/fs/btrfs/disk-io.c
+@@ -1830,7 +1830,7 @@ static int cleaner_kthread(void *arg)
+                */
+               btrfs_delete_unused_bgs(root->fs_info);
+ sleep:
+-              if (!try_to_freeze() && !again) {
++              if (!again) {
+                       set_current_state(TASK_INTERRUPTIBLE);
+                       if (!kthread_should_stop())
+                               schedule();
diff --git a/queue-4.5/btrfs-fix-memory-leak-of-fs_info-in-block-group-cache.patch b/queue-4.5/btrfs-fix-memory-leak-of-fs_info-in-block-group-cache.patch
new file mode 100644 (file)
index 0000000..b823c78
--- /dev/null
@@ -0,0 +1,89 @@
+From aa66b0bb08869d93492bd817d2eae694ca743a3d Mon Sep 17 00:00:00 2001
+From: Kinglong Mee <kinglongmee@gmail.com>
+Date: Fri, 29 Jan 2016 21:36:00 +0800
+Subject: btrfs: fix memory leak of fs_info in block group cache
+
+From: Kinglong Mee <kinglongmee@gmail.com>
+
+commit aa66b0bb08869d93492bd817d2eae694ca743a3d upstream.
+
+When starting up linux with btrfs filesystem, I got many memory leak
+messages by kmemleak as,
+
+unreferenced object 0xffff880066882000 (size 4096):
+  comm "modprobe", pid 730, jiffies 4294690024 (age 196.599s)
+  hex dump (first 32 bytes):
+    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+  backtrace:
+    [<ffffffff8174d52e>] kmemleak_alloc+0x4e/0xb0
+    [<ffffffff811d09aa>] kmem_cache_alloc_trace+0xea/0x1e0
+    [<ffffffffa03620fb>] btrfs_alloc_dummy_fs_info+0x6b/0x2a0 [btrfs]
+    [<ffffffffa03624fc>] btrfs_alloc_dummy_block_group+0x5c/0x120 [btrfs]
+    [<ffffffffa0360aa9>] btrfs_test_free_space_cache+0x39/0xed0 [btrfs]
+    [<ffffffffa03b5a74>] trace_raw_output_xfs_attr_class+0x54/0xe0 [xfs]
+    [<ffffffff81002122>] do_one_initcall+0xb2/0x1f0
+    [<ffffffff811765aa>] do_init_module+0x5e/0x1e9
+    [<ffffffff810fec09>] load_module+0x20a9/0x2690
+    [<ffffffff810ff439>] SyS_finit_module+0xb9/0xf0
+    [<ffffffff81757daf>] entry_SYSCALL_64_fastpath+0x12/0x76
+    [<ffffffffffffffff>] 0xffffffffffffffff
+unreferenced object 0xffff8800573f8000 (size 10256):
+  comm "modprobe", pid 730, jiffies 4294690185 (age 196.460s)
+  hex dump (first 32 bytes):
+    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+  backtrace:
+    [<ffffffff8174d52e>] kmemleak_alloc+0x4e/0xb0
+    [<ffffffff8119ca6e>] kmalloc_order+0x5e/0x70
+    [<ffffffff8119caa4>] kmalloc_order_trace+0x24/0x90
+    [<ffffffffa03620b3>] btrfs_alloc_dummy_fs_info+0x23/0x2a0 [btrfs]
+    [<ffffffffa03624fc>] btrfs_alloc_dummy_block_group+0x5c/0x120 [btrfs]
+    [<ffffffffa036603d>] run_test+0xfd/0x320 [btrfs]
+    [<ffffffffa0366f34>] btrfs_test_free_space_tree+0x94/0xee [btrfs]
+    [<ffffffffa03b5aab>] trace_raw_output_xfs_attr_class+0x8b/0xe0 [xfs]
+    [<ffffffff81002122>] do_one_initcall+0xb2/0x1f0
+    [<ffffffff811765aa>] do_init_module+0x5e/0x1e9
+    [<ffffffff810fec09>] load_module+0x20a9/0x2690
+    [<ffffffff810ff439>] SyS_finit_module+0xb9/0xf0
+    [<ffffffff81757daf>] entry_SYSCALL_64_fastpath+0x12/0x76
+    [<ffffffffffffffff>] 0xffffffffffffffff
+
+This patch lets btrfs using fs_info stored in btrfs_root for
+block group cache directly without allocating a new one.
+
+Fixes: d0bd456074 ("Btrfs: add fragment=* debug mount option")
+Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/tests/btrfs-tests.c           |    6 ------
+ fs/btrfs/tests/free-space-tree-tests.c |    1 +
+ 2 files changed, 1 insertion(+), 6 deletions(-)
+
+--- a/fs/btrfs/tests/btrfs-tests.c
++++ b/fs/btrfs/tests/btrfs-tests.c
+@@ -189,12 +189,6 @@ btrfs_alloc_dummy_block_group(unsigned l
+               kfree(cache);
+               return NULL;
+       }
+-      cache->fs_info = btrfs_alloc_dummy_fs_info();
+-      if (!cache->fs_info) {
+-              kfree(cache->free_space_ctl);
+-              kfree(cache);
+-              return NULL;
+-      }
+       cache->key.objectid = 0;
+       cache->key.offset = length;
+--- a/fs/btrfs/tests/free-space-tree-tests.c
++++ b/fs/btrfs/tests/free-space-tree-tests.c
+@@ -485,6 +485,7 @@ static int run_test(test_func_t test_fun
+       cache->bitmap_low_thresh = 0;
+       cache->bitmap_high_thresh = (u32)-1;
+       cache->needs_free_space = 1;
++      cache->fs_info = root->fs_info;
+       btrfs_init_dummy_trans(&trans);
diff --git a/queue-4.5/megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch b/queue-4.5/megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch
new file mode 100644 (file)
index 0000000..0d6f80d
--- /dev/null
@@ -0,0 +1,54 @@
+From 3deb9438d34a09f6796639b652a01d110aca9f75 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 14 Mar 2016 15:29:45 +0100
+Subject: megaraid_sas: add missing curly braces in ioctl handler
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 3deb9438d34a09f6796639b652a01d110aca9f75 upstream.
+
+gcc-6 found a dubious indentation in the megasas_mgmt_fw_ioctl
+function:
+
+drivers/scsi/megaraid/megaraid_sas_base.c: In function 'megasas_mgmt_fw_ioctl':
+drivers/scsi/megaraid/megaraid_sas_base.c:6658:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
+    kbuff_arr[i] = NULL;
+    ^~~~~~~~~
+drivers/scsi/megaraid/megaraid_sas_base.c:6653:3: note: ...this 'if' clause, but it is not
+   if (kbuff_arr[i])
+   ^~
+
+The code is actually correct, as there is no downside in clearing a NULL
+pointer again.
+
+This clarifies the code and avoids the warning by adding extra curly
+braces.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Fixes: 90dc9d98f01b ("megaraid_sas : MFI MPT linked list corruption fix")
+Reviewed-by: Hannes Reinecke <hare@suse.com>
+Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/megaraid/megaraid_sas_base.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/scsi/megaraid/megaraid_sas_base.c
++++ b/drivers/scsi/megaraid/megaraid_sas_base.c
+@@ -6282,12 +6282,13 @@ out:
+       }
+       for (i = 0; i < ioc->sge_count; i++) {
+-              if (kbuff_arr[i])
++              if (kbuff_arr[i]) {
+                       dma_free_coherent(&instance->pdev->dev,
+                                         le32_to_cpu(kern_sge32[i].length),
+                                         kbuff_arr[i],
+                                         le32_to_cpu(kern_sge32[i].phys_addr));
+                       kbuff_arr[i] = NULL;
++              }
+       }
+       megasas_return_cmd(instance, cmd);
index e558b6c32692f18eb630f2b081aeab434f272ea8..fe03cf7861aeafef85bcdae699fd204349d28327 100644 (file)
@@ -188,3 +188,9 @@ arm-dts-pxa-fix-dma-engine-node-to-pxa3xx-nand.patch
 arm-dts-am33xx-fix-gpmc-dma-properties.patch
 arm-dts-am437x-fix-gpmc-dma-properties.patch
 bus-imx-weim-take-the-status-property-value-into-account.patch
+btrfs-fix-memory-leak-of-fs_info-in-block-group-cache.patch
+btrfs-cleaner_kthread-doesn-t-need-explicit-freeze.patch
+unbreak-allmodconfig-kconfig_allconfig.patch
+thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch
+sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch
+megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch
diff --git a/queue-4.5/sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch b/queue-4.5/sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch
new file mode 100644 (file)
index 0000000..6ad75e2
--- /dev/null
@@ -0,0 +1,45 @@
+From a6ab1e8126d205238defbb55d23661a3a5c6a0d8 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.com>
+Date: Fri, 4 Mar 2016 17:20:13 +1100
+Subject: sunrpc/cache: drop reference when sunrpc_cache_pipe_upcall() detects a race
+
+From: NeilBrown <neilb@suse.com>
+
+commit a6ab1e8126d205238defbb55d23661a3a5c6a0d8 upstream.
+
+sunrpc_cache_pipe_upcall() can detect a race if CACHE_PENDING is no longer
+set.  In this case it aborts the queuing of the upcall.
+However it has already taken a new counted reference on "h" and
+doesn't "put" it, even though it frees the data structure holding the reference.
+
+So let's delay the "cache_get" until we know we need it.
+
+Fixes: f9e1aedc6c79 ("sunrpc/cache: remove races with queuing an upcall.")
+Signed-off-by: NeilBrown <neilb@suse.com>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/sunrpc/cache.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/net/sunrpc/cache.c
++++ b/net/sunrpc/cache.c
+@@ -1182,14 +1182,14 @@ int sunrpc_cache_pipe_upcall(struct cach
+       }
+       crq->q.reader = 0;
+-      crq->item = cache_get(h);
+       crq->buf = buf;
+       crq->len = 0;
+       crq->readers = 0;
+       spin_lock(&queue_lock);
+-      if (test_bit(CACHE_PENDING, &h->flags))
++      if (test_bit(CACHE_PENDING, &h->flags)) {
++              crq->item = cache_get(h);
+               list_add_tail(&crq->q.list, &detail->queue);
+-      else
++      } else
+               /* Lost a race, no longer PENDING, so don't enqueue */
+               ret = -EAGAIN;
+       spin_unlock(&queue_lock);
diff --git a/queue-4.5/thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch b/queue-4.5/thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch
new file mode 100644 (file)
index 0000000..b7356ef
--- /dev/null
@@ -0,0 +1,54 @@
+From 43b4eb9fe719b107c8e5d49d1edbff0c135a42cb Mon Sep 17 00:00:00 2001
+From: Caesar Wang <wxt@rock-chips.com>
+Date: Mon, 15 Feb 2016 15:33:28 +0800
+Subject: thermal: rockchip: fix a impossible condition caused by the warning
+
+From: Caesar Wang <wxt@rock-chips.com>
+
+commit 43b4eb9fe719b107c8e5d49d1edbff0c135a42cb upstream.
+
+As the Dan report the smatch check the thermal driver warning:
+drivers/thermal/rockchip_thermal.c:551 rockchip_configure_from_dt()
+warn: impossible condition '(thermal->tshut_temp > ((~0 >> 1))) =>
+(s32min-s32max > s32max)'
+
+Although The shut_temp read from DT is u32,the temperature is currently
+represented as int not long in the thermal driver.
+Let's change to make shut_temp instead of the thermal->tshut_temp for
+the condition.
+
+Fixes: commit 437df2172e8d
+("thermal: rockchip: consistently use int for temperatures")
+
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Caesar Wang <wxt@rock-chips.com>
+Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/thermal/rockchip_thermal.c |   11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+--- a/drivers/thermal/rockchip_thermal.c
++++ b/drivers/thermal/rockchip_thermal.c
+@@ -693,15 +693,14 @@ static int rockchip_configure_from_dt(st
+                        thermal->chip->tshut_temp);
+               thermal->tshut_temp = thermal->chip->tshut_temp;
+       } else {
++              if (shut_temp > INT_MAX) {
++                      dev_err(dev, "Invalid tshut temperature specified: %d\n",
++                              shut_temp);
++                      return -ERANGE;
++              }
+               thermal->tshut_temp = shut_temp;
+       }
+-      if (thermal->tshut_temp > INT_MAX) {
+-              dev_err(dev, "Invalid tshut temperature specified: %d\n",
+-                      thermal->tshut_temp);
+-              return -ERANGE;
+-      }
+-
+       if (of_property_read_u32(np, "rockchip,hw-tshut-mode", &tshut_mode)) {
+               dev_warn(dev,
+                        "Missing tshut mode property, using default (%s)\n",
diff --git a/queue-4.5/unbreak-allmodconfig-kconfig_allconfig.patch b/queue-4.5/unbreak-allmodconfig-kconfig_allconfig.patch
new file mode 100644 (file)
index 0000000..e303b61
--- /dev/null
@@ -0,0 +1,76 @@
+From 6b87b70c5339f30e3c5b32085e69625906513dc2 Mon Sep 17 00:00:00 2001
+From: Al Viro <viro@ZenIV.linux.org.uk>
+Date: Thu, 14 Jan 2016 18:13:49 +0000
+Subject: unbreak allmodconfig KCONFIG_ALLCONFIG=...
+
+From: Al Viro <viro@ZenIV.linux.org.uk>
+
+commit 6b87b70c5339f30e3c5b32085e69625906513dc2 upstream.
+
+       Prior to 3.13 make allmodconfig KCONFIG_ALLCONFIG=/dev/null used
+to be equivalent to make allmodconfig; these days it hardwires MODULES to n.
+In fact, any KCONFIG_ALLCONFIG that doesn't set MODULES explicitly is
+treated as if it set it to n.
+
+       Regression had been introduced by commit cfa98f ("kconfig: do not
+override symbols already set"); what happens is that conf_read_simple()
+does sym_calc_value(modules_sym) on exit, which leaves SYMBOL_VALID set and
+has conf_set_all_new_symbols() skip modules_sym.
+
+       It's pretty easy to fix - simply move that call of sym_calc_value()
+into the callers, except for the ones in KCONFIG_ALLCONFIG handling.
+Objections?
+
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Fixes: cfa98f2e0ae9 ("kconfig: do not override symbols already set")
+Signed-off-by: Michal Marek <mmarek@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ scripts/kconfig/confdata.c |   12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/scripts/kconfig/confdata.c
++++ b/scripts/kconfig/confdata.c
+@@ -267,10 +267,8 @@ int conf_read_simple(const char *name, i
+               if (in)
+                       goto load;
+               sym_add_change_count(1);
+-              if (!sym_defconfig_list) {
+-                      sym_calc_value(modules_sym);
++              if (!sym_defconfig_list)
+                       return 1;
+-              }
+               for_all_defaults(sym_defconfig_list, prop) {
+                       if (expr_calc_value(prop->visible.expr) == no ||
+@@ -403,7 +401,6 @@ setsym:
+       }
+       free(line);
+       fclose(in);
+-      sym_calc_value(modules_sym);
+       return 0;
+ }
+@@ -414,8 +411,12 @@ int conf_read(const char *name)
+       sym_set_change_count(0);
+-      if (conf_read_simple(name, S_DEF_USER))
++      if (conf_read_simple(name, S_DEF_USER)) {
++              sym_calc_value(modules_sym);
+               return 1;
++      }
++
++      sym_calc_value(modules_sym);
+       for_all_symbols(i, sym) {
+               sym_calc_value(sym);
+@@ -846,6 +847,7 @@ static int conf_split_config(void)
+       name = conf_get_autoconfig_name();
+       conf_read_simple(name, S_DEF_AUTO);
++      sym_calc_value(modules_sym);
+       if (chdir("include/config"))
+               return 1;