From c9795396edd53ad29537037de8fd752662c676ad Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 22 Sep 2018 04:13:35 +0200 Subject: fs: btrfs: Fix cache alignment bugs The btrfs implementation passes cache-unaligned buffers into the block layer, which triggers cache alignment problems down in the block device drivers. Align the buffers to prevent this. Signed-off-by: Marek Vasut Cc: Marek Behun --- fs/btrfs/extent-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/btrfs/extent-io.c') diff --git a/fs/btrfs/extent-io.c b/fs/btrfs/extent-io.c index 7263f41644..66d0e1c7d6 100644 --- a/fs/btrfs/extent-io.c +++ b/fs/btrfs/extent-io.c @@ -7,6 +7,7 @@ #include "btrfs.h" #include +#include u64 btrfs_read_extent_inline(struct btrfs_path *path, struct btrfs_file_extent_item *extent, u64 offset, @@ -89,7 +90,7 @@ u64 btrfs_read_extent_reg(struct btrfs_path *path, return size; } - cbuf = malloc(dlen > size ? clen + dlen : clen); + cbuf = malloc_cache_aligned(dlen > size ? clen + dlen : clen); if (!cbuf) return -1ULL; -- cgit