From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5C7FFF885A for ; Sat, 25 Apr 2026 01:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:To:In-Reply-To:References:Message-Id: MIME-Version:Date:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=P520NOtHnKMD7I29oKRSSLr2vVr72QihjVtSpFSenms=; b=BUsk13T5vLO3KfxF5gjODEJVBP 63He8TKcXuLlKMvEM5z+76XHB1okQrdwcZ9x7Ji8bFjf+Bah9DIVCLQ1Lvoa2eg0HmOZ9e4ERsD3v UKcsKRBEFsVtXLO0PausMzcXxJUtckX+5MbbekFu0RvJNEqSfbIsCsxrYKkchv0sKZ64=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wGSDh-0003YY-IF; Sat, 25 Apr 2026 01:54:09 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wGSDf-0003YD-MV for linux-f2fs-devel@lists.sourceforge.net; Sat, 25 Apr 2026 01:54:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Qs6qnFlSobQcv5xc7aYxWmzC4la8dGN3XVkmWSUbbdE=; b=b87nTvgJXGNdghfjGsp4jEQ99u frrdMIGTqrnfD0ay/oo3F+F4Cj3vSuArO2xoSAh7pYlzH+AV1uV3vFWe3d3lwXQzXgOkKwiCbaukp siFtGWylRIHpe//H40BLwsd28Qy/SRL5m9YmyA3mPJK11A9lCjKRyWvCwR/RbQsE7FoI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Qs6qnFlSobQcv5xc7aYxWmzC4la8dGN3XVkmWSUbbdE=; b=iOfqmTiFvPscios+tpZEyQom3n S78HFTKNgrugIsiB+/jrca+mLIpZ9YJpEcVbm8XY9q9gf55Y07c8i3UVfrRFNHZSNV3ylwZITl3PC VYFlsrAajiCKxSaZdVX0cl6fVeuQIPDfra7O4JiY5T7aAO+VBvG4NPbrM81lJowlpTxg=; Received: from tor.source.kernel.org ([172.105.4.254]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wGSDf-00033J-4y for linux-f2fs-devel@lists.sourceforge.net; Sat, 25 Apr 2026 01:54:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 80A3460052; Sat, 25 Apr 2026 01:54:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7D17C19425; Sat, 25 Apr 2026 01:53:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777082041; bh=WLSj6q07XGhooB1eQG/mkk9y+n+R25fNe7TfBGbYD6w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=f+14oXfNcR0y15fPuFCLp01DM94FDXmSl7es75IIr1L4hSm26GQHflKCsS/T+fCH7 IxqfvoCKWbcfqftl4glsZxs+3SLtpgCSHkUnoMkglQnXkjw8a835IAnJcl8opIY16Q xv98I0Bf1eJu9VneyqPhqDYrv1soNLxAtCRxTBoZgaso5zHqEi/IZrDgdjx0pqW+1k q7i/n+YROp2Wc52rxre4Ly05gxHjM/SxH+6EyIOxW92CC92MxiA9etHi4sB1HWl4GK 0Gf+QAJNHfBajMT+x7Fie4+Ju0FdgF/okPWs5a5teM3S7e6T5r6L9oGSMyjya+IOR9 sQL/+aD7qtmew== Date: Fri, 24 Apr 2026 21:53:17 -0400 MIME-Version: 1.0 Message-Id: <20260424-case-sensitivity-v11-15-de5619beddaf@oracle.com> References: <20260424-case-sensitivity-v11-0-de5619beddaf@oracle.com> In-Reply-To: <20260424-case-sensitivity-v11-0-de5619beddaf@oracle.com> To: Al Viro , Christian Brauner , Jan Kara X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2777; i=chuck.lever@oracle.com; h=from:subject:message-id; bh=bR19bllkdkbQhQ2DCXklF79gERXw2neFVWEG5vaHCMI=; b=owEBbQKS/ZANAwAKATNqszNvZn+XAcsmYgBp7B6RlXNMlI/rLhCwMFhVMU8ZABGegjkofRPR2 ncJdim+heqJAjMEAAEKAB0WIQQosuWwEobfJDzyPv4zarMzb2Z/lwUCaewekQAKCRAzarMzb2Z/ l1LND/4uqOXdd199YF0FpQLa57v96XaDEDTz2tsuu1Jy8Rm2pkaAXnt2S5mPdS/8jzkzmi8Oi6m X8XT6xcacj3KsdAAFTD22vS6WbgVdTAmqK65TET+/SmvLrIeaDdev8EEZnZoBoYSTPSDAcTs7qV 1Uzz5TZXPXu3LL9lifyrHKczsHxRp/BhX7soqltLsQ/MxdspB+mJfx5/pIOCT9FPWeBmGpkBUFQ t9OKuJS/b7g1R1HG1MXBx4SpEXth/mJZ1Y8+k0eeAnED3Tht8jjnMCAaVaqKxHbreQp7dpGLCMs j4ROrEqRnwFuKYciW5JQW7Fon0sKdOQmNBiKcE0B3SaJP0v/xGQRvJUOjixSrhd214JwfTiNl5L 1EUZwcRevf0/4qphDqBbebHD67q0dsygv4qA/5muzo7Bfa1+btVRlfqttC7WyiRVKuAfZ4m9rU0 HVG15pYcsZmOR5wT9PMxrhUCsRgWMpLtFW5MBUffzk5W5LYIvWxFS1WJg80XNFH2jKKenkyhHeo ontQczLzlnKsa/hSS8eetl3DOOvi/08TkI+xVlQAwzjrv9UpaOcOxuS1OOK1n4bHUnSiclMjqhK 7uTnYGGYWBmJx9yRhyzZXRZ06a/PyRhr6U3THDwc+IzuK3t4jHMf9Y0ul1U2EHaUgGawkyjbTRu 9PR5DEbJBJC+XtA== X-Developer-Key: i=chuck.lever@oracle.com; a=openpgp; fpr=28B2E5B01286DF243CF23EFE336AB3336F667F97 X-Headers-End: 1wGSDf-00033J-4y Subject: [f2fs-dev] [PATCH v11 15/15] ksmbd: Report filesystem case sensitivity via FS_ATTRIBUTE_INFORMATION X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Chuck Lever via Linux-f2fs-devel Reply-To: Chuck Lever Cc: pc@manguebit.org, yuezhang.mo@sony.com, cem@kernel.org, Roland Mainz , almaz.alexandrovich@paragon-software.com, adilger.kernel@dilger.ca, linux-cifs@vger.kernel.org, sfrench@samba.org, slava@dubeyko.com, linux-ext4@vger.kernel.org, linkinjeon@kernel.org, sprasad@microsoft.com, frank.li@vivo.com, ronniesahlberg@gmail.com, glaubitz@physik.fu-berlin.de, jaegeuk@kernel.org, hirofumi@mail.parknet.co.jp, linux-nfs@vger.kernel.org, tytso@mit.edu, linux-api@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, senozhatsky@chromium.org, Chuck Lever , hansg@kernel.org, anna@kernel.org, linux-fsdevel@vger.kernel.org, sj1557.seo@samsung.com, trondmy@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net From: Chuck Lever FS_ATTRIBUTE_INFORMATION responses have always reported FILE_CASE_SENSITIVE_SEARCH and FILE_CASE_PRESERVED_NAMES unconditionally. Case-insensitive filesystems like exFAT, and casefolded directories on ext4 or f2fs, have no way to signal their actual semantics to SMB clients. Now that filesystems expose case behavior through ->fileattr_get, query it via vfs_fileattr_get() and translate the FS_XFLAG_CASEFOLD and FS_XFLAG_CASENONPRESERVING flags into the corresponding SMB attributes. Filesystems without ->fileattr_get continue reporting default POSIX behavior (case-sensitive, case-preserving). SMB's FS_ATTRIBUTE_INFORMATION reports per-share attributes from the share root, not per-file. Shares mixing casefold and non-casefold directories report the root directory's behavior. Acked-by: Namjae Jeon Reviewed-by: Roland Mainz Signed-off-by: Chuck Lever --- fs/smb/server/smb2pdu.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index ee32e61b6d3c..face5390c614 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "glob.h" #include "smbfsctl.h" @@ -5541,16 +5542,33 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work, case FS_ATTRIBUTE_INFORMATION: { FILE_SYSTEM_ATTRIBUTE_INFO *info; + struct file_kattr fa = {}; size_t sz; + u32 attrs; + int err; info = (FILE_SYSTEM_ATTRIBUTE_INFO *)rsp->Buffer; - info->Attributes = cpu_to_le32(FILE_SUPPORTS_OBJECT_IDS | - FILE_PERSISTENT_ACLS | - FILE_UNICODE_ON_DISK | - FILE_CASE_PRESERVED_NAMES | - FILE_CASE_SENSITIVE_SEARCH | - FILE_SUPPORTS_BLOCK_REFCOUNTING); + attrs = FILE_SUPPORTS_OBJECT_IDS | + FILE_PERSISTENT_ACLS | + FILE_UNICODE_ON_DISK | + FILE_SUPPORTS_BLOCK_REFCOUNTING; + err = vfs_fileattr_get(path.dentry, &fa); + /* + * -EINVAL: ntfs-3g and other FUSE filesystems that lack + * FS_IOC_FSGETXATTR support. + */ + if (err && err != -ENOIOCTLCMD && err != -ENOTTY && + err != -EINVAL) { + path_put(&path); + return err; + } + if (!(fa.fsx_xflags & FS_XFLAG_CASEFOLD)) + attrs |= FILE_CASE_SENSITIVE_SEARCH; + if (!(fa.fsx_xflags & FS_XFLAG_CASENONPRESERVING)) + attrs |= FILE_CASE_PRESERVED_NAMES; + + info->Attributes = cpu_to_le32(attrs); info->Attributes |= cpu_to_le32(server_conf.share_fake_fscaps); if (test_share_config_flag(work->tcon->share_conf, -- 2.53.0 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel