From: Viacheslav Dubeyko <slava@dubeyko.com>
To: glaubitz@physik.fu-berlin.de, frank.li@vivo.com
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
vdubeyko@coreweave.com, Viacheslav Dubeyko <slava@dubeyko.com>
Subject: [PATCH 0/2] hfsplus: make hidden directory name independent from nls
Date: Tue, 3 Nov 2026 19:46:03 -0800 [thread overview]
Message-ID: <20261104034605.1582293-1-slava@dubeyko.com> (raw)
HFS+ keeps the indirect node files of hard links in the hidden
directory of the root folder. On disk, its name is four U+0000 (NUL)
characters followed by "HFS+ Private Data". Currently, the catalog key
of this directory is built from the UTF-8 string HFSP_HIDDENDIR_NAME
by means of the nls table of the mount. hfsplus_fill_super() works
around it by temporarily replacing sbi->nls with utf8 table, but
hfsplus_reconfigure() creates the hidden directory on remount
read-write with the mount's nls table. As a result, with nls=cp437,
for example, the hidden directory is created with garbled name that
neither macOS nor the next mount recognizes.
At first, define the on-disk name of the hidden directory as
constant UTF-16 string hfsplus_hidden_dir_name_utf16, introduces
hfsplus_create_cat_uni() that creates catalog records for already
converted name, and removes the temporary nls replacement from
hfsplus_fill_super(). The length of the name is calculated from named
constants, and the UTF-8 and UTF-16 representations of the name are
distinguished by the HFSP_HIDDENDIR_NAME_UTF8* and
HFSP_HIDDENDIR_NAME_UTF16_LEN macros.
Secondly, add KUnit test that checks that hfsplus_asc2uni()
converts HFSP_HIDDENDIR_NAME_UTF8 with utf8 nls table into exactly
hfsplus_hidden_dir_name_utf16, with decomposition enabled and
disabled.
The hfsplus_unicode KUnit suite passes (35 tests) under UML.
Viacheslav Dubeyko (2):
hfsplus: make hidden directory name independent from mount's nls
hfsplus: add KUnit check for hidden directory name
fs/hfsplus/catalog.c | 83 ++++++++++++++++++++++++++++++--------
fs/hfsplus/hfsplus_fs.h | 6 +++
fs/hfsplus/super.c | 68 +++++++++++++++++--------------
fs/hfsplus/unicode_test.c | 55 +++++++++++++++++++++++++
include/linux/hfs_common.h | 20 ++++++++-
5 files changed, 182 insertions(+), 50 deletions(-)
base-commit: 71d5a8a05c83b61bce1884905c192eed34ed3069
--
2.43.0
next reply other threads:[~2026-11-04 3:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 3:46 Viacheslav Dubeyko [this message]
2026-11-04 3:46 ` [PATCH 1/2] hfsplus: make hidden directory name independent from mount's nls Viacheslav Dubeyko
2026-11-04 3:46 ` [PATCH 2/2] hfsplus: add KUnit check for hidden directory name Viacheslav Dubeyko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261104034605.1582293-1-slava@dubeyko.com \
--to=slava@dubeyko.com \
--cc=frank.li@vivo.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vdubeyko@coreweave.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®