This is a note to let you know that I've just added the patch titled

    Btrfs: fix compressed write corruption on enospc

to the 3.16-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     btrfs-fix-compressed-write-corruption-on-enospc.patch
and it can be found in the queue-3.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From ce62003f690dff38d3164a632ec69efa15c32cbf Mon Sep 17 00:00:00 2001
From: Liu Bo <[email protected]>
Date: Thu, 24 Jul 2014 22:48:05 +0800
Subject: Btrfs: fix compressed write corruption on enospc

From: Liu Bo <[email protected]>

commit ce62003f690dff38d3164a632ec69efa15c32cbf upstream.

When failing to allocate space for the whole compressed extent, we'll
fallback to uncompressed IO, but we've forgotten to redirty the pages
which belong to this compressed extent, and these 'clean' pages will
simply skip 'submit' part and go to endio directly, at last we got data
corruption as we write nothing.

Signed-off-by: Liu Bo <[email protected]>
Tested-By: Martin Steigerwald <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/btrfs/inode.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -709,6 +709,18 @@ retry:
                                unlock_extent(io_tree, async_extent->start,
                                              async_extent->start +
                                              async_extent->ram_size - 1);
+
+                               /*
+                                * we need to redirty the pages if we decide to
+                                * fallback to uncompressed IO, otherwise we
+                                * will not submit these pages down to lower
+                                * layers.
+                                */
+                               extent_range_redirty_for_io(inode,
+                                               async_extent->start,
+                                               async_extent->start +
+                                               async_extent->ram_size - 1);
+
                                goto retry;
                        }
                        goto out_free;


Patches currently in stable-queue which might be from [email protected] are

queue-3.16/btrfs-fix-task-hang-under-heavy-compressed-write.patch
queue-3.16/btrfs-fix-crash-on-endio-of-reading-corrupted-block.patch
queue-3.16/btrfs-fix-compressed-write-corruption-on-enospc.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to