Linux EXT4 FS development
 help / color / mirror / Atom feed
From: "Zhou, Yun" <yun.zhou@windriver.com>
To: Theodore Tso <tytso@mit.edu>
Cc: adilger.kernel@dilger.ca, libaokun@linux.alibaba.com,
	jack@suse.cz, ojaswin@linux.ibm.com, ritesh.list@gmail.com,
	yi.zhang@huawei.com, linux-ext4@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/9] ext4: phase out inline data write paths for regular files
Date: Wed, 29 Jul 2026 11:12:17 +0800	[thread overview]
Message-ID: <2b7e4668-9679-42e5-b71d-14b49e702624@windriver.com> (raw)
In-Reply-To: <amdhvSR2YL-3AJKS@mit.edu>

Hi Ted, 
  

  
  

Thanks for the thoughtful suggestion.

On 7/27/26 23:03, Theodore Tso wrote:
> I agree that inline_data feature has been a persistent source of bugs,
> and is relatively minimal for data files.  Howvever, the regular files
> that are small enough to support inline data come really boring filess
> where we're not doing the really stressful things that fsx, fstress,
> syzbot, etc. do to punish the file system.
> 

The "boring file" argument assumes benign workloads. Under adversarial 
conditions (which CVE assignments reflect), any race window is 
exploitable regardless of how unlikely it is under normal use.

> I do think there will be some systems where there might be enough
> small files (especially when the blocksize is 64k, and the inode size
> is larger --- perhaps 4k) where it might be worthwhile to support the
> "boring" inline data files, e.g., small config files, header files
> etc., where the file is written once, and closed, and never modified
> again.
> 

With 64K blocks, the internal fragmentation alone wastes on average 32K 
per file (vs. 2K with 4K blocks).  For a filesystem with n files, the 
extra tail waste is n * 30K. Meanwhile, enlarging the inode (say to 4K) 
wastes m * 3840B for *all* pre-allocated inodes (m > n), used or not.

A system configured to accept this level of space waste for performance 
is unlikely to care about saving one 64K block per small file.  And if 
small files are rare enough to tolerate 64K blocks, inline data benefits 
even fewer files.

> So what if we had a mechanism where we're using delayed allocation, if
> the are no open file descriptor, so races and deadlocks can be
> avoided, and in that case, we can write it as an inline regular data
> file.  Otherwise, we back it using a regular block.  I think this
> would get us 95% of the benefits of inline data files, with much less
> of the complexity cost.
>

This is an interesting approach and could potentially work. That said, 
new mechanisms often introduce new race conditions. Do the minor gains 
truly justify the added complexity? No major distribution enables 
inline_data by default. The feature has been available for 14 years and 
remains opt-in, suggesting the benefit has never been compelling enough 
for general use.

It's not worth introducing new complexity for a feature that has no 
actual users and keeps introducing bugs. However, I am open to 
investigating this further in the hope of finding a good balance.

BR,
Yun

      reply	other threads:[~2026-07-29  3:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 10:54 [RFC PATCH 0/9] ext4: phase out inline data write paths for regular files Yun Zhou
2026-07-27 10:54 ` [RFC PATCH 1/9] ext4: add deprecation warning for inline_data feature Yun Zhou
2026-07-27 10:54 ` [RFC PATCH 2/9] ext4: stop creating inline data for new regular files Yun Zhou
2026-07-27 10:54 ` [RFC PATCH 3/9] ext4: use safe convert path for inline data write overflow Yun Zhou
2026-07-27 10:54 ` [RFC PATCH 4/9] ext4: remove inline data write paths for regular files Yun Zhou
2026-07-27 10:54 ` [RFC PATCH 5/9] ext4: remove dead inline data write code Yun Zhou
2026-07-27 10:54 ` [RFC PATCH 6/9] ext4: allocate block before destroying inline data in conversion Yun Zhou
2026-07-27 10:54 ` [RFC PATCH 7/9] ext4: remove DA convert path for regular file inline data Yun Zhou
2026-07-27 10:54 ` [RFC PATCH 8/9] ext4: document inline_data deprecation Yun Zhou
2026-07-27 10:54 ` [RFC PATCH 9/9] ext4: populate extent entry atomically during inline data destroy Yun Zhou
2026-07-27 15:03 ` [RFC PATCH 0/9] ext4: phase out inline data write paths for regular files Theodore Tso
2026-07-29  3:12   ` 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=2b7e4668-9679-42e5-b71d-14b49e702624@windriver.com \
    --to=yun.zhou@windriver.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=jack@suse.cz \
    --cc=libaokun@linux.alibaba.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --cc=tytso@mit.edu \
    --cc=yi.zhang@huawei.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