Skip to contentSkip to conversation

generic/020: limit xattr value by 3802 bytes

PATCH In review Viacheslav Dubeyko 2 participants 2 messages Dec 24, 2025 – Dec 31, 2025 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/020: limit xattr value by 3802 bytes

HFS+ implementation supports only inline extended attributes. The size of value for inline xattr is limited by 3802 bytes [1].

[1] https://elixir.bootlin.com/linux/v6.19-rc2/source/include/linux/hfs_common.h#L626

---
 tests/generic/020 | 5 +++++
 1 file changed, 5 insertions(+)
tests/generic/020 +5 -0
index 8b77d5ca..540f539b 100755
@@ -168,6 +168,11 @@ _attr_get_maxval_size()
 		fi
 		max_attrval_size=$((65536 - $size - $selinux_size - $max_attrval_namelen))
 		;;
+	hfsplus)
+		# HFS+ implementation supports only inline extended attributes.
+		# The size of value for inline xattr is limited by 3802 bytes.
+		max_attrval_size=3802
+		;;
 	*)
 		# Assume max ~1 block of attrs
 		BLOCK_SIZE=`_get_block_size $TEST_DIR`
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Viacheslav Dubeyko

HFS+ implementation supports only inline extended attributes. The size of value for inline xattr is limited by 3802 bytes [1].

[1] https://elixir.bootlin.com/linux/v6.19-rc2/source/include/linux/hfs_common.h#L626

---
 tests/generic/020 | 5 +++++
 1 file changed, 5 insertions(+)
tests/generic/020 +0 -0
index 8b77d5ca..540f539b 100755

tests/generic/020 _attr_get_maxval_size() · line 175

Quoted 8 lines
tests/generic/020 +5 -0
@@ -168,6 +168,11 @@ _attr_get_maxval_size()
 		fi
 		max_attrval_size=$((65536 - $size - $selinux_size - $max_attrval_namelen))
 		;;
+	hfsplus)
+		# HFS+ implementation supports only inline extended attributes.
+		# The size of value for inline xattr is limited by 3802 bytes.
+		max_attrval_size=3802
+		;;

Glad to get supportes from HFS list, this patch looks good to me.

Quoted 6 lines
tests/generic/020 +0 -0
 	*)
 		# Assume max ~1 block of attrs
 		BLOCK_SIZE=`_get_block_size $TEST_DIR`
Signature · 1 line
2.43.0