memory leaks in btrfs raid code in 6.19-rc?
When running xfstests on btrfs with a SCRATCH_DEV_POOL and kmemleak enabled I see a lot of these kmemleak reports, start with btrfs/060, but affecting basically all tests exercising the RAID code:
unreferenced object 0xffff888111f61890 (size 16):
comm "fsstress", pid 5252, jiffies 4294898624
hex dump (first 16 bytes):
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
backtrace (crc d3088d4f):
__kmalloc_noprof+0x3c8/0x510
alloc_rbio.isra.0+0x127/0x390
raid56_parity_write+0x2b/0x180
btrfs_submit_bbio+0x26d/0x870
submit_one_bio+0x7a/0xb0
submit_extent_folio+0x163/0x320
extent_writepage_io+0x2c9/0x4d0
extent_write_cache_pages+0x396/0x9d0
btrfs_writepages+0x70/0x120
do_writepages+0xc8/0x160
filemap_writeback+0xb3/0xe0
btrfs_fdatawrite_range+0x22/0x60
btrfs_wait_ordered_range+0x47/0x110
btrfs_fallocate+0x193/0x11a0
vfs_fallocate+0x160/0x3c0
__x64_sys_fallocate+0x44/0xa0Quoted 10 lines · Christoph Hellwig
When running xfstests on btrfs with a
SCRATCH_DEV_POOLand kmemleak enabled I see a lot of these kmemleak reports, start with btrfs/060, but affecting basically all tests exercising the RAID code:unreferenced object
0xffff888111f61890(size 16):
comm "fsstress", pid 5252, jiffies 4294898624
hex dump (first 16 bytes):
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
backtrace (crcd3088d4f):
Quoted 16 lines
__kmalloc_noprof+0x3c8/0x510
alloc_rbio.isra.0+0x127/0x390
raid56_parity_write+0x2b/0x180
btrfs_submit_bbio+0x26d/0x870
submit_one_bio+0x7a/0xb0
submit_extent_folio+0x163/0x320
extent_writepage_io+0x2c9/0x4d0
extent_write_cache_pages+0x396/0x9d0
btrfs_writepages+0x70/0x120
do_writepages+0xc8/0x160
filemap_writeback+0xb3/0xe0
btrfs_fdatawrite_range+0x22/0x60
btrfs_wait_ordered_range+0x47/0x110
btrfs_fallocate+0x193/0x11a0
vfs_fallocate+0x160/0x3c0
__x64_sys_fallocate+0x44/0xa0This fixes it:
Thanks.