Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose ZFS dataset case sensitivity setting via sb_opts #13607

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/sys/mntent.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,8 @@
#define MNTOPT_NOACL "noacl" /* likewise */
#define MNTOPT_POSIXACL "posixacl" /* likewise */
#define MNTOPT_MNTPOINT "mntpoint" /* mount point hint */
#define MNTOPT_CASESENSITIVE "casesensitive" /* case sensitivity */
#define MNTOPT_CASEINSENSITIVE "caseinsensitive" /* case insensitivity */
#define MNTOPT_CASEMIXED "casemixed" /* case mixed */

#endif /* _SYS_MNTENT_H */
7 changes: 7 additions & 0 deletions lib/libzfs/os/linux/libzfs_mount_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ static const option_map_t option_map[] = {
{ MNTOPT_ACL, MS_POSIXACL, ZS_COMMENT },
{ MNTOPT_NOACL, MS_COMMENT, ZS_COMMENT },
{ MNTOPT_POSIXACL, MS_POSIXACL, ZS_COMMENT },
/*
* Case sensitive options are just listed here to silently
* ignore the error if passed with zfs mount command.
*/
{ MNTOPT_CASESENSITIVE, MS_COMMENT, ZS_COMMENT },
{ MNTOPT_CASEINSENSITIVE, MS_COMMENT, ZS_COMMENT },
{ MNTOPT_CASEMIXED, MS_COMMENT, ZS_COMMENT },
#ifdef MS_NOATIME
{ MNTOPT_NOATIME, MS_NOATIME, ZS_COMMENT },
{ MNTOPT_ATIME, MS_COMMENT, ZS_COMMENT },
Expand Down
12 changes: 12 additions & 0 deletions module/os/linux/zfs/zpl_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,18 @@ __zpl_show_options(struct seq_file *seq, zfsvfs_t *zfsvfs)
}
#endif /* CONFIG_FS_POSIX_ACL */

switch (zfsvfs->z_case) {
case ZFS_CASE_SENSITIVE:
seq_puts(seq, ",casesensitive");
break;
case ZFS_CASE_INSENSITIVE:
seq_puts(seq, ",caseinsensitive");
break;
default:
seq_puts(seq, ",casemixed");
break;
}

return (0);
}

Expand Down