Commit 147d4a0
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
8147c4c, 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: 8147c4c ("jbd2: use a folio in jbd2_journal_write_metadata_buffer()")
Reported-by: Zorro Lang <zlang@kernel.org>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
[converted to be more folio]
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>1 parent f94cf22 commit 147d4a0
2 files changed
Lines changed: 10 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | 301 | | |
303 | 302 | | |
304 | 303 | | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
309 | 307 | | |
310 | 308 | | |
311 | 309 | | |
| |||
322 | 320 | | |
323 | 321 | | |
324 | 322 | | |
325 | | - | |
326 | 323 | | |
327 | 324 | | |
328 | 325 | | |
| |||
331 | 328 | | |
332 | 329 | | |
333 | 330 | | |
334 | | - | |
| 331 | + | |
335 | 332 | | |
336 | | - | |
337 | | - | |
338 | | - | |
| 333 | + | |
| 334 | + | |
339 | 335 | | |
340 | 336 | | |
341 | 337 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
938 | | - | |
939 | | - | |
940 | 938 | | |
941 | 939 | | |
942 | 940 | | |
943 | 941 | | |
944 | | - | |
945 | | - | |
946 | | - | |
| 942 | + | |
947 | 943 | | |
948 | | - | |
949 | | - | |
950 | | - | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
951 | 947 | | |
952 | 948 | | |
953 | 949 | | |
| |||
0 commit comments