[PATCH 1/5] ext4: inline: remove extra size check when writing data

Thadeu Lima de Souza Cascardo posted 5 patches 1 year ago
[PATCH 1/5] ext4: inline: remove extra size check when writing data
Posted by Thadeu Lima de Souza Cascardo 1 year ago
ext4_prepare_inline_data which is called right after the removed check has
the same check. This avoids extra calls to ext4_get_inode_loc and having to
traverse all xattrs in the inode twice for that check.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
---
 fs/ext4/inline.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index 401a224f0956..0611a050668b 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -668,9 +668,6 @@ int ext4_try_to_write_inline_data(struct address_space *mapping,
 	struct folio *folio;
 	struct ext4_iloc iloc;
 
-	if (pos + len > ext4_get_max_inline_size(inode))
-		goto convert;
-
 	ret = ext4_get_inode_loc(inode, &iloc);
 	if (ret)
 		return ret;
-- 
2.34.1