From: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: Theodore Ts'o <tytso@mit.edu>, Jan Kara <jack@suse.cz>,
John Garry <john.g.garry@oracle.com>,
djwong@kernel.org, Ojaswin Mujoo <ojaswin@linux.ibm.com>,
linux-fsdevel@vger.kernel.org,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Subject: [PATCH v4 0/7] ext4: Add multi-fsblock atomic write support with bigalloc
Date: Thu, 15 May 2025 20:15:32 +0530 [thread overview]
Message-ID: <cover.1747289779.git.ritesh.list@gmail.com> (raw)
This adds multi-fsblock atomic write support to ext4 using bigalloc. The major
chunk of the design changes are kept in Patch-4 & 5 which still needs to be
reviewed.
v3 -> v4:
=========
1. Added force txn commit in ext4_iomap_alloc(), in case we ended up allocating
and converting unwritten to written conversion during allocation time. This
happens when the underlying region has mixed mapping [1].
2. Addressed review comments from Darrick and Ojaswin.
3. Ran few data integrity tests on actual nvme device supporting atomic writes.
[v2]: https://lore.kernel.org/linux-ext4/cover.1746734745.git.ritesh.list@gmail.com/
[1]: https://lore.kernel.org/linux-ext4/87msbfyqcm.fsf@gmail.com/T/#m9f6607cc0e65e9fd29e675c5c15b3a03ff02110e
v2 -> v3:
=========
1. Improved error handling at several places.
2. Further fixed some worst case journal credits estimation.
3. Added better checks in the slow path allocation loop for atomic writes.
v3 testing so far:
===============
- This has survived "quick" & "auto" group testing with bigalloc on x86 and Power.
- We have also tested atomic write related tests using fio and some data integrity
tests with sudden power off during writes on scsi_debug module.
(Will clean up these tests and try to post them out soon!)
Appreciate any review comments / feedback!
v1 -> v2:
==========
1. Handled review comments from Ojaswin to optimize the ext4_map_block() calls
in ext4_iomap_alloc().
2. Fixed the journal credits calculation for both:
- during block allocation in ext4_iomap_alloc()
- during dio completion in ->end_io callback.
Earlier we were starting multiple txns in ->end_io callback for unwritten to
written conversion. But since in case of atomic writes, we want a single jbd2
txn, hence made the necessary changes there.
[v2]: https://lore.kernel.org/linux-ext4/cover.1745987268.git.ritesh.list@gmail.com/
Ritesh Harjani (IBM) (7):
ext4: Document an edge case for overwrites
ext4: Check if inode uses extents in ext4_inode_can_atomic_write()
ext4: Make ext4_meta_trans_blocks() non-static for later use
ext4: Add support for EXT4_GET_BLOCKS_QUERY_LEAF_BLOCKS
ext4: Add multi-fsblock atomic write support with bigalloc
ext4: Enable support for ext4 multi-fsblock atomic write using bigalloc
ext4: Add atomic block write documentation
.../filesystems/ext4/atomic_writes.rst | 220 +++++++++++++
Documentation/filesystems/ext4/overview.rst | 1 +
fs/ext4/ext4.h | 26 +-
fs/ext4/extents.c | 99 ++++++
fs/ext4/file.c | 7 +-
fs/ext4/inode.c | 307 ++++++++++++++++--
fs/ext4/super.c | 7 +-
7 files changed, 642 insertions(+), 25 deletions(-)
create mode 100644 Documentation/filesystems/ext4/atomic_writes.rst
--
2.49.0
next reply other threads:[~2025-05-15 14:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 14:45 Ritesh Harjani (IBM) [this message]
2025-05-15 14:45 ` [PATCH v4 1/7] ext4: Document an edge case for overwrites Ritesh Harjani (IBM)
2025-05-15 14:45 ` [PATCH v4 2/7] ext4: Check if inode uses extents in ext4_inode_can_atomic_write() Ritesh Harjani (IBM)
2025-05-15 14:45 ` [PATCH v4 3/7] ext4: Make ext4_meta_trans_blocks() non-static for later use Ritesh Harjani (IBM)
2025-05-15 14:45 ` [PATCH v4 4/7] ext4: Add support for EXT4_GET_BLOCKS_QUERY_LEAF_BLOCKS Ritesh Harjani (IBM)
2025-05-15 16:54 ` Darrick J. Wong
2025-05-15 14:45 ` [PATCH v4 5/7] ext4: Add multi-fsblock atomic write support with bigalloc Ritesh Harjani (IBM)
2025-05-15 16:53 ` Darrick J. Wong
2025-05-15 18:15 ` Ritesh Harjani
2025-05-15 19:12 ` Darrick J. Wong
2025-05-15 14:45 ` [PATCH v4 6/7] ext4: Enable support for ext4 multi-fsblock atomic write using bigalloc Ritesh Harjani (IBM)
2025-05-15 14:45 ` [PATCH v4 7/7] ext4: Add atomic block write documentation Ritesh Harjani (IBM)
2025-05-15 16:58 ` Darrick J. Wong
2025-05-15 18:14 ` Ritesh Harjani
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=cover.1747289779.git.ritesh.list@gmail.com \
--to=ritesh.list@gmail.com \
--cc=djwong@kernel.org \
--cc=jack@suse.cz \
--cc=john.g.garry@oracle.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--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