From: "Zhou, Yun" <yun.zhou@windriver.com>
To: sashiko-reviews@lists.linux.dev, Jan Kara <jack@suse.cz>
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: prevent inline data creation on extent-based inodes
Date: Thu, 2 Jul 2026 15:41:31 +0800 [thread overview]
Message-ID: <b0ad6ac3-2c97-4b8c-8dfe-365cff9b0645@windriver.com> (raw)
In-Reply-To: <20260702013848.129961F000E9@smtp.kernel.org>
On 7/2/26 09:38, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
>
> New issues:
> - [High] The patch completely breaks the inline data feature for all new files and directories on extents-enabled filesystems.
>
> Pre-existing issues:
> - [High] The patch fails to resolve the data corruption race condition on filesystems where the `extents` feature is disabled, leaving indirect-mapped files vulnerable.
> --
>
>> diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
>> index 0eff4a0c6a6c3..2fcafbdb7b15c 100644
>> --- a/fs/ext4/inline.c
>> +++ b/fs/ext4/inline.c
>> @@ -418,6 +418,13 @@ static int ext4_prepare_inline_data(handle_t *handle, struct inode *inode,
>> return -ENOSPC;
>>
>> ext4_write_lock_xattr(inode, &no_expand);
>> +
>> + /* Once converted to extents, never go back to inline data. */
>> + if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
>
> [Severity: High]
> Does this completely disable inline data for all newly created files and
> directories on extents-enabled filesystems?
>
> Looking at __ext4_new_inode(), it appears newly created inodes inherently
> have the EXT4_INODE_EXTENTS flag set:
>
> fs/ext4/ialloc.c:__ext4_new_inode() {
> ...
> ext4_set_inode_flag(inode, EXT4_INODE_EXTENTS);
> ...
> }
>
> If ext4_prepare_inline_data() is called during a write or directory creation
> for a new inode, wouldn't this new check evaluate to true and unconditionally
> abort the inline data creation by returning -ENOSPC?
>
My apologies, my analysis was incorrect, and I am currently working on a
new fix.
Please ignore this version.
prev parent reply other threads:[~2026-07-02 7:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 1:09 [PATCH] ext4: prevent inline data creation on extent-based inodes Yun Zhou
[not found] ` <20260702013848.129961F000E9@smtp.kernel.org>
2026-07-02 7:41 ` Zhou, Yun [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=b0ad6ac3-2c97-4b8c-8dfe-365cff9b0645@windriver.com \
--to=yun.zhou@windriver.com \
--cc=jack@suse.cz \
--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