From: Greg Kroah-Hartman Date: Mon, 6 Apr 2015 19:12:29 +0000 (+0200) Subject: 3.14-stable patches X-Git-Tag: v3.10.74~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e4c7431d836855b4ff5af0bca02bd6bfb6a0675;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: dm-hold-suspend_lock-while-suspending-device-during-device-deletion.patch dm-io-deal-with-wandering-queue-limits-when-handling-req_discard-and-req_write_same.patch dmaengine-dw-append-module_alias-for-platform-driver.patch hfsplus-fix-b-tree-corruption-after-insertion-at-position-0.patch spi-trigger-trace-event-for-message-done-before-mesg-complete.patch --- diff --git a/queue-3.14/dm-hold-suspend_lock-while-suspending-device-during-device-deletion.patch b/queue-3.14/dm-hold-suspend_lock-while-suspending-device-during-device-deletion.patch new file mode 100644 index 00000000000..0f67291cb4b --- /dev/null +++ b/queue-3.14/dm-hold-suspend_lock-while-suspending-device-during-device-deletion.patch @@ -0,0 +1,39 @@ +From ab7c7bb6f4ab95dbca96fcfc4463cd69843e3e24 Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka +Date: Fri, 27 Feb 2015 14:04:27 -0500 +Subject: dm: hold suspend_lock while suspending device during device deletion + +From: Mikulas Patocka + +commit ab7c7bb6f4ab95dbca96fcfc4463cd69843e3e24 upstream. + +__dm_destroy() must take the suspend_lock so that its presuspend and +postsuspend calls do not race with an internal suspend. + +Signed-off-by: Mikulas Patocka +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/dm.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/md/dm.c ++++ b/drivers/md/dm.c +@@ -2352,10 +2352,16 @@ static void __dm_destroy(struct mapped_d + set_bit(DMF_FREEING, &md->flags); + spin_unlock(&_minor_lock); + ++ /* ++ * Take suspend_lock so that presuspend and postsuspend methods ++ * do not race with internal suspend. ++ */ ++ mutex_lock(&md->suspend_lock); + if (!dm_suspended_md(md)) { + dm_table_presuspend_targets(map); + dm_table_postsuspend_targets(map); + } ++ mutex_unlock(&md->suspend_lock); + + /* dm_put_live_table must be before msleep, otherwise deadlock is possible */ + dm_put_live_table(md, srcu_idx); diff --git a/queue-3.14/dm-io-deal-with-wandering-queue-limits-when-handling-req_discard-and-req_write_same.patch b/queue-3.14/dm-io-deal-with-wandering-queue-limits-when-handling-req_discard-and-req_write_same.patch new file mode 100644 index 00000000000..21733b6afa5 --- /dev/null +++ b/queue-3.14/dm-io-deal-with-wandering-queue-limits-when-handling-req_discard-and-req_write_same.patch @@ -0,0 +1,63 @@ +From e5db29806b99ce2b2640d2e4d4fcb983cea115c5 Mon Sep 17 00:00:00 2001 +From: "Darrick J. Wong" +Date: Fri, 27 Feb 2015 10:44:38 -0800 +Subject: dm io: deal with wandering queue limits when handling REQ_DISCARD and REQ_WRITE_SAME + +From: "Darrick J. Wong" + +commit e5db29806b99ce2b2640d2e4d4fcb983cea115c5 upstream. + +Since it's possible for the discard and write same queue limits to +change while the upper level command is being sliced and diced, fix up +both of them (a) to reject IO if the special command is unsupported at +the start of the function and (b) read the limits once and let the +commands error out on their own if the status happens to change. + +Signed-off-by: Darrick J. Wong +Signed-off-by: Mikulas Patocka +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/dm-io.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +--- a/drivers/md/dm-io.c ++++ b/drivers/md/dm-io.c +@@ -291,9 +291,16 @@ static void do_region(int rw, unsigned r + struct request_queue *q = bdev_get_queue(where->bdev); + unsigned short logical_block_size = queue_logical_block_size(q); + sector_t num_sectors; ++ unsigned int uninitialized_var(special_cmd_max_sectors); + +- /* Reject unsupported discard requests */ +- if ((rw & REQ_DISCARD) && !blk_queue_discard(q)) { ++ /* ++ * Reject unsupported discard and write same requests. ++ */ ++ if (rw & REQ_DISCARD) ++ special_cmd_max_sectors = q->limits.max_discard_sectors; ++ else if (rw & REQ_WRITE_SAME) ++ special_cmd_max_sectors = q->limits.max_write_same_sectors; ++ if ((rw & (REQ_DISCARD | REQ_WRITE_SAME)) && special_cmd_max_sectors == 0) { + dec_count(io, region, -EOPNOTSUPP); + return; + } +@@ -319,7 +326,7 @@ static void do_region(int rw, unsigned r + store_io_and_region_in_bio(bio, io, region); + + if (rw & REQ_DISCARD) { +- num_sectors = min_t(sector_t, q->limits.max_discard_sectors, remaining); ++ num_sectors = min_t(sector_t, special_cmd_max_sectors, remaining); + bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT; + remaining -= num_sectors; + } else if (rw & REQ_WRITE_SAME) { +@@ -328,7 +335,7 @@ static void do_region(int rw, unsigned r + */ + dp->get_page(dp, &page, &len, &offset); + bio_add_page(bio, page, logical_block_size, offset); +- num_sectors = min_t(sector_t, q->limits.max_write_same_sectors, remaining); ++ num_sectors = min_t(sector_t, special_cmd_max_sectors, remaining); + bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT; + + offset = 0; diff --git a/queue-3.14/dmaengine-dw-append-module_alias-for-platform-driver.patch b/queue-3.14/dmaengine-dw-append-module_alias-for-platform-driver.patch new file mode 100644 index 00000000000..0bc5874deb4 --- /dev/null +++ b/queue-3.14/dmaengine-dw-append-module_alias-for-platform-driver.patch @@ -0,0 +1,51 @@ +From a104a45ba7a51b5b4c5e8437020d9d48edf22f89 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 9 Mar 2015 12:16:42 +0200 +Subject: dmaengine: dw: append MODULE_ALIAS for platform driver + +From: Andy Shevchenko + +commit a104a45ba7a51b5b4c5e8437020d9d48edf22f89 upstream. + +The commit 9cade1a46c77 (dma: dw: split driver to library part and platform +code) introduced a separate platform driver but missed to add a +MODULE_ALIAS("platform:dw_dmac"); to that module. + +The patch adds this to get driver loaded automatically if platform device is +registered. + +Reported-by: "Blin, Jerome" +Fixes: 9cade1a46c77 (dma: dw: split driver to library part and platform code) +Signed-off-by: Andy Shevchenko +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/dma/dw/platform.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/dma/dw/platform.c ++++ b/drivers/dma/dw/platform.c +@@ -48,6 +48,8 @@ static bool dw_dma_of_filter(struct dma_ + return true; + } + ++#define DRV_NAME "dw_dmac" ++ + static struct dma_chan *dw_dma_of_xlate(struct of_phandle_args *dma_spec, + struct of_dma *ofdma) + { +@@ -293,7 +295,7 @@ static struct platform_driver dw_driver + .remove = dw_remove, + .shutdown = dw_shutdown, + .driver = { +- .name = "dw_dmac", ++ .name = DRV_NAME, + .pm = &dw_dev_pm_ops, + .of_match_table = of_match_ptr(dw_dma_of_id_table), + .acpi_match_table = ACPI_PTR(dw_dma_acpi_id_table), +@@ -314,3 +316,4 @@ module_exit(dw_exit); + + MODULE_LICENSE("GPL v2"); + MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller platform driver"); ++MODULE_ALIAS("platform:" DRV_NAME); diff --git a/queue-3.14/hfsplus-fix-b-tree-corruption-after-insertion-at-position-0.patch b/queue-3.14/hfsplus-fix-b-tree-corruption-after-insertion-at-position-0.patch new file mode 100644 index 00000000000..a0fb27265e6 --- /dev/null +++ b/queue-3.14/hfsplus-fix-b-tree-corruption-after-insertion-at-position-0.patch @@ -0,0 +1,105 @@ +From 98cf21c61a7f5419d82f847c4d77bf6e96a76f5f Mon Sep 17 00:00:00 2001 +From: Sergei Antonov +Date: Wed, 25 Mar 2015 15:55:34 -0700 +Subject: hfsplus: fix B-tree corruption after insertion at position 0 + +From: Sergei Antonov + +commit 98cf21c61a7f5419d82f847c4d77bf6e96a76f5f upstream. + +Fix B-tree corruption when a new record is inserted at position 0 in the +node in hfs_brec_insert(). In this case a hfs_brec_update_parent() is +called to update the parent index node (if exists) and it is passed +hfs_find_data with a search_key containing a newly inserted key instead +of the key to be updated. This results in an inconsistent index node. +The bug reproduces on my machine after an extents overflow record for +the catalog file (CNID=4) is inserted into the extents overflow B-tree. +Because of a low (reserved) value of CNID=4, it has to become the first +record in the first leaf node. + +The resulting first leaf node is correct: + + ---------------------------------------------------- + | key0.CNID=4 | key1.CNID=123 | key2.CNID=456, ... | + ---------------------------------------------------- + +But the parent index key0 still contains the previous key CNID=123: + + ----------------------- + | key0.CNID=123 | ... | + ----------------------- + +A change in hfs_brec_insert() makes hfs_brec_update_parent() work +correctly by preventing it from getting fd->record=-1 value from +__hfs_brec_find(). + +Along the way, I removed duplicate code with unification of the if +condition. The resulting code is equivalent to the original code +because node is never 0. + +Also hfs_brec_update_parent() will now return an error after getting a +negative fd->record value. However, the return value of +hfs_brec_update_parent() is not checked anywhere in the file and I'm +leaving it unchanged by this patch. brec.c lacks error checking after +some other calls too, but this issue is of less importance than the one +being fixed by this patch. + +Signed-off-by: Sergei Antonov +Cc: Joe Perches +Reviewed-by: Vyacheslav Dubeyko +Acked-by: Hin-Tak Leung +Cc: Anton Altaparmakov +Cc: Al Viro +Cc: Christoph Hellwig +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/hfsplus/brec.c | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +--- a/fs/hfsplus/brec.c ++++ b/fs/hfsplus/brec.c +@@ -131,13 +131,16 @@ skip: + hfs_bnode_write(node, entry, data_off + key_len, entry_len); + hfs_bnode_dump(node); + +- if (new_node) { +- /* update parent key if we inserted a key +- * at the start of the first node +- */ +- if (!rec && new_node != node) +- hfs_brec_update_parent(fd); ++ /* ++ * update parent key if we inserted a key ++ * at the start of the node and it is not the new node ++ */ ++ if (!rec && new_node != node) { ++ hfs_bnode_read_key(node, fd->search_key, data_off + size); ++ hfs_brec_update_parent(fd); ++ } + ++ if (new_node) { + hfs_bnode_put(fd->bnode); + if (!new_node->parent) { + hfs_btree_inc_height(tree); +@@ -168,9 +171,6 @@ skip: + goto again; + } + +- if (!rec) +- hfs_brec_update_parent(fd); +- + return 0; + } + +@@ -370,6 +370,8 @@ again: + if (IS_ERR(parent)) + return PTR_ERR(parent); + __hfs_brec_find(parent, fd, hfs_find_rec_by_key); ++ if (fd->record < 0) ++ return -ENOENT; + hfs_bnode_dump(parent); + rec = fd->record; + diff --git a/queue-3.14/series b/queue-3.14/series index 31e1ff5e105..719b1413237 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -25,3 +25,8 @@ of-irq-fix-of_irq_parse_one-returned-error-codes.patch perf-fix-irq_work-tail-recursion.patch staging-vt6656-vnt_rf_setpower-fix-missing-rate-rate_12m.patch vt6655-rfbsetpower-fix-missing-rate-rate_12m.patch +dmaengine-dw-append-module_alias-for-platform-driver.patch +dm-hold-suspend_lock-while-suspending-device-during-device-deletion.patch +dm-io-deal-with-wandering-queue-limits-when-handling-req_discard-and-req_write_same.patch +spi-trigger-trace-event-for-message-done-before-mesg-complete.patch +hfsplus-fix-b-tree-corruption-after-insertion-at-position-0.patch diff --git a/queue-3.14/spi-trigger-trace-event-for-message-done-before-mesg-complete.patch b/queue-3.14/spi-trigger-trace-event-for-message-done-before-mesg-complete.patch new file mode 100644 index 00000000000..5e408cc8e7f --- /dev/null +++ b/queue-3.14/spi-trigger-trace-event-for-message-done-before-mesg-complete.patch @@ -0,0 +1,53 @@ +From 391949b6f02121371e3d7d9082c6d17fd9853034 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +Date: Wed, 18 Mar 2015 11:27:28 +0100 +Subject: spi: trigger trace event for message-done before mesg->complete +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= + +commit 391949b6f02121371e3d7d9082c6d17fd9853034 upstream. + +With spidev the mesg->complete callback points to spidev_complete. +Calling this unblocks spidev_sync and so spidev_sync_write finishes. As +the struct spi_message just read is a local variable in +spidev_sync_write and recording the trace event accesses this message +the recording is better done first. The same can happen for +spidev_sync_read. + +This fixes an oops observed on a 3.14-rt system with spidev activity +after + + echo 1 > /sys/kernel/debug/tracing/events/spi/enable + + . + +Signed-off-by: Uwe Kleine-König +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/spi/spi.c ++++ b/drivers/spi/spi.c +@@ -846,13 +846,14 @@ void spi_finalize_current_message(struct + "failed to unprepare message: %d\n", ret); + } + } ++ ++ trace_spi_message_done(mesg); ++ + master->cur_msg_prepared = false; + + mesg->state = NULL; + if (mesg->complete) + mesg->complete(mesg->context); +- +- trace_spi_message_done(mesg); + } + EXPORT_SYMBOL_GPL(spi_finalize_current_message); +