ext3: make default data ordering mode configurable

This makes the defautl ext3 data ordering mode (when no explicit
ordering is set) configurable, so as to allow people to default to
'data=writeback' and get the resulting latency improvements.

This is a non-issue if a filesystem has been explicitly set to some
ordering (with 'tune2fs').

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+26 -1
+19
fs/ext3/Kconfig
··· 28 To compile this file system support as a module, choose M here: the 29 module will be called ext3. 30 31 config EXT3_FS_XATTR 32 bool "Ext3 extended attributes" 33 depends on EXT3_FS
··· 28 To compile this file system support as a module, choose M here: the 29 module will be called ext3. 30 31 + config EXT3_DEFAULTS_TO_ORDERED 32 + bool "Default to 'data=ordered' in ext3 (legacy option)" 33 + depends on EXT3_FS 34 + help 35 + If a filesystem does not explicitly specify a data ordering 36 + mode, and the journal capability allowed it, ext3 used to 37 + historically default to 'data=ordered'. 38 + 39 + That was a rather unfortunate choice, because it leads to all 40 + kinds of latency problems, and the 'data=writeback' mode is more 41 + appropriate these days. 42 + 43 + You should probably always answer 'n' here, and if you really 44 + want to use 'data=ordered' mode, set it in the filesystem itself 45 + with 'tune2fs -o journal_data_ordered'. 46 + 47 + But if you really want to enable the legacy default, you can do 48 + so by answering 'y' to this question. 49 + 50 config EXT3_FS_XATTR 51 bool "Ext3 extended attributes" 52 depends on EXT3_FS
+7 -1
fs/ext3/super.c
··· 44 #include "acl.h" 45 #include "namei.h" 46 47 static int ext3_load_journal(struct super_block *, struct ext3_super_block *, 48 unsigned long journal_devnum); 49 static int ext3_create_journal(struct super_block *, struct ext3_super_block *, ··· 1925 cope, else JOURNAL_DATA */ 1926 if (journal_check_available_features 1927 (sbi->s_journal, 0, 0, JFS_FEATURE_INCOMPAT_REVOKE)) 1928 - set_opt(sbi->s_mount_opt, ORDERED_DATA); 1929 else 1930 set_opt(sbi->s_mount_opt, JOURNAL_DATA); 1931 break;
··· 44 #include "acl.h" 45 #include "namei.h" 46 47 + #ifdef CONFIG_EXT3_DEFAULTS_TO_ORDERED 48 + #define EXT3_MOUNT_DEFAULT_DATA_MODE EXT3_MOUNT_ORDERED_DATA 49 + #else 50 + #define EXT3_MOUNT_DEFAULT_DATA_MODE EXT3_MOUNT_WRITEBACK_DATA 51 + #endif 52 + 53 static int ext3_load_journal(struct super_block *, struct ext3_super_block *, 54 unsigned long journal_devnum); 55 static int ext3_create_journal(struct super_block *, struct ext3_super_block *, ··· 1919 cope, else JOURNAL_DATA */ 1920 if (journal_check_available_features 1921 (sbi->s_journal, 0, 0, JFS_FEATURE_INCOMPAT_REVOKE)) 1922 + set_opt(sbi->s_mount_opt, DEFAULT_DATA_MODE); 1923 else 1924 set_opt(sbi->s_mount_opt, JOURNAL_DATA); 1925 break;