diff mbox series

[1/2] ext4: commit inline data during fast commit

Message ID 20211015182513.395917-1-harshads@google.com
State Awaiting Upstream
Headers show
Series [1/2] ext4: commit inline data during fast commit | expand

Commit Message

harshad shirwadkar Oct. 15, 2021, 6:25 p.m. UTC
From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>

During the commit phase in fast commits if an inode with inline data
is being committed, also commit the inline data along with
inode. Since recovery code just blindly copies entire content found in
inode TLV, there is no change needed on the recovery path. Thus, this
change is backward compatiable.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
---
 fs/ext4/fast_commit.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Theodore Ts'o Nov. 4, 2021, 2:44 p.m. UTC | #1
On Fri, 15 Oct 2021 11:25:12 -0700, Harshad Shirwadkar wrote:
> From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
> 
> During the commit phase in fast commits if an inode with inline data
> is being committed, also commit the inline data along with
> inode. Since recovery code just blindly copies entire content found in
> inode TLV, there is no change needed on the recovery path. Thus, this
> change is backward compatiable.
> 
> [...]

Applied, thanks!

[1/2] ext4: commit inline data during fast commit
      commit: 6c31a689b2e9e1dee5cbe16b773648a2d84dfb02
[2/2] ext4: inline data inode fast commit replay fixes
      commit: 1ebf21784b19d5bc269f39a5d1eedb7f29a7d152

Best regards,
diff mbox series

Patch

diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index 8ea5a81e6554..744b000d9756 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -819,7 +819,9 @@  static int ext4_fc_write_inode(struct inode *inode, u32 *crc)
 	if (ret)
 		return ret;
 
-	if (EXT4_INODE_SIZE(inode->i_sb) > EXT4_GOOD_OLD_INODE_SIZE)
+	if (ext4_test_inode_flag(inode, EXT4_INODE_INLINE_DATA))
+		inode_len = EXT4_INODE_SIZE(inode->i_sb);
+	else if (EXT4_INODE_SIZE(inode->i_sb) > EXT4_GOOD_OLD_INODE_SIZE)
 		inode_len += ei->i_extra_isize;
 
 	fc_inode.fc_ino = cpu_to_le32(inode->i_ino);