From: Chuck Lever NFS and other remote filesystem protocols need to determine whether a local filesystem performs case-insensitive lookups so they can provide correct semantics to clients. Without this information, f2fs exports cannot properly advertise their filename case behavior. Report f2fs case sensitivity behavior via the FS_XFLAG_CASEFOLD flag. Like ext4, f2fs supports per-directory case folding via the casefold flag (IS_CASEFOLDED). Files are always case-preserving. Reviewed-by: Chao Yu Signed-off-by: Chuck Lever --- fs/f2fs/file.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index d7047ca6b98d..91c255bbbf48 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3439,6 +3439,13 @@ int f2fs_fileattr_get(struct dentry *dentry, struct file_kattr *fa) if (f2fs_sb_has_project_quota(F2FS_I_SB(inode))) fa->fsx_projid = from_kprojid(&init_user_ns, fi->i_projid); + /* + * f2fs preserves case (the default). If this inode is a + * casefolded directory, report case-insensitive; otherwise + * report case-sensitive (standard POSIX behavior). + */ + if (IS_CASEFOLDED(inode)) + fa->fsx_xflags |= FS_XFLAG_CASEFOLD; return 0; } -- 2.52.0