bcachefs xattr
Hi Kent,
Seems the max length of xattr name+value is only 2004 bytes. Why the limit of U8_MAX below?
root@bee:~# dd if=/dev/zero bs=1 count=1996 2>/dev/null | attr -s "long_attr" /mnt/test/attr.txt attr_set: Numerical result out of range Could not set "long_attr" for /mnt/test/attr.txt
183 int bch_xattr_set(struct inode *inode, const char *name,
...
230 if (value) {
231 struct keylist keys; 232 struct bkey_i_xattr *xattr; 233 unsigned u64s = BKEY_U64s +
234 DIV_ROUND_UP(sizeof(struct bch_xattr) +
235 qname.len + size,
236 sizeof(u64));
237
238 if (u64s > U8_MAX) {
239 ret = -ERANGE;
240 break;
241 }
Quoted 4 lines · Ming Lin
Hi Kent,
Seems the max length of xattr name+value is only 2004 bytes. Why the limit of
U8_MAXbelow?
The size of the key and value is stored as a u8 in units of u64s - the u64s field of struct bkey.
Quoted 21 lines
root@bee:~# dd if=/dev/zero bs=1 count=1996 2>/dev/null | attr -s "long_attr" /mnt/test/attr.txt attr_set: Numerical result out of range Could not set "long_attr" for /mnt/test/attr.txt183 int bch_xattr_set(struct inode *inode, const char *name,
...230 if (value) {
231 struct keylist keys; 232 struct bkey_i_xattr *xattr; 233 unsigned u64s = BKEY_U64s +234 DIV_ROUND_UP(sizeof(struct
bch_xattr) +
235 qname.len + size,
236 sizeof(u64));
237
238 if (u64s >U8_MAX) {
239 ret =-ERANGE;
240 break;
241 }
Quoted 8 lines · Kent Overstreet
Quoted 4 lines · Ming Lin
Hi Kent,
Seems the max length of xattr name+value is only 2004 bytes. Why the limit of
U8_MAXbelow?The size of the key and value is stored as a u8 in units of u64s - the u64s field of struct bkey.
xfstests/generic/020 failed.
Got it now.
xfs supports 64KB values.
In order to support larger size of value, does it make sense to store the value in "extent"?
Quoted 10 lines · Ming Lin
Quoted 8 lines · Kent Overstreet
Quoted 4 lines · Ming Lin
Hi Kent,
Seems the max length of xattr name+value is only 2004 bytes. Why the limit of
U8_MAXbelow?The size of the key and value is stored as a u8 in units of u64s - the u64s field of struct bkey.
Quoted 6 lines
xfstests/generic/020 failed.
Got it now.xfs supports 64KB values.
In order to support larger size of value, does it make sense to store the value in "extent"?
Perhaps, but let's leave that for now and add it if there's demand for it.