From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 654FE43C043; Tue, 20 Jan 2026 14:24:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919095; cv=none; b=GpUgq+03goeeio7ynJZI6jnHPbaCOCAGFgc2fOo2+oTzQX7D7WJZUeep93nrwgXskbWhITxNKwbyQhqu9neaWltCIP926bd1qxcKSdzjgjMSscxHzyqmECQ+tbKGMe+7om+Yj0Qlcsud1OfChsdAuMTW1i2pLrYvuooMCTgmIO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919095; c=relaxed/simple; bh=w+01RcBephbRBLBgu636K7j0MNJCHtYjll5ZCP+j9SA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LE9hGXiv6cuJRv9rooTNM2jFobahzt/NRq6V/bsM4uBwPFhg3f3TgxAgQrt5qqkCxE29RRd8IKZA0jZIB2etaLL3puNXWiN7IgCs4Da0xu/SJkaIbEjkCCwOhkP8zCEu5DJQyPzQPXvJCsSt0+kzqVnR6H5+dDlmdla5rBWXSWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iiobzWcV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iiobzWcV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F27DBC19422; Tue, 20 Jan 2026 14:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768919095; bh=w+01RcBephbRBLBgu636K7j0MNJCHtYjll5ZCP+j9SA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iiobzWcVhtHpzTJwzO5rOjm9RdxR9jR/2rUtQipptl/c0np+8SCXAaHWJM5Y625UV kWsnok8PKUMuHn3Eq3Ed9MOaANHaY09P+0hUzg0qC3OH1EsjZ4PElcqhYQp1065TgS AHdkS00ZEZXHbZvfiREItFeF0kEnNecXr8KUPOu75xL8EfrYtGD+QOmDLQ6RUecr44 9160l1hSK3c6Av8ZYAIMasMsLsdZaSqBcEYMLDHFBaVSAkEfSQ/6U3E1FswvT7uWw+ 5pg4yipuZCZZmarQ+t4b9QuypDilXT56WAYN+r45p9Vk8FMdVJX0mjxdyMEmtIt9+n 6j8pi72HZ+Djg== From: Chuck Lever To: Al Viro , Christian Brauner , Jan Kara Cc: , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-cifs@vger.kernel.org, , linux-f2fs-devel@lists.sourceforge.net, hirofumi@mail.parknet.co.jp, linkinjeon@kernel.org, sj1557.seo@samsung.com, yuezhang.mo@sony.com, almaz.alexandrovich@paragon-software.com, slava@dubeyko.com, glaubitz@physik.fu-berlin.de, frank.li@vivo.com, tytso@mit.edu, adilger.kernel@dilger.ca, cem@kernel.org, sfrench@samba.org, pc@manguebit.org, ronniesahlberg@gmail.com, sprasad@microsoft.com, trondmy@kernel.org, anna@kernel.org, jaegeuk@kernel.org, chao@kernel.org, hansg@kernel.org, senozhatsky@chromium.org, Chuck Lever Subject: [PATCH v6 05/16] hfs: Implement fileattr_get for case sensitivity Date: Tue, 20 Jan 2026 09:24:28 -0500 Message-ID: <20260120142439.1821554-6-cel@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260120142439.1821554-1-cel@kernel.org> References: <20260120142439.1821554-1-cel@kernel.org> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever Report HFS case sensitivity behavior via the FS_XFLAG_CASEFOLD flag. HFS is always case-insensitive (using Mac OS Roman case folding) and always preserves case at rest. Reviewed-by: Viacheslav Dubeyko Signed-off-by: Chuck Lever --- fs/hfs/dir.c | 1 + fs/hfs/hfs_fs.h | 2 ++ fs/hfs/inode.c | 13 +++++++++++++ 3 files changed, 16 insertions(+) diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 86a6b317b474..552156896105 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -321,4 +321,5 @@ const struct inode_operations hfs_dir_inode_operations = { .rmdir = hfs_remove, .rename = hfs_rename, .setattr = hfs_inode_setattr, + .fileattr_get = hfs_fileattr_get, }; diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h index e94dbc04a1e4..a25cdda8ab34 100644 --- a/fs/hfs/hfs_fs.h +++ b/fs/hfs/hfs_fs.h @@ -177,6 +177,8 @@ extern int hfs_get_block(struct inode *inode, sector_t block, extern const struct address_space_operations hfs_aops; extern const struct address_space_operations hfs_btree_aops; +struct file_kattr; +int hfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa); int hfs_write_begin(const struct kiocb *iocb, struct address_space *mapping, loff_t pos, unsigned int len, struct folio **foliop, void **fsdata); diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 524db1389737..8d7ef19af538 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "hfs_fs.h" #include "btree.h" @@ -698,6 +699,17 @@ static int hfs_file_fsync(struct file *filp, loff_t start, loff_t end, return ret; } +int hfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa) +{ + /* + * Report case-insensitive behavior: all name comparisons use + * Mac OS Roman case folding. FS_XFLAG_CASENONPRESERVING remains + * unset because original case is preserved on disk. + */ + fa->fsx_xflags |= FS_XFLAG_CASEFOLD; + return 0; +} + static const struct file_operations hfs_file_operations = { .llseek = generic_file_llseek, .read_iter = generic_file_read_iter, @@ -714,4 +726,5 @@ static const struct inode_operations hfs_file_inode_operations = { .lookup = hfs_file_lookup, .setattr = hfs_inode_setattr, .listxattr = generic_listxattr, + .fileattr_get = hfs_fileattr_get, }; -- 2.52.0