mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arbab Haider <arbabhaider649@gmail.com>
To: 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, yebin10@huawei.com,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v4 0/5] ext4: fix inline data conversion races
Date: Thu, 26 Nov 2026 12:07:44 +0500	[thread overview]
Message-ID: <20261126070748.272109-2-arbabhaider649@gmail.com> (raw)

This series addresses ext4 inline-data conversion races. Patch 1 fixes
the KUnit inode fixture so it passes on the base. Patch 2 fixes the
delayed-allocation handoff to writeback, carries the stable tags, and
can be applied independently. Patch 3 keeps synchronous conversion
state visible and serializes callers that inspect it. Patches 4 and 5
cover boot-loader swap and inode migration, respectively.

Booted each cumulative patch in QEMU x86-64 with KASAN, UBSAN and
lockdep. All five source trees passed all 22 ext4 KUnit suites. The
fixture-only tree also verifies that the two inode test failures on
the original base are fixed independently of the runtime patches.

The complete series also passed 555 ext4 KUnit tests in an arm64 QEMU
guest with lockdep and DEBUG_ATOMIC_SLEEP enabled. LKMM models of the
locked writeback handoff and rollback observation both excluded the
invalid state.
The arm64 guest also passed persistence and truncate checks on a 1 KiB
journaled filesystem and a 4 KiB filesystem without a journal.

The full series passed inline-to-block conversion, remount and data
comparison, and truncate-to-zero checks with delalloc, nodelalloc,
no journal, data journaling, 1 KiB blocks, bigalloc, fast commit and
indirect mappings. The indirect-mapping run also checked sparse reads,
SEEK_DATA/SEEK_HOLE, FIEMAP and direct reads. The boot-loader swap fix
rejected an inline file and completed a swap round trip on a disposable
image.
e2fsck -fn passed on all test images. Sashiko --no-ai passed patch
extraction and application.

Changes since v3:
- Rebase onto 4dce97c6c265 and split the change into five patches.
- Fix the nonatomic buffer lookup stub in the inode KUnit fixture.
- Publish the delayed-allocation handoff under xattr_sem and check it
  under the same write lock used to remove inline data. Return -EIO on
  an incomplete handoff and propagate inline removal and journal errors.
- Finish the delayed-allocation handoff on truncate-to-zero and on a
  failed write at size zero. Extend the inline KUnit coverage.
- Keep MAY_INLINE_DATA set through synchronous conversion and serialize
  callers that inspect inline state, preserving sparse-file readahead.
- Serialize boot-loader swap and inode migration against conversion.

Link: https://lore.kernel.org/linux-ext4/20261123172856.100887-2-arbabhaider649@gmail.com/

Arbab Haider (5):
  ext4: stub the nonatomic buffer lookup in inode KUnit tests
  ext4: fix delayed-allocation inline data conversion races
  ext4: keep EXT4_STATE_MAY_INLINE_DATA set during inline conversion
  ext4: re-check inline data under filemap_invalidate_lock in
    swap_inode_boot_loader
  ext4: serialize inode migration against concurrent inline data
    conversion

 fs/ext4/file.c        |  73 ++++++++++++++++++++------
 fs/ext4/inline-test.c |  17 +++++-
 fs/ext4/inline.c      | 118 +++++++++++++++++++++++++++++++++---------
 fs/ext4/inode-test.c  |   2 +
 fs/ext4/inode.c       |  71 ++++++++++++++++++-------
 fs/ext4/ioctl.c       |   4 ++
 fs/ext4/migrate.c     |  33 ++++++++----
 fs/ext4/readpage.c    |  15 ++++--
 8 files changed, 260 insertions(+), 73 deletions(-)


base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
-- 
2.53.0


             reply	other threads:[~2026-11-26  7:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  7:07 Arbab Haider [this message]
2026-11-26  7:07 ` [PATCH v4 1/5] ext4: stub the nonatomic buffer lookup in inode KUnit tests Arbab Haider
2026-11-26  7:07 ` [PATCH v4 2/5] ext4: fix delayed-allocation inline data conversion races Arbab Haider
2026-11-26  7:07 ` [PATCH v4 3/5] ext4: keep EXT4_STATE_MAY_INLINE_DATA set during inline conversion Arbab Haider
2026-11-26  7:07 ` [PATCH v4 4/5] ext4: re-check inline data under filemap_invalidate_lock in swap_inode_boot_loader Arbab Haider
2026-11-26  7:07 ` [PATCH v4 5/5] ext4: serialize inode migration against concurrent inline data conversion Arbab Haider

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=20261126070748.272109-2-arbabhaider649@gmail.com \
    --to=arbabhaider649@gmail.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=yebin10@huawei.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 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®