--- /dev/null
+From d331a415aef98717393dda0be69b7947da08eba3 Mon Sep 17 00:00:00 2001
+From: Anand Avati <avati@redhat.com>
+Date: Tue, 20 Aug 2013 02:21:07 -0400
+Subject: fuse: invalidate inode attributes on xattr modification
+
+From: Anand Avati <avati@redhat.com>
+
+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 <avati@redhat.com>
+Reviewed-by: Brian Foster <bfoster@redhat.com>
+Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/fuse/dir.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/fs/fuse/dir.c
++++ b/fs/fuse/dir.c
+@@ -1439,6 +1439,8 @@ static int fuse_setxattr(struct dentry *
+ fc->no_setxattr = 1;
+ err = -EOPNOTSUPP;
+ }
++ if (!err)
++ fuse_invalidate_attr(inode);
+ return err;
+ }
+
+@@ -1568,6 +1570,8 @@ static int fuse_removexattr(struct dentr
+ fc->no_removexattr = 1;
+ err = -EOPNOTSUPP;
+ }
++ if (!err)
++ fuse_invalidate_attr(inode);
+ return err;
+ }
+
--- /dev/null
+From 4a4ac4eba1010ef9a804569058ab29e3450c0315 Mon Sep 17 00:00:00 2001
+From: Maxim Patlasov <MPatlasov@parallels.com>
+Date: Mon, 12 Aug 2013 20:39:30 +0400
+Subject: fuse: postpone end_page_writeback() in fuse_writepage_locked()
+
+From: Maxim Patlasov <MPatlasov@parallels.com>
+
+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 <mpatlasov@parallels.com>
+Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/fuse/file.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/fuse/file.c
++++ b/fs/fuse/file.c
+@@ -1298,7 +1298,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);
+@@ -1306,6 +1305,8 @@ static int fuse_writepage_locked(struct
+ fuse_flush_writepages(inode);
+ spin_unlock(&fc->lock);
+
++ end_page_writeback(page);
++
+ return 0;
+
+ err_free:
--- /dev/null
+From f936f9b67b7f8c2eae01dd303a0e90bd777c4679 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Sat, 24 Aug 2013 23:38:15 -0400
+Subject: mmc: tmio_mmc_dma: fix PIO fallback on SDHI
+
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+
+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 <sergei.shtylyov@cogentembedded.com>
+Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Signed-off-by: Chris Ball <cjb@laptop.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -88,6 +88,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;
+@@ -100,7 +101,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__,
+@@ -169,6 +169,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;
+@@ -181,7 +182,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__,
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
+mmc-tmio_mmc_dma-fix-pio-fallback-on-sdhi.patch
+fuse-postpone-end_page_writeback-in-fuse_writepage_locked.patch
+fuse-invalidate-inode-attributes-on-xattr-modification.patch