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 06A86E9A04A for ; Tue, 17 Feb 2026 21:48:36 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:To:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6RS/F+xQbCY5sNkJmdkzKqFzOTJEzxqBhsZZ/A2Al/A=; b=Ql4B9x6kdwdSLpAx0mz7SdI4nJ XwUpNzc+qLgM6aJNYnAv5mFI1049OR0Ba6Be9Jzp3Dky8keDeqgGp9FIIaFWvETtbcdzflAWIdqtH KGL8K1dQHzSCsHKx9t+GIWdxKcqhzAfqVfHkudx+J3D+MqNVQTeA+ap2wTKOvKILRdL4=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vsSvr-0000aK-Mw; Tue, 17 Feb 2026 21:48:35 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vsSvq-0000a6-HP for linux-f2fs-devel@lists.sourceforge.net; Tue, 17 Feb 2026 21:48:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: 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=D4Z+9BUDOzbPXRDChQLVpSklsS1NKwsEnjAqjqNMe0c=; b=esBVe0MmaTHEzD8EhQI0zj+6QJ sMEkmJ6Gitk0wYFS0nk+klS+hzThuSrnPZJ/vKmzPGASyLTa6GzdrykXu9dxIZkp/4qjVZTtjkR4w CA16Pj20XJGeuSmhrAE+7xdUjl/p6RU7ttFaKw6T+z/72vFHsTqLvrE2Bdzme4H5dke4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=D4Z+9BUDOzbPXRDChQLVpSklsS1NKwsEnjAqjqNMe0c=; b=khf08hZUFs7GLgiNTrzcF4PAFr Wpt+T1y+i7StUUOAtBfjWR09Vdh3VGAaP0fL1hXPVRka5aXnKeCs5SU8xw9vPSlGVRMFQyInwcn5i DhJb/5flW4TSJejBvpsmojWXalv3QT+qfF9PZGH0qitCfLzDyUKeEXha+jyNy1IXJeoE=; Received: from sea.source.kernel.org ([172.234.252.31]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vsSvq-0002u6-3h for linux-f2fs-devel@lists.sourceforge.net; Tue, 17 Feb 2026 21:48:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id CE705405FD; Tue, 17 Feb 2026 21:48:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CC81C19421; Tue, 17 Feb 2026 21:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771364908; bh=/ikJUIG0jvt2cNahwy/tuVk+f4fXHtX9vTuCLPZ9sHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G4yebb6lDUKgImX3qbUhm1n02dmHbi6NZQ/mJeduFaOczLJjuFZqVlksQ1UGqu+9X N4syxRhBuswQKeeDi1S08Ol25XYfnUo4T5sDnl5y+P1w7afiLXXFUrRBsBGPJT7I96 xqBZjXPigKKB8apX0Vf6wiSIqMYje4ZguCbdwoicw8+LyQ9YPwI5ebdypQFNMLzXOZ agCJgWAiI7QxdgQYeFa/LbYJkQG7uXftxfvdOSy7mbQKF3KLm4GgW7anY7iQzII/0n ceMSo2jb5oaHpmGtU6vVEc+QhGZQnK2bAeq57lqSzd4zx4GcxeZObzEKABlVcEfiHu TndurdBcWP8JQ== To: Al Viro , Christian Brauner , Jan Kara Date: Tue, 17 Feb 2026 16:47:41 -0500 Message-ID: <20260217214741.1928576-18-cel@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260217214741.1928576-1-cel@kernel.org> References: <20260217214741.1928576-1-cel@kernel.org> MIME-Version: 1.0 X-Headers-End: 1vsSvq-0002u6-3h Subject: [f2fs-dev] [PATCH v8 17/17] 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, 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 ksmbd hard-codes FILE_CASE_SENSITIVE_SEARCH and FILE_CASE_PRESERVED_NAMES in FS_ATTRIBUTE_INFORMATION responses, incorrectly indicating all exports are case-sensitive. This breaks clients accessing case-insensitive filesystems like exFAT or ext4/f2fs directories with casefold enabled. Query actual case behavior via vfs_fileattr_get() and report accurate attributes to SMB clients. 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 Signed-off-by: Chuck Lever --- fs/smb/server/smb2pdu.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index cbb31efdbaa2..d2a64afdd950 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "glob.h" #include "smbfsctl.h" @@ -5497,16 +5498,28 @@ 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); + if (err && err != -ENOIOCTLCMD) { + 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