aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zhack.c
diff options
context:
space:
mode:
authorSanjeev Bagewadi <[email protected]>2021-06-18 08:55:01 +0000
committerBrian Behlendorf <[email protected]>2024-10-01 13:40:27 -0700
commit20232ecfaa34177bef6c08f2f1a55b8c8bd20da4 (patch)
treebf73738679244b1e7bef26152c2846f349c79d1a /cmd/zhack.c
parent3cf2bfa57008af7f0690f73491d7f9b4ac4ed65a (diff)
Support for longnames for files/directories (Linux part)
This patch adds the ability for zfs to support file/dir name up to 1023 bytes. This number is chosen so we can support up to 255 4-byte characters. This new feature is represented by the new feature flag feature@longname. A new dataset property "longname" is also introduced to toggle longname support for each dataset individually. This property can be disabled, even if it contains longname files. In such case, new file cannot be created with longname but existing longname files can still be looked up. Note that, to my knowledge native Linux filesystems don't support name longer than 255 bytes. So there might be programs not able to work with longname. Note that NFS server may needs to use exportfs_get_name to reconnect dentries, and the buffer being passed is limit to NAME_MAX+1 (256). So NFS may not work when longname is enabled. Note, FreeBSD vfs layer imposes a limit of 255 name lengh, so even though we add code to support it here, it won't actually work. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Closes #15921
Diffstat (limited to 'cmd/zhack.c')
-rw-r--r--cmd/zhack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zhack.c b/cmd/zhack.c
index 77284b895..f297afb65 100644
--- a/cmd/zhack.c
+++ b/cmd/zhack.c
@@ -203,7 +203,7 @@ static void
dump_obj(objset_t *os, uint64_t obj, const char *name)
{
zap_cursor_t zc;
- zap_attribute_t *za = zap_attribute_alloc();
+ zap_attribute_t *za = zap_attribute_long_alloc();
(void) printf("%s_obj:\n", name);