lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241206172828.3219989-3-cascardo@igalia.com>
Date: Fri,  6 Dec 2024 14:28:25 -0300
From: Thadeu Lima de Souza Cascardo <cascardo@...lia.com>
To: linux-ext4@...r.kernel.org
Cc: "Theodore Ts'o" <tytso@....edu>,
	Andreas Dilger <adilger.kernel@...ger.ca>,
	linux-kernel@...r.kernel.org,
	kernel-dev@...lia.com,
	Thadeu Lima de Souza Cascardo <cascardo@...lia.com>
Subject: [PATCH 2/5] ext4: inline: use cached i_inline_size instead of e_value_size

i_inline_size caches the total size of the inline data, it is always
EXT4_MIN_INLINE_DATA_SIZE plus the size of the system.data xattr value.

This avoids looking up for the entry again, which allows i_inline_off to be
used to point directly to the inline data.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@...lia.com>
---
 fs/ext4/inline.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index 0611a050668b..b49cfcadbd36 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -80,10 +80,8 @@ static int get_max_inline_xattr_value_size(struct inode *inode,
 		((void *)entry - (void *)IFIRST(header)) - sizeof(__u32);
 
 	if (EXT4_I(inode)->i_inline_off) {
-		entry = (struct ext4_xattr_entry *)
-			((void *)raw_inode + EXT4_I(inode)->i_inline_off);
-
-		free += EXT4_XATTR_SIZE(le32_to_cpu(entry->e_value_size));
+		free += EXT4_I(inode)->i_inline_size -
+				EXT4_MIN_INLINE_DATA_SIZE;
 		goto out;
 	}
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ