Skip to content
Commit 147d4a09 authored by Ritesh Harjani (IBM)'s avatar Ritesh Harjani (IBM) Committed by Theodore Ts'o
Browse files

jbd2: Remove page size assumptions



jbd2_alloc() allocates a buffer from slab when the block size is smaller
than PAGE_SIZE, and slab may be using a compound page.  Before commit
8147c4c4, we set b_page to the precise page containing the buffer
and this code worked well.  Now we set b_page to the head page of the
allocation, so we can no longer use offset_in_page().  While we could
do a 1:1 replacement with offset_in_folio(), use the more idiomatic
bh_offset() and the folio APIs to map the buffer.

This isn't enough to support a b_size larger than PAGE_SIZE on HIGHMEM
machines, but this is good enough to fix the actual bug we're seeing.

Fixes: 8147c4c4 ("jbd2: use a folio in jbd2_journal_write_metadata_buffer()")
Reported-by: default avatarZorro Lang <zlang@kernel.org>
Signed-off-by: default avatarRitesh Harjani (IBM) <ritesh.list@gmail.com>
[converted to be more folio]
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent f94cf220
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment