Skip to content

Commit 7b83060

Browse files
jan-kiszkatrini
authored andcommitted
fs: ext4: Fix alignment of cache buffers
We need to align the cache buffer to ARCH_DMA_MINALIGN in order to avoid access errors like CACHE: Misaligned operation at range [be0231e0, be0235e0] seen on the MCIMX7SABRE. Fixes: d5aee65 ("fs: ext4: cache extent data") Signed-off-by: Jan Kiszka <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Stephen Warren <[email protected]> Tested-by: Peter Robinson <[email protected]>
1 parent cb11eed commit 7b83060

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/ext4fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ int ext_cache_read(struct ext_block_cache *cache, lbaint_t block, int size)
288288
if (cache->buf && cache->block == block && cache->size == size)
289289
return 1;
290290
ext_cache_fini(cache);
291-
cache->buf = malloc(size);
291+
cache->buf = memalign(ARCH_DMA_MINALIGN, size);
292292
if (!cache->buf)
293293
return 0;
294294
if (!ext4fs_devread(block, 0, size, cache->buf)) {

0 commit comments

Comments
 (0)