]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Jul 2014 18:11:19 +0000 (11:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Jul 2014 18:11:19 +0000 (11:11 -0700)
added patches:
dm-cache-metadata-do-not-allow-the-data-block-size-to-change.patch
dm-thin-metadata-do-not-allow-the-data-block-size-to-change.patch
locking-mutex-disable-optimistic-spinning-on-some-architectures.patch
pm-sleep-fix-request_firmware-error-at-resume.patch

queue-3.10/dm-cache-metadata-do-not-allow-the-data-block-size-to-change.patch [new file with mode: 0644]
queue-3.10/dm-thin-metadata-do-not-allow-the-data-block-size-to-change.patch [new file with mode: 0644]
queue-3.10/locking-mutex-disable-optimistic-spinning-on-some-architectures.patch [new file with mode: 0644]
queue-3.10/pm-sleep-fix-request_firmware-error-at-resume.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/dm-cache-metadata-do-not-allow-the-data-block-size-to-change.patch b/queue-3.10/dm-cache-metadata-do-not-allow-the-data-block-size-to-change.patch
new file mode 100644 (file)
index 0000000..267c716
--- /dev/null
@@ -0,0 +1,39 @@
+From 048e5a07f282c57815b3901d4a68a77fa131ce0a Mon Sep 17 00:00:00 2001
+From: Mike Snitzer <snitzer@redhat.com>
+Date: Mon, 14 Jul 2014 16:59:39 -0400
+Subject: dm cache metadata: do not allow the data block size to change
+
+From: Mike Snitzer <snitzer@redhat.com>
+
+commit 048e5a07f282c57815b3901d4a68a77fa131ce0a upstream.
+
+The block size for the dm-cache's data device must remained fixed for
+the life of the cache.  Disallow any attempt to change the cache's data
+block size.
+
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+Acked-by: Joe Thornber <ejt@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/md/dm-cache-metadata.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/md/dm-cache-metadata.c
++++ b/drivers/md/dm-cache-metadata.c
+@@ -384,6 +384,15 @@ static int __open_metadata(struct dm_cac
+       disk_super = dm_block_data(sblock);
++      /* Verify the data block size hasn't changed */
++      if (le32_to_cpu(disk_super->data_block_size) != cmd->data_block_size) {
++              DMERR("changing the data block size (from %u to %llu) is not supported",
++                    le32_to_cpu(disk_super->data_block_size),
++                    (unsigned long long)cmd->data_block_size);
++              r = -EINVAL;
++              goto bad;
++      }
++
+       r = __check_incompat_features(disk_super, cmd);
+       if (r < 0)
+               goto bad;
diff --git a/queue-3.10/dm-thin-metadata-do-not-allow-the-data-block-size-to-change.patch b/queue-3.10/dm-thin-metadata-do-not-allow-the-data-block-size-to-change.patch
new file mode 100644 (file)
index 0000000..43f0a07
--- /dev/null
@@ -0,0 +1,54 @@
+From 9aec8629ec829fc9403788cd959e05dd87988bd1 Mon Sep 17 00:00:00 2001
+From: Mike Snitzer <snitzer@redhat.com>
+Date: Mon, 14 Jul 2014 16:35:54 -0400
+Subject: dm thin metadata: do not allow the data block size to change
+
+From: Mike Snitzer <snitzer@redhat.com>
+
+commit 9aec8629ec829fc9403788cd959e05dd87988bd1 upstream.
+
+The block size for the thin-pool's data device must remained fixed for
+the life of the thin-pool.  Disallow any attempt to change the
+thin-pool's data block size.
+
+It should be noted that attempting to change the data block size via
+thin-pool table reload will be ignored as a side-effect of the thin-pool
+handover that the thin-pool target does during thin-pool table reload.
+
+Here is an example outcome of attempting to load a thin-pool table that
+reduced the thin-pool's data block size from 1024K to 512K.
+
+Before:
+kernel: device-mapper: thin: 253:4: growing the data device from 204800 to 409600 blocks
+
+After:
+kernel: device-mapper: thin metadata: changing the data block size (from 2048 to 1024) is not supported
+kernel: device-mapper: table: 253:4: thin-pool: Error creating metadata object
+kernel: device-mapper: ioctl: error adding target to table
+
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+Acked-by: Joe Thornber <ejt@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/md/dm-thin-metadata.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/md/dm-thin-metadata.c
++++ b/drivers/md/dm-thin-metadata.c
+@@ -591,6 +591,15 @@ static int __open_metadata(struct dm_poo
+       disk_super = dm_block_data(sblock);
++      /* Verify the data block size hasn't changed */
++      if (le32_to_cpu(disk_super->data_block_size) != pmd->data_block_size) {
++              DMERR("changing the data block size (from %u to %llu) is not supported",
++                    le32_to_cpu(disk_super->data_block_size),
++                    (unsigned long long)pmd->data_block_size);
++              r = -EINVAL;
++              goto bad_unlock_sblock;
++      }
++
+       r = __check_incompat_features(disk_super, pmd);
+       if (r < 0)
+               goto bad_unlock_sblock;
diff --git a/queue-3.10/locking-mutex-disable-optimistic-spinning-on-some-architectures.patch b/queue-3.10/locking-mutex-disable-optimistic-spinning-on-some-architectures.patch
new file mode 100644 (file)
index 0000000..25be060
--- /dev/null
@@ -0,0 +1,116 @@
+From 4badad352a6bb202ec68afa7a574c0bb961e5ebc Mon Sep 17 00:00:00 2001
+From: Peter Zijlstra <peterz@infradead.org>
+Date: Fri, 6 Jun 2014 19:53:16 +0200
+Subject: locking/mutex: Disable optimistic spinning on some architectures
+
+From: Peter Zijlstra <peterz@infradead.org>
+
+commit 4badad352a6bb202ec68afa7a574c0bb961e5ebc upstream.
+
+The optimistic spin code assumes regular stores and cmpxchg() play nice;
+this is found to not be true for at least: parisc, sparc32, tile32,
+metag-lock1, arc-!llsc and hexagon.
+
+There is further wreckage, but this in particular seemed easy to
+trigger, so blacklist this.
+
+Opt in for known good archs.
+
+Signed-off-by: Peter Zijlstra <peterz@infradead.org>
+Reported-by: Mikulas Patocka <mpatocka@redhat.com>
+Cc: David Miller <davem@davemloft.net>
+Cc: Chris Metcalf <cmetcalf@tilera.com>
+Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
+Cc: Vineet Gupta <vgupta@synopsys.com>
+Cc: Jason Low <jason.low2@hp.com>
+Cc: Waiman Long <waiman.long@hp.com>
+Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
+Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
+Cc: John David Anglin <dave.anglin@bell.net>
+Cc: James Hogan <james.hogan@imgtec.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Davidlohr Bueso <davidlohr@hp.com>
+Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Cc: Catalin Marinas <catalin.marinas@arm.com>
+Cc: Russell King <linux@arm.linux.org.uk>
+Cc: Will Deacon <will.deacon@arm.com>
+Cc: linux-arm-kernel@lists.infradead.org
+Cc: linux-kernel@vger.kernel.org
+Cc: linuxppc-dev@lists.ozlabs.org
+Cc: sparclinux@vger.kernel.org
+Link: http://lkml.kernel.org/r/20140606175316.GV13930@laptop.programming.kicks-ass.net
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/Kconfig     |    1 +
+ arch/arm64/Kconfig   |    1 +
+ arch/powerpc/Kconfig |    1 +
+ arch/sparc/Kconfig   |    1 +
+ arch/x86/Kconfig     |    1 +
+ kernel/Kconfig.locks |    5 ++++-
+ 6 files changed, 9 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -4,6 +4,7 @@ config ARM
+       select ARCH_BINFMT_ELF_RANDOMIZE_PIE
+       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
+       select ARCH_HAVE_CUSTOM_GPIO_H
++      select ARCH_SUPPORTS_ATOMIC_RMW
+       select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
+       select ARCH_WANT_IPC_PARSE_VERSION
+       select BUILDTIME_EXTABLE_SORT if MMU
+--- a/arch/arm64/Kconfig
++++ b/arch/arm64/Kconfig
+@@ -1,6 +1,7 @@
+ config ARM64
+       def_bool y
+       select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
++      select ARCH_SUPPORTS_ATOMIC_RMW
+       select ARCH_WANT_OPTIONAL_GPIOLIB
+       select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
+       select ARCH_WANT_FRAME_POINTERS
+--- a/arch/powerpc/Kconfig
++++ b/arch/powerpc/Kconfig
+@@ -138,6 +138,7 @@ config PPC
+       select ARCH_USE_BUILTIN_BSWAP
+       select OLD_SIGSUSPEND
+       select OLD_SIGACTION if PPC32
++      select ARCH_SUPPORTS_ATOMIC_RMW
+ config EARLY_PRINTK
+       bool
+--- a/arch/sparc/Kconfig
++++ b/arch/sparc/Kconfig
+@@ -77,6 +77,7 @@ config SPARC64
+       select ARCH_HAVE_NMI_SAFE_CMPXCHG
+       select HAVE_C_RECORDMCOUNT
+       select NO_BOOTMEM
++      select ARCH_SUPPORTS_ATOMIC_RMW
+ config ARCH_DEFCONFIG
+       string
+--- a/arch/x86/Kconfig
++++ b/arch/x86/Kconfig
+@@ -121,6 +121,7 @@ config X86
+       select OLD_SIGACTION if X86_32
+       select COMPAT_OLD_SIGACTION if IA32_EMULATION
+       select RTC_LIB
++      select ARCH_SUPPORTS_ATOMIC_RMW
+ config INSTRUCTION_DECODER
+       def_bool y
+--- a/kernel/Kconfig.locks
++++ b/kernel/Kconfig.locks
+@@ -220,6 +220,9 @@ config INLINE_WRITE_UNLOCK_IRQRESTORE
+ endif
++config ARCH_SUPPORTS_ATOMIC_RMW
++      bool
++
+ config MUTEX_SPIN_ON_OWNER
+       def_bool y
+-      depends on SMP && !DEBUG_MUTEXES
++      depends on SMP && !DEBUG_MUTEXES && ARCH_SUPPORTS_ATOMIC_RMW
diff --git a/queue-3.10/pm-sleep-fix-request_firmware-error-at-resume.patch b/queue-3.10/pm-sleep-fix-request_firmware-error-at-resume.patch
new file mode 100644 (file)
index 0000000..12b35b5
--- /dev/null
@@ -0,0 +1,51 @@
+From 4320f6b1d9db4ca912c5eb6ecb328b2e090e1586 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 15 Jul 2014 08:51:27 +0200
+Subject: PM / sleep: Fix request_firmware() error at resume
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 4320f6b1d9db4ca912c5eb6ecb328b2e090e1586 upstream.
+
+The commit [247bc037: PM / Sleep: Mitigate race between the freezer
+and request_firmware()] introduced the finer state control, but it
+also leads to a new bug; for example, a bug report regarding the
+firmware loading of intel BT device at suspend/resume:
+  https://bugzilla.novell.com/show_bug.cgi?id=873790
+
+The root cause seems to be a small window between the process resume
+and the clear of usermodehelper lock.  The request_firmware() function
+checks the UMH lock and gives up when it's in UMH_DISABLE state.  This
+is for avoiding the invalid  f/w loading during suspend/resume phase.
+The problem is, however, that usermodehelper_enable() is called at the
+end of thaw_processes().  Thus, a thawed process in between can kick
+off the f/w loader code path (in this case, via btusb_setup_intel())
+even before the call of usermodehelper_enable().  Then
+usermodehelper_read_trylock() returns an error and request_firmware()
+spews WARN_ON() in the end.
+
+This oneliner patch fixes the issue just by setting to UMH_FREEZING
+state again before restarting tasks, so that the call of
+request_firmware() will be blocked until the end of this function
+instead of returning an error.
+
+Fixes: 247bc0374254 (PM / Sleep: Mitigate race between the freezer and request_firmware())
+Link: https://bugzilla.novell.com/show_bug.cgi?id=873790
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/power/process.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/kernel/power/process.c
++++ b/kernel/power/process.c
+@@ -174,6 +174,7 @@ void thaw_processes(void)
+       printk("Restarting tasks ... ");
++      __usermodehelper_set_disable_depth(UMH_FREEZING);
+       thaw_workqueues();
+       read_lock(&tasklist_lock);
index 8f39f3e843c102ccb4ace065445b82d0a16b8a3c..2d3440b5039bb1c9b3404d66b389f03fb7054264 100644 (file)
@@ -48,3 +48,7 @@ drm-radeon-set-default-bl-level-to-something-reasonable.patch
 drm-qxl-return-irq_none-if-it-was-not-our-irq.patch
 drm-radeon-avoid-leaking-edid-data.patch
 alarmtimer-fix-bug-where-relative-alarm-timers-were-treated-as-absolute.patch
+dm-thin-metadata-do-not-allow-the-data-block-size-to-change.patch
+dm-cache-metadata-do-not-allow-the-data-block-size-to-change.patch
+pm-sleep-fix-request_firmware-error-at-resume.patch
+locking-mutex-disable-optimistic-spinning-on-some-architectures.patch