On Fri, Jun 13, 2025 at 08:07:00PM +0100, Matthew Wilcox (Oracle) wrote: > @@ -201,17 +200,16 @@ static int test_find_delalloc(u32 sectorsize, u32 nodesize) > * |--- search ---| > */ > test_start = SZ_64M; > - locked_page = find_lock_page(inode->i_mapping, > + locked_folio = filemap_lock_folio(inode->i_mapping, > test_start >> PAGE_SHIFT); > - if (!locked_page) { > - test_err("couldn't find the locked page"); > + if (!locked_folio) { > + test_err("couldn't find the locked folio"); > goto out_bits; > } > btrfs_set_extent_bit(tmp, sectorsize, max_bytes - 1, EXTENT_DELALLOC, NULL); > start = test_start; > end = start + PAGE_SIZE - 1; > - found = find_lock_delalloc_range(inode, page_folio(locked_page), &start, > - &end); > + found = find_lock_delalloc_range(inode, locked_folio, &start, &end); > if (!found) { > test_err("couldn't find delalloc in our range"); > goto out_bits; Hm. How much do you test the failure paths here? It seems to me that the 'locked_folio' is still locked at this point ... > @@ -328,8 +323,8 @@ static int test_find_delalloc(u32 sectorsize, u32 nodesize) > dump_extent_io_tree(tmp); > btrfs_clear_extent_bits(tmp, 0, total_dirty - 1, (unsigned)-1); > out: > - if (locked_page) > - put_page(locked_page); > + if (locked_folio) > + folio_put(locked_folio); And here we put it without unlocking it, which should cause the page allocator to squawk at you.