From: shuo chen <1289151713@qq.com>
To: sashiko-reviews@lists.linux.dev
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH v6] ext4: rewrite ext4_convert_inline_data_nolock to make it safer
Date: Fri, 4 Sep 2026 10:06:01 +0800 [thread overview]
Message-ID: <tencent_C4778C64AB2025042F0F8DACE17843752108@qq.com> (raw)
In-Reply-To: <20260904014637.BBEE01F000E9@smtp.kernel.org>
> [Severity: High]
> Does this hardcode the extent length to 1 block, potentially leaking blocks if
> ext4_mb_new_blocks() allocates a larger contiguous extent?
>
> In ext4_convert_inline_data_nolock(), the actual allocation size is captured
> as allocated_block = EXT4_C2B(sbi, ar.len). If the allocation request returns
> multiple blocks (for example, on a bigalloc filesystem), only the first block
> is added to the extent tree here. The remaining blocks appear to be neither
> mapped nor freed, which would leave them orphaned in the block bitmap.
This is a false positive. The remaining blocks are stored in i_prealloc_node,
so they will not be leaked.
>
> [Severity: High]
> Can this error path result in a permanent data block leak?
>
> If ext4_ext_insert_extent() fails with an error like -ENOMEM or -EIO, the
> code jumps directly to the no_free label. This deliberately bypasses the
> ext4_free_blocks() call just above it. Because the calling function relies
> on ext4_set_inline_data_block() to free the newly allocated block on error,
> bypassing the free operation here appears to leave the blocks permanently
> marked as used in the filesystem.
If the error is neither EDQUOT nor ENOSPC,freeing blocks here could
lead to a more severe error.See the patch
"avoid infinite loops caused by residual data"
prev parent reply other threads:[~2026-09-04 2:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 8:33 [PATCH] Add EXT4_STATE_MAY_INLINE_DATA check in ext4_readdir pipishuo
2026-08-13 8:49 ` sashiko-bot
2026-08-14 1:27 ` shuo chen
2026-08-14 3:31 ` Theodore Tso
2026-08-14 8:40 ` shuo chen
2026-08-14 13:57 ` Theodore Tso
2026-08-15 1:43 ` shuo chen
2026-08-16 15:02 ` [PATCH v2] " shuo chen
2026-08-16 15:16 ` sashiko-bot
2026-08-16 20:05 ` [syzbot ci] " syzbot ci
2026-08-17 3:12 ` [PATCH v2] " Theodore Tso
2026-08-17 8:24 ` shuo chen
2026-08-22 16:26 ` [PATCH] " shuo chen
2026-08-22 16:43 ` sashiko-bot
2026-08-22 16:28 ` [PATCH V3] " shuo chen
2026-08-22 16:45 ` sashiko-bot
2026-08-27 8:50 ` shuo chen
2026-08-31 2:20 ` [PATCH v4] ext4: rewrite ext4_convert_inline_data_nolock to make it safer shuo chen
2026-08-31 2:34 ` sashiko-bot
2026-08-31 6:34 ` shuo chen
2026-09-02 10:10 ` [PATCH v5] " shuo chen
2026-09-02 10:24 ` sashiko-bot
2026-09-02 12:24 ` shuo chen
2026-09-04 1:30 ` [PATCH v6] " shuo chen
2026-09-04 1:46 ` sashiko-bot
2026-09-04 2:06 ` shuo chen [this message]
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=tencent_C4778C64AB2025042F0F8DACE17843752108@qq.com \
--to=1289151713@qq.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tytso@mit.edu \
/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