From: Greg Kroah-Hartman Date: Mon, 6 Jan 2014 21:47:52 +0000 (-0800) Subject: 3.4-stable patches X-Git-Tag: v3.4.76~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c08079b595a4f88d9583c5b2d4a76b10aba2644;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: gfs2-don-t-hold-s_umount-over-blkdev_put.patch gfs2-fix-incorrect-invalidation-for-dio-buffered-i-o.patch gpio-msm-fix-irq-mask-unmask-by-writing-bits-instead-of-numbers.patch input-allocate-absinfo-data-when-setting-abs-capability.patch jbd2-don-t-bug-but-return-enospc-if-a-handle-runs-out-of-space.patch sched-avoid-throttle_cfs_rq-racing-with-period_timer-stopping.patch sh-always-link-in-helper-functions-extracted-from-libgcc.patch --- diff --git a/queue-3.4/gfs2-don-t-hold-s_umount-over-blkdev_put.patch b/queue-3.4/gfs2-don-t-hold-s_umount-over-blkdev_put.patch new file mode 100644 index 00000000000..204a87d051d --- /dev/null +++ b/queue-3.4/gfs2-don-t-hold-s_umount-over-blkdev_put.patch @@ -0,0 +1,47 @@ +From dfe5b9ad83a63180f358b27d1018649a27b394a9 Mon Sep 17 00:00:00 2001 +From: Steven Whitehouse +Date: Fri, 6 Dec 2013 11:52:34 +0000 +Subject: GFS2: don't hold s_umount over blkdev_put + +From: Steven Whitehouse + +commit dfe5b9ad83a63180f358b27d1018649a27b394a9 upstream. + +This is a GFS2 version of Tejun's patch: +4f331f01b9c43bf001d3ffee578a97a1e0633eac +vfs: don't hold s_umount over close_bdev_exclusive() call + +In this case its blkdev_put itself that is the issue and this +patch uses the same solution of dropping and retaking s_umount. + +Reported-by: Tejun Heo +Reported-by: Al Viro +Signed-off-by: Steven Whitehouse +Signed-off-by: Greg Kroah-Hartman + +--- + fs/gfs2/ops_fstype.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +--- a/fs/gfs2/ops_fstype.c ++++ b/fs/gfs2/ops_fstype.c +@@ -1298,8 +1298,18 @@ static struct dentry *gfs2_mount(struct + if (IS_ERR(s)) + goto error_bdev; + +- if (s->s_root) ++ if (s->s_root) { ++ /* ++ * s_umount nests inside bd_mutex during ++ * __invalidate_device(). blkdev_put() acquires ++ * bd_mutex and can't be called under s_umount. Drop ++ * s_umount temporarily. This is safe as we're ++ * holding an active reference. ++ */ ++ up_write(&s->s_umount); + blkdev_put(bdev, mode); ++ down_write(&s->s_umount); ++ } + + memset(&args, 0, sizeof(args)); + args.ar_quota = GFS2_QUOTA_DEFAULT; diff --git a/queue-3.4/gfs2-fix-incorrect-invalidation-for-dio-buffered-i-o.patch b/queue-3.4/gfs2-fix-incorrect-invalidation-for-dio-buffered-i-o.patch new file mode 100644 index 00000000000..c2d0ed267f8 --- /dev/null +++ b/queue-3.4/gfs2-fix-incorrect-invalidation-for-dio-buffered-i-o.patch @@ -0,0 +1,72 @@ +From dfd11184d894cd0a92397b25cac18831a1a6a5bc Mon Sep 17 00:00:00 2001 +From: Steven Whitehouse +Date: Wed, 18 Dec 2013 14:14:52 +0000 +Subject: GFS2: Fix incorrect invalidation for DIO/buffered I/O + +From: Steven Whitehouse + +commit dfd11184d894cd0a92397b25cac18831a1a6a5bc upstream. + +In patch 209806aba9d540dde3db0a5ce72307f85f33468f we allowed +local deferred locks to be granted against a cached exclusive +lock. That opened up a corner case which this patch now +fixes. + +The solution to the problem is to check whether we have cached +pages each time we do direct I/O and if so to unmap, flush +and invalidate those pages. Since the glock state machine +normally does that for us, mostly the code will be a no-op. + +Signed-off-by: Steven Whitehouse +Signed-off-by: Greg Kroah-Hartman + +--- + fs/gfs2/aops.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +--- a/fs/gfs2/aops.c ++++ b/fs/gfs2/aops.c +@@ -1012,6 +1012,7 @@ static ssize_t gfs2_direct_IO(int rw, st + { + struct file *file = iocb->ki_filp; + struct inode *inode = file->f_mapping->host; ++ struct address_space *mapping = inode->i_mapping; + struct gfs2_inode *ip = GFS2_I(inode); + struct gfs2_holder gh; + int rv; +@@ -1032,6 +1033,35 @@ static ssize_t gfs2_direct_IO(int rw, st + if (rv != 1) + goto out; /* dio not valid, fall back to buffered i/o */ + ++ /* ++ * Now since we are holding a deferred (CW) lock at this point, you ++ * might be wondering why this is ever needed. There is a case however ++ * where we've granted a deferred local lock against a cached exclusive ++ * glock. That is ok provided all granted local locks are deferred, but ++ * it also means that it is possible to encounter pages which are ++ * cached and possibly also mapped. So here we check for that and sort ++ * them out ahead of the dio. The glock state machine will take care of ++ * everything else. ++ * ++ * If in fact the cached glock state (gl->gl_state) is deferred (CW) in ++ * the first place, mapping->nr_pages will always be zero. ++ */ ++ if (mapping->nrpages) { ++ loff_t lstart = offset & (PAGE_CACHE_SIZE - 1); ++ loff_t len = iov_length(iov, nr_segs); ++ loff_t end = PAGE_ALIGN(offset + len) - 1; ++ ++ rv = 0; ++ if (len == 0) ++ goto out; ++ if (test_and_clear_bit(GIF_SW_PAGED, &ip->i_flags)) ++ unmap_shared_mapping_range(ip->i_inode.i_mapping, offset, len); ++ rv = filemap_write_and_wait_range(mapping, lstart, end); ++ if (rv) ++ return rv; ++ truncate_inode_pages_range(mapping, lstart, end); ++ } ++ + rv = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, + offset, nr_segs, gfs2_get_block_direct, + NULL, NULL, 0); diff --git a/queue-3.4/gpio-msm-fix-irq-mask-unmask-by-writing-bits-instead-of-numbers.patch b/queue-3.4/gpio-msm-fix-irq-mask-unmask-by-writing-bits-instead-of-numbers.patch new file mode 100644 index 00000000000..87d6a0b61fd --- /dev/null +++ b/queue-3.4/gpio-msm-fix-irq-mask-unmask-by-writing-bits-instead-of-numbers.patch @@ -0,0 +1,42 @@ +From 4cc629b7a20945ce35628179180329b6bc9e552b Mon Sep 17 00:00:00 2001 +From: Stephen Boyd +Date: Tue, 10 Dec 2013 15:19:03 -0800 +Subject: gpio: msm: Fix irq mask/unmask by writing bits instead of numbers + +From: Stephen Boyd + +commit 4cc629b7a20945ce35628179180329b6bc9e552b upstream. + +We should be writing bits here but instead we're writing the +numbers that correspond to the bits we want to write. Fix it by +wrapping the numbers in the BIT() macro. This fixes gpios acting +as interrupts. + +Signed-off-by: Stephen Boyd +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-msm-v2.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpio/gpio-msm-v2.c ++++ b/drivers/gpio/gpio-msm-v2.c +@@ -249,7 +249,7 @@ static void msm_gpio_irq_mask(struct irq + + spin_lock_irqsave(&tlmm_lock, irq_flags); + writel(TARGET_PROC_NONE, GPIO_INTR_CFG_SU(gpio)); +- clear_gpio_bits(INTR_RAW_STATUS_EN | INTR_ENABLE, GPIO_INTR_CFG(gpio)); ++ clear_gpio_bits(BIT(INTR_RAW_STATUS_EN) | BIT(INTR_ENABLE), GPIO_INTR_CFG(gpio)); + __clear_bit(gpio, msm_gpio.enabled_irqs); + spin_unlock_irqrestore(&tlmm_lock, irq_flags); + } +@@ -261,7 +261,7 @@ static void msm_gpio_irq_unmask(struct i + + spin_lock_irqsave(&tlmm_lock, irq_flags); + __set_bit(gpio, msm_gpio.enabled_irqs); +- set_gpio_bits(INTR_RAW_STATUS_EN | INTR_ENABLE, GPIO_INTR_CFG(gpio)); ++ set_gpio_bits(BIT(INTR_RAW_STATUS_EN) | BIT(INTR_ENABLE), GPIO_INTR_CFG(gpio)); + writel(TARGET_PROC_SCORPION, GPIO_INTR_CFG_SU(gpio)); + spin_unlock_irqrestore(&tlmm_lock, irq_flags); + } diff --git a/queue-3.4/input-allocate-absinfo-data-when-setting-abs-capability.patch b/queue-3.4/input-allocate-absinfo-data-when-setting-abs-capability.patch new file mode 100644 index 00000000000..016e3bc5df3 --- /dev/null +++ b/queue-3.4/input-allocate-absinfo-data-when-setting-abs-capability.patch @@ -0,0 +1,34 @@ +From 28a2a2e1aedbe2d8b2301e6e0e4e63f6e4177aca Mon Sep 17 00:00:00 2001 +From: Dmitry Torokhov +Date: Thu, 26 Dec 2013 17:44:29 -0800 +Subject: Input: allocate absinfo data when setting ABS capability + +From: Dmitry Torokhov + +commit 28a2a2e1aedbe2d8b2301e6e0e4e63f6e4177aca upstream. + +We need to make sure we allocate absinfo data when we are setting one of +EV_ABS/ABS_XXX capabilities, otherwise we may bomb when we try to emit this +event. + +Rested-by: Paul Cercueil +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/input.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/input/input.c ++++ b/drivers/input/input.c +@@ -1707,6 +1707,10 @@ void input_set_capability(struct input_d + break; + + case EV_ABS: ++ input_alloc_absinfo(dev); ++ if (!dev->absinfo) ++ return; ++ + __set_bit(code, dev->absbit); + break; + diff --git a/queue-3.4/jbd2-don-t-bug-but-return-enospc-if-a-handle-runs-out-of-space.patch b/queue-3.4/jbd2-don-t-bug-but-return-enospc-if-a-handle-runs-out-of-space.patch new file mode 100644 index 00000000000..b0c0005a66c --- /dev/null +++ b/queue-3.4/jbd2-don-t-bug-but-return-enospc-if-a-handle-runs-out-of-space.patch @@ -0,0 +1,61 @@ +From f6c07cad081ba222d63623d913aafba5586c1d2c Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sun, 8 Dec 2013 21:12:59 -0500 +Subject: jbd2: don't BUG but return ENOSPC if a handle runs out of space + +From: Theodore Ts'o + +commit f6c07cad081ba222d63623d913aafba5586c1d2c upstream. + +If a handle runs out of space, we currently stop the kernel with a BUG +in jbd2_journal_dirty_metadata(). This makes it hard to figure out +what might be going on. So return an error of ENOSPC, so we can let +the file system layer figure out what is going on, to make it more +likely we can get useful debugging information). This should make it +easier to debug problems such as the one which was reported by: + + https://bugzilla.kernel.org/show_bug.cgi?id=44731 + +The only two callers of this function are ext4_handle_dirty_metadata() +and ocfs2_journal_dirty(). The ocfs2 function will trigger a +BUG_ON(), which means there will be no change in behavior. The ext4 +function will call ext4_error_inode() which will print the useful +debugging information and then handle the situation using ext4's error +handling mechanisms (i.e., which might mean halting the kernel or +remounting the file system read-only). + +Also, since both file systems already call WARN_ON(), drop the WARN_ON +from jbd2_journal_dirty_metadata() to avoid two stack traces from +being displayed. + +Signed-off-by: "Theodore Ts'o" +Cc: ocfs2-devel@oss.oracle.com +Acked-by: Joel Becker +Signed-off-by: Greg Kroah-Hartman + +--- + fs/jbd2/transaction.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/fs/jbd2/transaction.c ++++ b/fs/jbd2/transaction.c +@@ -1126,7 +1126,10 @@ int jbd2_journal_dirty_metadata(handle_t + * once a transaction -bzzz + */ + jh->b_modified = 1; +- J_ASSERT_JH(jh, handle->h_buffer_credits > 0); ++ if (handle->h_buffer_credits <= 0) { ++ ret = -ENOSPC; ++ goto out_unlock_bh; ++ } + handle->h_buffer_credits--; + } + +@@ -1209,7 +1212,6 @@ out_unlock_bh: + jbd2_journal_put_journal_head(jh); + out: + JBUFFER_TRACE(jh, "exit"); +- WARN_ON(ret); /* All errors are bugs, so dump the stack */ + return ret; + } + diff --git a/queue-3.4/sched-avoid-throttle_cfs_rq-racing-with-period_timer-stopping.patch b/queue-3.4/sched-avoid-throttle_cfs_rq-racing-with-period_timer-stopping.patch new file mode 100644 index 00000000000..7cd3903d48f --- /dev/null +++ b/queue-3.4/sched-avoid-throttle_cfs_rq-racing-with-period_timer-stopping.patch @@ -0,0 +1,66 @@ +From f9f9ffc237dd924f048204e8799da74f9ecf40cf Mon Sep 17 00:00:00 2001 +From: Ben Segall +Date: Wed, 16 Oct 2013 11:16:32 -0700 +Subject: sched: Avoid throttle_cfs_rq() racing with period_timer stopping + +From: Ben Segall + +commit f9f9ffc237dd924f048204e8799da74f9ecf40cf upstream. + +throttle_cfs_rq() doesn't check to make sure that period_timer is running, +and while update_curr/assign_cfs_runtime does, a concurrently running +period_timer on another cpu could cancel itself between this cpu's +update_curr and throttle_cfs_rq(). If there are no other cfs_rqs running +in the tg to restart the timer, this causes the cfs_rq to be stranded +forever. + +Fix this by calling __start_cfs_bandwidth() in throttle if the timer is +inactive. + +(Also add some sched_debug lines for cfs_bandwidth.) + +Tested: make a run/sleep task in a cgroup, loop switching the cgroup +between 1ms/100ms quota and unlimited, checking for timer_active=0 and +throttled=1 as a failure. With the throttle_cfs_rq() change commented out +this fails, with the full patch it passes. + +Signed-off-by: Ben Segall +Signed-off-by: Peter Zijlstra +Cc: pjt@google.com +Link: http://lkml.kernel.org/r/20131016181632.22647.84174.stgit@sword-of-the-dawn.mtv.corp.google.com +Signed-off-by: Ingo Molnar +Signed-off-by: Chris J Arges +Signed-off-by: Greg Kroah-Hartman +--- + kernel/sched/debug.c | 8 ++++++++ + kernel/sched/fair.c | 2 ++ + 2 files changed, 10 insertions(+) + +--- a/kernel/sched/debug.c ++++ b/kernel/sched/debug.c +@@ -215,6 +215,14 @@ void print_cfs_rq(struct seq_file *m, in + SEQ_printf(m, " .%-30s: %d\n", "load_tg", + atomic_read(&cfs_rq->tg->load_weight)); + #endif ++#ifdef CONFIG_CFS_BANDWIDTH ++ SEQ_printf(m, " .%-30s: %d\n", "tg->cfs_bandwidth.timer_active", ++ cfs_rq->tg->cfs_bandwidth.timer_active); ++ SEQ_printf(m, " .%-30s: %d\n", "throttled", ++ cfs_rq->throttled); ++ SEQ_printf(m, " .%-30s: %d\n", "throttle_count", ++ cfs_rq->throttle_count); ++#endif + + print_cfs_group_stats(m, cpu, cfs_rq->tg); + #endif +--- a/kernel/sched/fair.c ++++ b/kernel/sched/fair.c +@@ -1655,6 +1655,8 @@ static void throttle_cfs_rq(struct cfs_r + cfs_rq->throttled_timestamp = rq->clock; + raw_spin_lock(&cfs_b->lock); + list_add_tail_rcu(&cfs_rq->throttled_list, &cfs_b->throttled_cfs_rq); ++ if (!cfs_b->timer_active) ++ __start_cfs_bandwidth(cfs_b); + raw_spin_unlock(&cfs_b->lock); + } + diff --git a/queue-3.4/series b/queue-3.4/series index 121ec2c3154..44a8e5b8976 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -31,3 +31,10 @@ libata-add-ata_horkage_broken_fpdma_aa-quirk-for-seagate-momentus-spinpoint-m8.p radiotap-fix-bitmap-end-finding-buffer-overrun.patch rtlwifi-pci-fix-oops-on-driver-unload.patch mm-hugetlb-check-for-pte-null-pointer-in-__page_check_address.patch +input-allocate-absinfo-data-when-setting-abs-capability.patch +gfs2-don-t-hold-s_umount-over-blkdev_put.patch +gfs2-fix-incorrect-invalidation-for-dio-buffered-i-o.patch +jbd2-don-t-bug-but-return-enospc-if-a-handle-runs-out-of-space.patch +gpio-msm-fix-irq-mask-unmask-by-writing-bits-instead-of-numbers.patch +sched-avoid-throttle_cfs_rq-racing-with-period_timer-stopping.patch +sh-always-link-in-helper-functions-extracted-from-libgcc.patch diff --git a/queue-3.4/sh-always-link-in-helper-functions-extracted-from-libgcc.patch b/queue-3.4/sh-always-link-in-helper-functions-extracted-from-libgcc.patch new file mode 100644 index 00000000000..37d3eaca4d8 --- /dev/null +++ b/queue-3.4/sh-always-link-in-helper-functions-extracted-from-libgcc.patch @@ -0,0 +1,55 @@ +From 84ed8a99058e61567f495cc43118344261641c5f Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Wed, 18 Dec 2013 17:08:48 -0800 +Subject: sh: always link in helper functions extracted from libgcc + +From: Geert Uytterhoeven + +commit 84ed8a99058e61567f495cc43118344261641c5f upstream. + +E.g. landisk_defconfig, which has CONFIG_NTFS_FS=m: + + ERROR: "__ashrdi3" [fs/ntfs/ntfs.ko] undefined! + +For "lib-y", if no symbols in a compilation unit are referenced by other +units, the compilation unit will not be included in vmlinux. This +breaks modules that do reference those symbols. + +Use "obj-y" instead to fix this. + +http://kisskb.ellerman.id.au/kisskb/buildresult/8838077/ + +This doesn't fix all cases. There are others, e.g. udivsi3. +This is also not limited to sh, many architectures handle this in the +same way. + +A simple solution is to unconditionally include all helper functions. +A more complex solution is to make the choice of "lib-y" or "obj-y" depend +on CONFIG_MODULES: + + obj-$(CONFIG_MODULES) += ... + lib-y($CONFIG_MODULES) += ... + +Signed-off-by: Geert Uytterhoeven +Cc: Paul Mundt +Tested-by: Nobuhiro Iwamatsu +Reviewed-by: Nobuhiro Iwamatsu +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/sh/lib/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/sh/lib/Makefile ++++ b/arch/sh/lib/Makefile +@@ -6,7 +6,7 @@ lib-y = delay.o memmove.o memchr.o \ + checksum.o strlen.o div64.o div64-generic.o + + # Extracted from libgcc +-lib-y += movmem.o ashldi3.o ashrdi3.o lshrdi3.o \ ++obj-y += movmem.o ashldi3.o ashrdi3.o lshrdi3.o \ + ashlsi3.o ashrsi3.o ashiftrt.o lshrsi3.o \ + udiv_qrnnd.o +