Skip to contentSkip to conversation

ext2, ext4: warn when mounting with dax enabled

PATCH In review Dan Williams 2 participants 2 messages Sep 29, 2015 – Oct 2, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext2, ext4: warn when mounting with dax enabled

Similar to XFS warn when mounting DAX while it is still considered under development. Also, aspects of the DAX implementation, for example synchronization against multiple faults and faults causing block allocation, depend on the correct implementation in the filesystem. The maturity of a given DAX implementation is filesystem specific.

Cc Jan Kara <[email protected]>
Cc "Theodore Ts'o" <[email protected]>
Cc Andreas Dilger <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Kirill A. Shutemov <[email protected]>

---
Given the pending investigations [1], and rather than marking FS_DAX broken, warn about DAX usage until we've landed fixes for the issues that Dave has identified.

[1]: https://lists.01.org/pipermail/linux-nvdimm/2015-September/002266.html

 fs/ext2/super.c |    2 ++
 fs/ext4/super.c |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
fs/ext2/super.c +2 -0
index 900e19cf9ef6..2597b0663bf2 100644
@@ -566,6 +566,8 @@ static int parse_options(char *options, struct super_block *sb)
 			/* Fall through */
 		case Opt_dax:
 #ifdef CONFIG_FS_DAX
+			ext2_msg(sb, KERN_WARNING,
+		"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
 			set_opt(sbi->s_mount_opt, DAX);
 #else
 			ext2_msg(sb, KERN_INFO, "dax option not supported");
fs/ext4/super.c +5 -1
index a63c7b0a10cf..4db6eb0b6979 100644
@@ -1656,8 +1656,12 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
 		}
 		sbi->s_jquota_fmt = m->mount_opt;
 #endif
-#ifndef CONFIG_FS_DAX
 	} else if (token == Opt_dax) {
+#ifdef CONFIG_FS_DAX
+		ext4_msg(sb, KERN_WARNING,
+		"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
+			sbi->s_mount_opt |= m->mount_opt;
+#else
 		ext4_msg(sb, KERN_INFO, "dax option not supported");
 		return -1;
 #endif
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Williams

Similar to XFS warn when mounting DAX while it is still considered under development. Also, aspects of the DAX implementation, for example synchronization against multiple faults and faults causing block allocation, depend on the correct implementation in the filesystem. The maturity of a given DAX implementation is filesystem specific.

Quoted 8 lines
Cc Jan Kara <[email protected]>
Cc "Theodore Ts'o" <[email protected]>
Cc Andreas Dilger <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Kirill A. Shutemov <[email protected]>

Agreed. You can add:

Honza

Quoted 44 lines

---
Given the pending investigations [1], and rather than marking FS_DAX broken, warn about DAX usage until we've landed fixes for the issues that Dave has identified.

[1]: https://lists.01.org/pipermail/linux-nvdimm/2015-September/002266.html

 fs/ext2/super.c |    2 ++
 fs/ext4/super.c |    6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
fs/ext2/super.c +2 -0
index 900e19cf9ef6..2597b0663bf2 100644
@@ -566,6 +566,8 @@ static int parse_options(char *options, struct super_block *sb)
 			/* Fall through */
 		case Opt_dax:
 #ifdef CONFIG_FS_DAX
+			ext2_msg(sb, KERN_WARNING,
+		"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
 			set_opt(sbi->s_mount_opt, DAX);
 #else
 			ext2_msg(sb, KERN_INFO, "dax option not supported");
fs/ext4/super.c +5 -1
index a63c7b0a10cf..4db6eb0b6979 100644
@@ -1656,8 +1656,12 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
 		}
 		sbi->s_jquota_fmt = m->mount_opt;
 #endif
-#ifndef CONFIG_FS_DAX
 	} else if (token == Opt_dax) {
+#ifdef CONFIG_FS_DAX
+		ext4_msg(sb, KERN_WARNING,
+		"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
+			sbi->s_mount_opt |= m->mount_opt;
+#else
 		ext4_msg(sb, KERN_INFO, "dax option not supported");
 		return -1;
 #endif
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR