mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ojaswin Mujoo <ojaswin@linux.ibm.com>
To: linux-ext4@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>
Cc: Ritesh Harjani <ritesh.list@gmail.com>,
	Zhang Yi <yi.zhang@huawei.com>, Jan Kara <jack@suse.cz>,
	libaokun1@huawei.com, linux-kernel@vger.kernel.org
Subject: [PATCH 3/7] ext4: propagate flags to convert_initialized_extent()
Date: Sun,  4 Jan 2026 17:49:16 +0530	[thread overview]
Message-ID: <a8078155d7d97e0fcaae1c576112033c84968aec.1767528171.git.ojaswin@linux.ibm.com> (raw)
In-Reply-To: <cover.1767528171.git.ojaswin@linux.ibm.com>

Currently, ext4_zero_range passes EXT4_EX_NOCACHE flag to avoid caching
extents however this is not respected by convert_initialized_extent().
Hence, modify it to accept flags from the caller and to pass the flags
on to other extent manipulation functions it calls. This makes
sure the NOCACHE flag is respected throughout the code path.

Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
---
 fs/ext4/extents-test.c | 2 +-
 fs/ext4/extents.c      | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents-test.c b/fs/ext4/extents-test.c
index 4fb94d3c8a1e..54aed3eabfe2 100644
--- a/fs/ext4/extents-test.c
+++ b/fs/ext4/extents-test.c
@@ -422,7 +422,7 @@ static void test_convert_initialized(struct kunit *test)
 
 	map.m_lblk = param->split_map.m_lblk;
 	map.m_len = param->split_map.m_len;
-	convert_initialized_extent(NULL, inode, &map, path, &allocated);
+	convert_initialized_extent(NULL, inode, &map, path, 0, &allocated);
 
 	path = ext4_find_extent(inode, EX_DATA_LBLK, NULL, 0);
 	ex = path->p_ext;
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 0ad0a9f2e3d4..5228196f5ad4 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3845,6 +3845,7 @@ static struct ext4_ext_path *
 convert_initialized_extent(handle_t *handle, struct inode *inode,
 			   struct ext4_map_blocks *map,
 			   struct ext4_ext_path *path,
+			   int flags,
 			   unsigned int *allocated)
 {
 	struct ext4_extent *ex;
@@ -3870,7 +3871,7 @@ convert_initialized_extent(handle_t *handle, struct inode *inode,
 
 	if (ee_block != map->m_lblk || ee_len > map->m_len) {
 		path = ext4_split_convert_extents(handle, inode, map, path,
-				EXT4_GET_BLOCKS_CONVERT_UNWRITTEN, NULL);
+				flags | EXT4_GET_BLOCKS_CONVERT_UNWRITTEN, NULL);
 		if (IS_ERR(path))
 			return path;
 
@@ -4264,7 +4265,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
 			if ((!ext4_ext_is_unwritten(ex)) &&
 			    (flags & EXT4_GET_BLOCKS_CONVERT_UNWRITTEN)) {
 				path = convert_initialized_extent(handle,
-					inode, map, path, &allocated);
+					inode, map, path, flags, &allocated);
 				if (IS_ERR(path))
 					err = PTR_ERR(path);
 				goto out;
-- 
2.51.0


  parent reply	other threads:[~2026-01-04 12:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-04 12:19 [PATCH 0/7] ext4 extent split/convert refactor and kunit tests Ojaswin Mujoo
2026-01-04 12:19 ` [PATCH 1/7] ext4: kunit tests for extent splitting and conversion Ojaswin Mujoo
2026-01-04 12:19 ` [PATCH 2/7] ext4: kunit tests for higher level extent manipulation functions Ojaswin Mujoo
2026-01-04 12:19 ` Ojaswin Mujoo [this message]
2026-01-06 14:33   ` [PATCH 3/7] ext4: propagate flags to convert_initialized_extent() Jan Kara
2026-01-07  7:19     ` Ojaswin Mujoo
2026-01-04 12:19 ` [PATCH 4/7] ext4: propagate flags to ext4_convert_unwritten_extents_endio() Ojaswin Mujoo
2026-01-06 14:34   ` Jan Kara
2026-01-07  6:33   ` Zhang Yi
2026-01-07  6:59     ` Ojaswin Mujoo
2026-01-04 12:19 ` [PATCH 5/7] ext4: Refactor zeroout path and handle all cases Ojaswin Mujoo
2026-01-06 15:31   ` Jan Kara
2026-01-07  7:15     ` Ojaswin Mujoo
2026-01-08 11:58   ` Zhang Yi
2026-01-08 12:42     ` Ojaswin Mujoo
2026-01-08 12:54       ` Zhang Yi
2026-01-08 14:08         ` Ojaswin Mujoo
2026-01-04 12:19 ` [PATCH 6/7] ext4: Refactor split and convert extents Ojaswin Mujoo
2026-01-06 15:55   ` Jan Kara
2026-01-08 12:34   ` Zhang Yi
2026-01-12  9:41     ` Ojaswin Mujoo
2026-01-04 12:19 ` [PATCH 7/7] ext4: Allow zeroout when doing written to unwritten split Ojaswin Mujoo
2026-01-06 15:41   ` Jan Kara
2026-01-05  6:34 ` [PATCH 0/7] ext4 extent split/convert refactor and kunit tests Ojaswin Mujoo

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=a8078155d7d97e0fcaae1c576112033c84968aec.1767528171.git.ojaswin@linux.ibm.com \
    --to=ojaswin@linux.ibm.com \
    --cc=jack@suse.cz \
    --cc=libaokun1@huawei.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®