mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Sheng Yong <shengyong2021@gmail.com>, jaegeuk@kernel.org
Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Sheng Yong <shengyong1@xiaomi.com>
Subject: Re: [PATCH] f2fs: fix bio memleak when committing super block
Date: Sat, 7 Jun 2025 19:24:29 +0800	[thread overview]
Message-ID: <b5781bc9-ed04-4e3f-bbc1-126e18620ff3@kernel.org> (raw)
In-Reply-To: <20250607064116.2993239-1-shengyong1@xiaomi.com>

On 2025/6/7 14:41, Sheng Yong wrote:
> From: Sheng Yong <shengyong1@xiaomi.com>
> 
> 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: 5bcde4557862 ("f2fs: get rid of buffer_head use")
> Signed-off-by: Sheng Yong <shengyong1@xiaomi.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

  reply	other threads:[~2025-06-07 11:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-07  6:41 Sheng Yong
2025-06-07 11:24 ` Chao Yu [this message]
2025-06-24  0:40 ` [f2fs-dev] " patchwork-bot+f2fs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b5781bc9-ed04-4e3f-bbc1-126e18620ff3@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shengyong1@xiaomi.com \
    --cc=shengyong2021@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®