All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Tso" <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: Guanghui Yang <3497809730@qq.com>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Baokun Li <libaokun@linux.alibaba.com>,
	Ojaswin Mujoo <ojaswin@linux.ibm.com>,
	Ritesh Harjani <ritesh.list@gmail.com>,
	Zhang Yi <yi.zhang@huawei.com>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] ext4: orphan tracking after a failed truncate
Date: Mon, 17 Aug 2026 23:04:43 -0400	[thread overview]
Message-ID: <aoO8e1eD5ZChWKdH@mit.edu> (raw)
In-Reply-To: <66vcv4ircw5mqadt4eki52hujmykrrsqp2cux4qvn37v6kzvs7@d7ys45emz3dr>

On Mon, Aug 17, 2026 at 05:56:24PM -0500, Jan Kara wrote:
> This is expected. If you hit IO error on metadata, all bets are off wrt
> filesystem consistency. Running e2fsck to fix the filesystem is the only
> way to establish filesystem consistency again. So there's nothing to fix in
> the kernel really as the fact that an inode with blocks beyond EOF is not
> on orphan list is just a little nuissance...

If we want to let the system administrator know that they should run
fsck, then perhaps we should call ext4_error_inode() and return
EFSCORRUPTED instead of EIO.  In general, if we are in the middle of
modifying file system metadata, and we run into an error, we should
either try to back out the change so the file system is consistent.

HOWEVER, in this case, blocks beyond EOF is not really a file system
consistency issue, since you can get blocks beyond EOF by using the
fallocate system call with FALLOC_FL_KEEP_SIZE flag.

> Quick note for Ted: these kind of reports where LLM complains about
> inconsistencies after IO errors or other catastrophic failures are rather
> frequent. I think that would be a good candidate for an ext4 specific
> prompt for LLMs to explain to it that after metadata IO failure filesystem
> inconsistencies are expected and we should just strive to limit lost data.

Unfortunately, it's a bit tricky to do that.  The problem is that
LLM's aren't consistent about how they handle AGENTS.md or CLAUDE.md
file.  Despite AGENTS.md being a standard promulgated by the LF's
Agentic AI Foundation, not all LLM harneses will read a AGENTS.md file
located a directory outside of the repository root directory.

So if we put LLM Harness directives in fs/ext4/AGENTS.md, some
harnesses (including Github's Copilot or OpenAI Codex) won't read it
unless there is an explicit request read it in the top-level AGENTS.md
file.  We could have the top-level AGENTS.md say that for any
file-system related code, please read fs/AGENTS.md, and then the
fs/AGENTS.md file could say that in case of a btrfs-related issue,
read fs/btrfs/AGENTS.md, and if it's an ext4-related, to please read
fs/ext4/AGENTS.md, etc.  It very quickly becomes a mess.

Worse, Claude has steadfastly refused to honor the AGENTS.md file
(although at least it will read CLAUDE.md file in subdirectories).  So
we'd have to have CLAUDE.md file be a symlink to AGENTS.md, or to have
an instruction in CLAUDE.md to read AGENTS.md.

Probably the best we can do is to put generic documentation in
Documentation/filesystems/ext4, meant for both humans and LLM's,
describing ext4's error handling philosophy, and hope the LLM
harnesses bothers to read it.

						- Ted



  reply	other threads:[~2026-08-18  3:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-09  5:45 [RFC] ext4: orphan tracking after a failed truncate Guanghui Yang
2026-08-17 15:56 ` Jan Kara
2026-08-18  3:04   ` Theodore Tso [this message]
2026-08-18  4:41   ` Zhang Yi
2026-08-18 13:48     ` Theodore Tso

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=aoO8e1eD5ZChWKdH@mit.edu \
    --to=tytso@mit.edu \
    --cc=3497809730@qq.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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.