]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jul 2014 22:51:57 +0000 (15:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jul 2014 22:51:57 +0000 (15:51 -0700)
added patches:
cgroup-fix-mount-failure-in-a-corner-case.patch
i40e-fix-passing-wrong-error-code-to-i40e_open.patch
mtd-nand-omap-fix-omap_calculate_ecc_bch-for-loop-error.patch

queue-3.15/cgroup-fix-mount-failure-in-a-corner-case.patch [new file with mode: 0644]
queue-3.15/i40e-fix-passing-wrong-error-code-to-i40e_open.patch [new file with mode: 0644]
queue-3.15/mtd-nand-omap-fix-omap_calculate_ecc_bch-for-loop-error.patch [new file with mode: 0644]
queue-3.15/series

diff --git a/queue-3.15/cgroup-fix-mount-failure-in-a-corner-case.patch b/queue-3.15/cgroup-fix-mount-failure-in-a-corner-case.patch
new file mode 100644 (file)
index 0000000..de17faf
--- /dev/null
@@ -0,0 +1,93 @@
+From 970317aa48c6ef66cd023c039c2650c897bad927 Mon Sep 17 00:00:00 2001
+From: Li Zefan <lizefan@huawei.com>
+Date: Mon, 30 Jun 2014 11:49:58 +0800
+Subject: cgroup: fix mount failure in a corner case
+
+From: Li Zefan <lizefan@huawei.com>
+
+commit 970317aa48c6ef66cd023c039c2650c897bad927 upstream.
+
+  # cat test.sh
+  #! /bin/bash
+
+  mount -t cgroup -o cpu xxx /cgroup
+  umount /cgroup
+
+  mount -t cgroup -o cpu,cpuacct xxx /cgroup
+  umount /cgroup
+  # ./test.sh
+  mount: xxx already mounted or /cgroup busy
+  mount: according to mtab, xxx is already mounted on /cgroup
+
+It's because the cgroupfs_root of the first mount was under destruction
+asynchronously.
+
+Fix this by delaying and then retrying mount for this case.
+
+v3:
+- put the refcnt immediately after getting it. (Tejun)
+
+v2:
+- use percpu_ref_tryget_live() rather that introducing
+  percpu_ref_alive(). (Tejun)
+- adjust comment.
+
+tj: Updated the comment a bit.
+
+Signed-off-by: Li Zefan <lizefan@huawei.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+[lizf: Backported to 3.15:
+ - s/percpu_ref_tryget_live/atomic_inc_not_zero/
+ - Use goto instead of calling restart_syscall()
+ - Add cgroup_tree_mutex]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/cgroup.c |   25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+--- a/kernel/cgroup.c
++++ b/kernel/cgroup.c
+@@ -1484,10 +1484,12 @@ static struct dentry *cgroup_mount(struc
+                        int flags, const char *unused_dev_name,
+                        void *data)
+ {
++      struct cgroup_subsys *ss;
+       struct cgroup_root *root;
+       struct cgroup_sb_opts opts;
+       struct dentry *dentry;
+       int ret;
++      int i;
+       bool new_sb;
+       /*
+@@ -1514,6 +1516,29 @@ retry:
+               goto out_unlock;
+       }
++      /*
++       * Destruction of cgroup root is asynchronous, so subsystems may
++       * still be dying after the previous unmount.  Let's drain the
++       * dying subsystems.  We just need to ensure that the ones
++       * unmounted previously finish dying and don't care about new ones
++       * starting.  Testing ref liveliness is good enough.
++       */
++      for_each_subsys(ss, i) {
++              if (!(opts.subsys_mask & (1 << i)) ||
++                  ss->root == &cgrp_dfl_root)
++                      continue;
++
++              if (!atomic_inc_not_zero(&ss->root->cgrp.refcnt)) {
++                      mutex_unlock(&cgroup_mutex);
++                      mutex_unlock(&cgroup_tree_mutex);
++                      msleep(10);
++                      mutex_lock(&cgroup_tree_mutex);
++                      mutex_lock(&cgroup_mutex);
++                      goto retry;
++              }
++              cgroup_put(&ss->root->cgrp);
++      }
++
+       for_each_root(root) {
+               bool name_match = false;
diff --git a/queue-3.15/i40e-fix-passing-wrong-error-code-to-i40e_open.patch b/queue-3.15/i40e-fix-passing-wrong-error-code-to-i40e_open.patch
new file mode 100644 (file)
index 0000000..e471e44
--- /dev/null
@@ -0,0 +1,38 @@
+From ce9ccb17ef5b5088172f46dd246c92523fd3a524 Mon Sep 17 00:00:00 2001
+From: Jean Sacren <sakiwit@gmail.com>
+Date: Thu, 1 May 2014 14:31:18 +0000
+Subject: i40e: fix passing wrong error code to i40e_open()
+
+From: Jean Sacren <sakiwit@gmail.com>
+
+commit ce9ccb17ef5b5088172f46dd246c92523fd3a524 upstream.
+
+The commit 6c167f582ea9 ("i40e: Refactor and cleanup i40e_open(),
+adding i40e_vsi_open()") introduced a new function i40e_vsi_open()
+with the regression by a typo. Due to the commit, the wrong error
+code would be passed to i40e_open(). Fix this error in
+i40e_vsi_open() by turning the macro into a negative value so that
+i40e_open() could return the pertinent error code correctly.
+
+Fixes: 6c167f582ea9 ("i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open()")
+Signed-off-by: Jean Sacren <sakiwit@gmail.com>
+Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+
+---
+ drivers/net/ethernet/intel/i40e/i40e_main.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
+@@ -4310,7 +4310,7 @@ int i40e_vsi_open(struct i40e_vsi *vsi)
+               goto err_setup_rx;
+       if (!vsi->netdev) {
+-              err = EINVAL;
++              err = -EINVAL;
+               goto err_setup_rx;
+       }
+       snprintf(int_name, sizeof(int_name) - 1, "%s-%s",
diff --git a/queue-3.15/mtd-nand-omap-fix-omap_calculate_ecc_bch-for-loop-error.patch b/queue-3.15/mtd-nand-omap-fix-omap_calculate_ecc_bch-for-loop-error.patch
new file mode 100644 (file)
index 0000000..9b06c42
--- /dev/null
@@ -0,0 +1,57 @@
+From 2913aae5f9eae2f857cdeff5388bb22d0751aa08 Mon Sep 17 00:00:00 2001
+From: Ted Juan <ted.juan@gmail.com>
+Date: Wed, 28 May 2014 22:33:06 +0800
+Subject: mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
+
+From: Ted Juan <ted.juan@gmail.com>
+
+commit 2913aae5f9eae2f857cdeff5388bb22d0751aa08 upstream.
+
+ Fixes:  2c9f2365d1e1d0e318b068f683f18c99515b80f8
+ mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4 in omap_calculate_ecc_bch
+
+ Fixes: 7bcd1dca1d587ad29f9825ba4414620440e8c8da
+ mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch8 in omap_calculate_ecc_bch
+
+Signed-off-by: Ted Juan <ted.juan@gmail.com>
+Acked-by: Pekon Gupta <pekon@ti.com>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mtd/nand/omap2.c |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/mtd/nand/omap2.c
++++ b/drivers/mtd/nand/omap2.c
+@@ -1162,7 +1162,7 @@ static int __maybe_unused omap_calculate
+       struct gpmc_nand_regs   *gpmc_regs = &info->reg;
+       u8 *ecc_code;
+       unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4;
+-      int i;
++      int i, j;
+       nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1;
+       for (i = 0; i < nsectors; i++) {
+@@ -1210,8 +1210,8 @@ static int __maybe_unused omap_calculate
+               case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW:
+                       /* Add constant polynomial to remainder, so that
+                        * ECC of blank pages results in 0x0 on reading back */
+-                      for (i = 0; i < eccbytes; i++)
+-                              ecc_calc[i] ^= bch4_polynomial[i];
++                      for (j = 0; j < eccbytes; j++)
++                              ecc_calc[j] ^= bch4_polynomial[j];
+                       break;
+               case OMAP_ECC_BCH4_CODE_HW:
+                       /* Set  8th ECC byte as 0x0 for ROM compatibility */
+@@ -1220,8 +1220,8 @@ static int __maybe_unused omap_calculate
+               case OMAP_ECC_BCH8_CODE_HW_DETECTION_SW:
+                       /* Add constant polynomial to remainder, so that
+                        * ECC of blank pages results in 0x0 on reading back */
+-                      for (i = 0; i < eccbytes; i++)
+-                              ecc_calc[i] ^= bch8_polynomial[i];
++                      for (j = 0; j < eccbytes; j++)
++                              ecc_calc[j] ^= bch8_polynomial[j];
+                       break;
+               case OMAP_ECC_BCH8_CODE_HW:
+                       /* Set 14th ECC byte as 0x0 for ROM compatibility */
index 5c08e9304139b1960dd68a46b1a1958ca928b4b5..935cf9e490651e4589da4e460eaad7031dafacaa 100644 (file)
@@ -64,3 +64,6 @@ drm-i915-don-t-clobber-the-gtt-when-it-s-within-stolen-memory.patch
 x86-64-espfix-don-t-leak-bits-31-16-of-esp-returning-to-16-bit-stack.patch
 dma-cma-fix-possible-memory-leak.patch
 ring-buffer-check-if-buffer-exists-before-polling.patch
+i40e-fix-passing-wrong-error-code-to-i40e_open.patch
+mtd-nand-omap-fix-omap_calculate_ecc_bch-for-loop-error.patch
+cgroup-fix-mount-failure-in-a-corner-case.patch