Commit f439bf1
f2fs: fix bio memleak when committing super block
[ Upstream commit 554d9b7 ]
When committing new super block, bio is allocated but not freed, and
kmemleak complains:
unreferenced object 0xffff88801d185600 (size 192):
comm "kworker/3:2", pid 128, jiffies 4298624992
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 80 67 c3 00 81 88 ff ff .........g......
01 08 06 00 00 00 00 00 00 00 00 00 01 00 00 00 ................
backtrace (crc 650ecdb1):
kmem_cache_alloc_noprof+0x3a9/0x460
mempool_alloc_noprof+0x12f/0x310
bio_alloc_bioset+0x1e2/0x7e0
__f2fs_commit_super+0xe0/0x370
f2fs_commit_super+0x4ed/0x8c0
f2fs_record_error_work+0xc7/0x190
process_one_work+0x7db/0x1970
worker_thread+0x518/0xea0
kthread+0x359/0x690
ret_from_fork+0x34/0x70
ret_from_fork_asm+0x1a/0x30
The issue can be reproduced by:
mount /dev/vda /mnt
i=0
while :; do
echo '[h]abc' > /sys/fs/f2fs/vda/extension_list
echo '[h]!abc' > /sys/fs/f2fs/vda/extension_list
echo scan > /sys/kernel/debug/kmemleak
dmesg | grep "new suspected memory leaks"
[ $? -eq 0 ] && break
i=$((i + 1))
echo "$i"
done
umount /mnt
Fixes: 5bcde45 ("f2fs: get rid of buffer_head use")
Signed-off-by: Sheng Yong <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>1 parent f653d6a commit f439bf1
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3451 | 3451 | | |
3452 | 3452 | | |
3453 | 3453 | | |
| 3454 | + | |
3454 | 3455 | | |
3455 | 3456 | | |
3456 | 3457 | | |
| |||
0 commit comments