Skip to contentSkip to conversation

fs: btrfs: Add missing cache aligned allocation

PATCH In review Marek Vasut 3 participants 3 messages May 17, 2021 – May 27, 2021 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: btrfs: Add missing cache aligned allocation

The superblock buffer must be cache aligned, since it might be used in DMA context, allocate it using ALLOC_CACHE_ALIGN_BUFFER() just like it was done in btrfs_read_superblock() and read_tree_node().

This fixes this output on boot and non-working btrfs on iMX53:
CACHE: Misaligned operation at range [ced299d0, ced2a9d0]

Cc Marek Beh?n <[email protected]>
Cc Qu Wenruo <[email protected]>
---
 fs/btrfs/disk-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/disk-io.c +1 -1
index c6fdec95c16..349411c3ccd 100644
@@ -291,7 +291,7 @@ error_out:
 int btrfs_read_dev_super(struct blk_desc *desc, struct disk_partition *part,
 			 struct btrfs_super_block *sb)
 {
-	char tmp[BTRFS_SUPER_INFO_SIZE];
+	ALLOC_CACHE_ALIGN_BUFFER(char, tmp, BTRFS_SUPER_INFO_SIZE);
 	struct btrfs_super_block *buf = (struct btrfs_super_block *)tmp;
 	int ret;
 
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/1 fs: btrfs: Add missing cache aligned allocation

Quoted 11 lines · On Tue, 18 May 2021 00:39:39 +0200 Marek Vasut <[email protected]> wrote:

The superblock buffer must be cache aligned, since it might be used in DMA context, allocate it using ALLOC_CACHE_ALIGN_BUFFER() just like it was done in btrfs_read_superblock() and read_tree_node().

This fixes this output on boot and non-working btrfs on iMX53:
CACHE: Misaligned operation at range [ced299d0, ced2a9d0]

Cc Marek Beh?n <[email protected]>
Cc Qu Wenruo <[email protected]>

---

#2 lore raw
In reply to Marek Vasut
Quoted 11 lines · Marek Vasut

The superblock buffer must be cache aligned, since it might be used in DMA context, allocate it using ALLOC_CACHE_ALIGN_BUFFER() just like it was done in btrfs_read_superblock() and read_tree_node().

This fixes this output on boot and non-working btrfs on iMX53:
CACHE: Misaligned operation at range [ced299d0, ced2a9d0]

Applied to u-boot/master, thanks!

Signature · 1 line
Tom