From: Greg Kroah-Hartman Date: Tue, 24 Sep 2013 23:27:09 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.0.97~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84819639ae9452a8d35a690b4361fccac69ae95a;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: fuse-invalidate-inode-attributes-on-xattr-modification.patch fuse-postpone-end_page_writeback-in-fuse_writepage_locked.patch mmc-tmio_mmc_dma-fix-pio-fallback-on-sdhi.patch of-fix-missing-memory-initialization-on-fdt-unflattening.patch --- diff --git a/queue-3.4/fuse-invalidate-inode-attributes-on-xattr-modification.patch b/queue-3.4/fuse-invalidate-inode-attributes-on-xattr-modification.patch new file mode 100644 index 00000000000..491c9d1ce20 --- /dev/null +++ b/queue-3.4/fuse-invalidate-inode-attributes-on-xattr-modification.patch @@ -0,0 +1,41 @@ +From d331a415aef98717393dda0be69b7947da08eba3 Mon Sep 17 00:00:00 2001 +From: Anand Avati +Date: Tue, 20 Aug 2013 02:21:07 -0400 +Subject: fuse: invalidate inode attributes on xattr modification + +From: Anand Avati + +commit d331a415aef98717393dda0be69b7947da08eba3 upstream. + +Calls like setxattr and removexattr result in updation of ctime. +Therefore invalidate inode attributes to force a refresh. + +Signed-off-by: Anand Avati +Reviewed-by: Brian Foster +Signed-off-by: Miklos Szeredi +Signed-off-by: Greg Kroah-Hartman + +--- + fs/fuse/dir.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/fs/fuse/dir.c ++++ b/fs/fuse/dir.c +@@ -1503,6 +1503,8 @@ static int fuse_setxattr(struct dentry * + fc->no_setxattr = 1; + err = -EOPNOTSUPP; + } ++ if (!err) ++ fuse_invalidate_attr(inode); + return err; + } + +@@ -1632,6 +1634,8 @@ static int fuse_removexattr(struct dentr + fc->no_removexattr = 1; + err = -EOPNOTSUPP; + } ++ if (!err) ++ fuse_invalidate_attr(inode); + return err; + } + diff --git a/queue-3.4/fuse-postpone-end_page_writeback-in-fuse_writepage_locked.patch b/queue-3.4/fuse-postpone-end_page_writeback-in-fuse_writepage_locked.patch new file mode 100644 index 00000000000..52318a2b9eb --- /dev/null +++ b/queue-3.4/fuse-postpone-end_page_writeback-in-fuse_writepage_locked.patch @@ -0,0 +1,59 @@ +From 4a4ac4eba1010ef9a804569058ab29e3450c0315 Mon Sep 17 00:00:00 2001 +From: Maxim Patlasov +Date: Mon, 12 Aug 2013 20:39:30 +0400 +Subject: fuse: postpone end_page_writeback() in fuse_writepage_locked() + +From: Maxim Patlasov + +commit 4a4ac4eba1010ef9a804569058ab29e3450c0315 upstream. + +The patch fixes a race between ftruncate(2), mmap-ed write and write(2): + +1) An user makes a page dirty via mmap-ed write. +2) The user performs shrinking truncate(2) intended to purge the page. +3) Before fuse_do_setattr calls truncate_pagecache, the page goes to + writeback. fuse_writepage_locked fills FUSE_WRITE request and releases + the original page by end_page_writeback. +4) fuse_do_setattr() completes and successfully returns. Since now, i_mutex + is free. +5) Ordinary write(2) extends i_size back to cover the page. Note that + fuse_send_write_pages do wait for fuse writeback, but for another + page->index. +6) fuse_writepage_locked proceeds by queueing FUSE_WRITE request. + fuse_send_writepage is supposed to crop inarg->size of the request, + but it doesn't because i_size has already been extended back. + +Moving end_page_writeback to the end of fuse_writepage_locked fixes the +race because now the fact that truncate_pagecache is successfully returned +infers that fuse_writepage_locked has already called end_page_writeback. +And this, in turn, infers that fuse_flush_writepages has already called +fuse_send_writepage, and the latter used valid (shrunk) i_size. write(2) +could not extend it because of i_mutex held by ftruncate(2). + +Signed-off-by: Maxim Patlasov +Signed-off-by: Miklos Szeredi +Signed-off-by: Greg Kroah-Hartman + +--- + fs/fuse/file.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/fuse/file.c ++++ b/fs/fuse/file.c +@@ -1294,7 +1294,6 @@ static int fuse_writepage_locked(struct + + inc_bdi_stat(mapping->backing_dev_info, BDI_WRITEBACK); + inc_zone_page_state(tmp_page, NR_WRITEBACK_TEMP); +- end_page_writeback(page); + + spin_lock(&fc->lock); + list_add(&req->writepages_entry, &fi->writepages); +@@ -1302,6 +1301,8 @@ static int fuse_writepage_locked(struct + fuse_flush_writepages(inode); + spin_unlock(&fc->lock); + ++ end_page_writeback(page); ++ + return 0; + + err_free: diff --git a/queue-3.4/mmc-tmio_mmc_dma-fix-pio-fallback-on-sdhi.patch b/queue-3.4/mmc-tmio_mmc_dma-fix-pio-fallback-on-sdhi.patch new file mode 100644 index 00000000000..28c619e5d65 --- /dev/null +++ b/queue-3.4/mmc-tmio_mmc_dma-fix-pio-fallback-on-sdhi.patch @@ -0,0 +1,62 @@ +From f936f9b67b7f8c2eae01dd303a0e90bd777c4679 Mon Sep 17 00:00:00 2001 +From: Sergei Shtylyov +Date: Sat, 24 Aug 2013 23:38:15 -0400 +Subject: mmc: tmio_mmc_dma: fix PIO fallback on SDHI + +From: Sergei Shtylyov + +commit f936f9b67b7f8c2eae01dd303a0e90bd777c4679 upstream. + +I'm testing SH-Mobile SDHI driver in DMA mode with a new DMA controller using +'bonnie++' and getting DMA error after which the tmio_mmc_dma.c code falls back +to PIO but all commands time out after that. It turned out that the fallback +code calls tmio_mmc_enable_dma() with RX/TX channels already freed and pointers +to them cleared, so that the function bails out early instead of clearing the +DMA bit in the CTL_DMA_ENABLE register. The regression was introduced by commit +162f43e31c5a376ec16336e5d0ac973373d54c89 (mmc: tmio: fix a deadlock). +Moving tmio_mmc_enable_dma() calls to the top of the PIO fallback code in +tmio_mmc_start_dma_{rx|tx}() helps. + +Signed-off-by: Sergei Shtylyov +Acked-by: Guennadi Liakhovetski +Signed-off-by: Chris Ball +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/host/tmio_mmc_dma.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/mmc/host/tmio_mmc_dma.c ++++ b/drivers/mmc/host/tmio_mmc_dma.c +@@ -104,6 +104,7 @@ static void tmio_mmc_start_dma_rx(struct + pio: + if (!desc) { + /* DMA failed, fall back to PIO */ ++ tmio_mmc_enable_dma(host, false); + if (ret >= 0) + ret = -EIO; + host->chan_rx = NULL; +@@ -116,7 +117,6 @@ pio: + } + dev_warn(&host->pdev->dev, + "DMA failed: %d, falling back to PIO\n", ret); +- tmio_mmc_enable_dma(host, false); + } + + dev_dbg(&host->pdev->dev, "%s(): desc %p, cookie %d, sg[%d]\n", __func__, +@@ -185,6 +185,7 @@ static void tmio_mmc_start_dma_tx(struct + pio: + if (!desc) { + /* DMA failed, fall back to PIO */ ++ tmio_mmc_enable_dma(host, false); + if (ret >= 0) + ret = -EIO; + host->chan_tx = NULL; +@@ -197,7 +198,6 @@ pio: + } + dev_warn(&host->pdev->dev, + "DMA failed: %d, falling back to PIO\n", ret); +- tmio_mmc_enable_dma(host, false); + } + + dev_dbg(&host->pdev->dev, "%s(): desc %p, cookie %d\n", __func__, diff --git a/queue-3.4/of-fix-missing-memory-initialization-on-fdt-unflattening.patch b/queue-3.4/of-fix-missing-memory-initialization-on-fdt-unflattening.patch new file mode 100644 index 00000000000..f1023d6c6a8 --- /dev/null +++ b/queue-3.4/of-fix-missing-memory-initialization-on-fdt-unflattening.patch @@ -0,0 +1,33 @@ +From 0640332e073be9207f0784df43595c0c39716e42 Mon Sep 17 00:00:00 2001 +From: Grant Likely +Date: Wed, 28 Aug 2013 21:24:17 +0100 +Subject: of: Fix missing memory initialization on FDT unflattening + +From: Grant Likely + +commit 0640332e073be9207f0784df43595c0c39716e42 upstream. + +Any calls to dt_alloc() need to be zeroed. This is a temporary fix, but +the allocation function itself needs to zero memory before returning +it. This is a follow up to patch 9e4012752, "of: fdt: fix memory +initialization for expanded DT" which fixed one call site but missed +another. + +Signed-off-by: Grant Likely +Acked-by: Wladislav Wiebe +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/of/base.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/of/base.c ++++ b/drivers/of/base.c +@@ -1227,6 +1227,7 @@ void of_alias_scan(void * (*dt_alloc)(u6 + ap = dt_alloc(sizeof(*ap) + len + 1, 4); + if (!ap) + continue; ++ memset(ap, 0, sizeof(*ap) + len + 1); + ap->alias = start; + of_alias_add(ap, np, id, start, len); + } diff --git a/queue-3.4/series b/queue-3.4/series index 7ff4b787618..5062acf206d 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -34,3 +34,7 @@ memcg-fix-multiple-large-threshold-notifications.patch mm-huge_memory.c-fix-potential-null-pointer-dereference.patch isofs-refuse-rw-mount-of-the-filesystem-instead-of-making-it-ro.patch drm-edid-add-quirk-for-medion-md30217pg.patch +mmc-tmio_mmc_dma-fix-pio-fallback-on-sdhi.patch +of-fix-missing-memory-initialization-on-fdt-unflattening.patch +fuse-postpone-end_page_writeback-in-fuse_writepage_locked.patch +fuse-invalidate-inode-attributes-on-xattr-modification.patch