From: Greg Kroah-Hartman Date: Sat, 26 Jul 2014 18:11:19 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.4.100~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb61d6d6f700690b76ddb82fc493f993220d812c;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches 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 --- 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 index 00000000000..267c7160e76 --- /dev/null +++ b/queue-3.10/dm-cache-metadata-do-not-allow-the-data-block-size-to-change.patch @@ -0,0 +1,39 @@ +From 048e5a07f282c57815b3901d4a68a77fa131ce0a Mon Sep 17 00:00:00 2001 +From: Mike Snitzer +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 + +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 +Acked-by: Joe Thornber +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..43f0a07c0a5 --- /dev/null +++ b/queue-3.10/dm-thin-metadata-do-not-allow-the-data-block-size-to-change.patch @@ -0,0 +1,54 @@ +From 9aec8629ec829fc9403788cd959e05dd87988bd1 Mon Sep 17 00:00:00 2001 +From: Mike Snitzer +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 + +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 +Acked-by: Joe Thornber +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..25be060b926 --- /dev/null +++ b/queue-3.10/locking-mutex-disable-optimistic-spinning-on-some-architectures.patch @@ -0,0 +1,116 @@ +From 4badad352a6bb202ec68afa7a574c0bb961e5ebc Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Fri, 6 Jun 2014 19:53:16 +0200 +Subject: locking/mutex: Disable optimistic spinning on some architectures + +From: Peter Zijlstra + +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 +Reported-by: Mikulas Patocka +Cc: David Miller +Cc: Chris Metcalf +Cc: James Bottomley +Cc: Vineet Gupta +Cc: Jason Low +Cc: Waiman Long +Cc: "James E.J. Bottomley" +Cc: Paul McKenney +Cc: John David Anglin +Cc: James Hogan +Cc: Linus Torvalds +Cc: Davidlohr Bueso +Cc: Benjamin Herrenschmidt +Cc: Catalin Marinas +Cc: Russell King +Cc: Will Deacon +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 +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..12b35b5f0cb --- /dev/null +++ b/queue-3.10/pm-sleep-fix-request_firmware-error-at-resume.patch @@ -0,0 +1,51 @@ +From 4320f6b1d9db4ca912c5eb6ecb328b2e090e1586 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 15 Jul 2014 08:51:27 +0200 +Subject: PM / sleep: Fix request_firmware() error at resume + +From: Takashi Iwai + +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 +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + 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); diff --git a/queue-3.10/series b/queue-3.10/series index 8f39f3e843c..2d3440b5039 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -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