]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
Btrfs: copy everything if we've created an inline extent
authorJosef Bacik <jbacik@fusionio.com>
Thu, 28 Feb 2013 18:23:38 +0000 (13:23 -0500)
committerJosef Bacik <jbacik@fusionio.com>
Thu, 28 Feb 2013 18:33:20 +0000 (13:33 -0500)
I noticed while looking into a tree logging bug that we aren't logging inline
extents properly.  Since this requires copying and it shouldn't happen too often
just force us to copy everything for the inode into the tree log when we have an
inline extent.  With this patch we have valid data after a crash when we write
an inline extent.  Thanks,

Cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/inode.c

index 9ef7a5b1b77ecf78bfeeed6feab4bc2652d8f9c5..ecd9c4cdb0db934c900fa8723cff1bbfbe16bef3 100644 (file)
@@ -266,6 +266,7 @@ static noinline int cow_file_range_inline(struct btrfs_trans_handle *trans,
                return 1;
        }
 
+       set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags);
        btrfs_delalloc_release_metadata(inode, end + 1 - start);
        btrfs_drop_extent_cache(inode, start, aligned_end - 1, 0);
        return 0;