[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241022111059.2566137-23-yi.zhang@huaweicloud.com>
Date: Tue, 22 Oct 2024 19:10:53 +0800
From: Zhang Yi <yi.zhang@...weicloud.com>
To: linux-ext4@...r.kernel.org
Cc: linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
tytso@....edu,
adilger.kernel@...ger.ca,
jack@...e.cz,
ritesh.list@...il.com,
hch@...radead.org,
djwong@...nel.org,
david@...morbit.com,
zokeefe@...gle.com,
yi.zhang@...wei.com,
yi.zhang@...weicloud.com,
chengzhihao1@...wei.com,
yukuai3@...wei.com,
yangerkun@...wei.com
Subject: [PATCH 22/27] ext4: disable online defrag when inode using iomap buffered I/O path
From: Zhang Yi <yi.zhang@...wei.com>
Online defragmentation does not yet support the inode using iomap
buffered I/O path, as it still relies on ext4_get_block() to get blocks
and copy data. Therefore, we must disable it for the time being.
Signed-off-by: Zhang Yi <yi.zhang@...wei.com>
---
fs/ext4/move_extent.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index b64661ea6e0e..508e342b4a1d 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -610,6 +610,13 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,
return -EOPNOTSUPP;
}
+ if (ext4_test_inode_state(orig_inode, EXT4_STATE_BUFFERED_IOMAP) ||
+ ext4_test_inode_state(donor_inode, EXT4_STATE_BUFFERED_IOMAP)) {
+ ext4_msg(orig_inode->i_sb, KERN_ERR,
+ "Online defrag not supported for inode with iomap buffered IO path");
+ return -EOPNOTSUPP;
+ }
+
/* Protect orig and donor inodes against a truncate */
lock_two_nondirectories(orig_inode, donor_inode);
--
2.46.1
Powered by blists - more mailing lists